mirror of
https://github.com/apache/nuttx.git
synced 2026-08-05 06:10:27 +00:00
drivers/thermal/dummy: Add another passive cooling device
For case that CPUFreq was not enabled. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
0b633946c0
commit
fef1a0702d
1 changed files with 21 additions and 0 deletions
|
|
@ -138,6 +138,13 @@ static const struct thermal_zone_map_s g_dummy_maps[] =
|
|||
.high = 2,
|
||||
.weight = 20
|
||||
},
|
||||
{
|
||||
.trip_name = "cpu_alert0",
|
||||
.cdev_name = "passive_dev",
|
||||
.low = THERMAL_NO_LIMIT,
|
||||
.high = THERMAL_NO_LIMIT,
|
||||
.weight = 20
|
||||
},
|
||||
};
|
||||
|
||||
static const struct thermal_zone_params_s g_dummy_params =
|
||||
|
|
@ -206,6 +213,12 @@ static struct dummy_cpufreq_driver_s g_dummy_cpufreq_driver =
|
|||
.table = g_dummy_cpufreq_table,
|
||||
.table_len = nitems(g_dummy_cpufreq_table),
|
||||
};
|
||||
#else
|
||||
static struct dummy_cooling_device_s g_dummy_passive =
|
||||
{
|
||||
.cur_state = 0,
|
||||
.max_state = 1,
|
||||
};
|
||||
#endif /* CONFIG_THERMAL_DUMMY_CPUFREQ */
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -334,6 +347,14 @@ int thermal_dummy_init(void)
|
|||
therr("Dummy cpufreq driver init failed!\n");
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
cdev = thermal_cooling_device_register("passive_dev", &g_dummy_passive,
|
||||
&g_dummy_cooling_ops);
|
||||
if (cdev == NULL)
|
||||
{
|
||||
therr("Register cooling device passive_dev failed!\n");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
#endif /* CONFIG_THERMAL_DUMMY_CPUFREQ */
|
||||
|
||||
/* Cooling Device */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue