Skip to content

Commit d43f027

Browse files
JianyuWang0623xiaoxiang781216
authored andcommitted
Thermal: Add dummy driver
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
1 parent b30f866 commit d43f027

File tree

5 files changed

+389
-0
lines changed

5 files changed

+389
-0
lines changed

drivers/thermal/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,27 @@ config THERMAL_PROCFS
3737
---help---
3838
Enable thermal procfs.
3939

40+
config THERMAL_DUMMY
41+
bool "Thermal dummy driver"
42+
default n
43+
---help---
44+
Enable thermal dummy driver.
45+
46+
if THERMAL_DUMMY
47+
48+
config THERMAL_DUMMY_POLLING_DELAY
49+
int "Polling delay"
50+
default 200
51+
---help---
52+
Polling delay(tick).
53+
54+
config THERMAL_DUMMY_CPUFREQ
55+
bool "Dummy cpufreq driver"
56+
default n
57+
depends on CPUFREQ
58+
---help---
59+
Enable cpufreq dummy driver.
60+
61+
endif # THERMAL_DUMMY
62+
4063
endif # THERMAL

drivers/thermal/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ ifeq ($(CONFIG_THERMAL_PROCFS),y)
3636
CSRCS += thermal_procfs.c
3737
endif
3838

39+
ifeq ($(CONFIG_THERMAL_DUMMY),y)
40+
CSRCS += thermal_dummy.c
41+
endif
42+
3943
DEPPATH += --dep-path thermal
4044
VPATH += thermal
4145

drivers/thermal/thermal_core.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,15 @@ int thermal_init(void)
926926
}
927927
#endif
928928

929+
#ifdef CONFIG_THERMAL_DUMMY
930+
ret = thermal_dummy_init();
931+
if (ret < 0)
932+
{
933+
therr("Dummy driver init failed!\n");
934+
return ret;
935+
}
936+
#endif
937+
929938
#ifdef CONFIG_THERMAL_CDEV_CPUFREQ
930939
if (NULL == thermal_cpufreq_cooling_register())
931940
{

drivers/thermal/thermal_core.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,10 @@ int thermal_zone_procfs_register(FAR struct thermal_zone_device_s *zdev);
8989
void thermal_zone_procfs_unregister(FAR struct thermal_zone_device_s *zdev);
9090
#endif
9191

92+
/* Dummy Driver */
93+
94+
#ifdef CONFIG_THERMAL_DUMMY
95+
int thermal_dummy_init(void);
96+
#endif
97+
9298
#endif /* __DRIVERS_THERMAL_THERMAL_CORE_H */

0 commit comments

Comments
 (0)