mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08: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:
committed by
Alan C. Assis
parent
0b633946c0
commit
fef1a0702d
@@ -138,6 +138,13 @@ static const struct thermal_zone_map_s g_dummy_maps[] =
|
|||||||
.high = 2,
|
.high = 2,
|
||||||
.weight = 20
|
.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 =
|
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 = g_dummy_cpufreq_table,
|
||||||
.table_len = nitems(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 */
|
#endif /* CONFIG_THERMAL_DUMMY_CPUFREQ */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -334,6 +347,14 @@ int thermal_dummy_init(void)
|
|||||||
therr("Dummy cpufreq driver init failed!\n");
|
therr("Dummy cpufreq driver init failed!\n");
|
||||||
return ret;
|
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 */
|
#endif /* CONFIG_THERMAL_DUMMY_CPUFREQ */
|
||||||
|
|
||||||
/* Cooling Device */
|
/* Cooling Device */
|
||||||
|
|||||||
Reference in New Issue
Block a user