From b3d203d70576ee951969825bbd78aa87c721c787 Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Tue, 12 Jun 2018 10:51:13 +0900 Subject: [PATCH] thermal: samsung: Support boost ctrl callback. Change-Id: I2e50e85b9194456cf406e910ec75a9a5323bfa99 Signed-off-by: Hyeonseong Gil --- drivers/thermal/samsung/exynos_tmu.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 93350b81a70f..40cf135b5397 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #ifdef CONFIG_EXYNOS_MCINFO @@ -1088,6 +1089,22 @@ static struct notifier_block exynos_tmu_pm_notifier = { }; #endif +static int exynos_tmu_boost_callback(unsigned int cpu) +{ + struct thermal_zone_device *tz; + struct exynos_tmu_data *devnode; + + list_for_each_entry(devnode, &dtm_dev_list, node) { + if (devnode->id == 0) { + tz = devnode->tzd; + thermal_zone_device_update(tz, THERMAL_DEVICE_POWER_CAPABILITY_CHANGED); + break; + } + } + + return 0; +} + static const struct of_device_id exynos_tmu_match[] = { { .compatible = "samsung,exynos9810-tmu", }, { .compatible = "samsung,exynos9610-tmu", }, @@ -1719,12 +1736,15 @@ static int exynos_tmu_probe(struct platform_device *pdev) num_of_devices++; mutex_unlock(&data->lock); - if (list_is_singular(&dtm_dev_list)) + if (list_is_singular(&dtm_dev_list)) { #ifdef CONFIG_EXYNOS_ACPM_THERMAL exynos_acpm_tmu_set_init(&cap); #else register_pm_notifier(&exynos_tmu_pm_notifier); #endif + cpuhp_setup_state_nocalls(CPUHP_EXYNOS_BOOST_CTRL_POST, "dtm_boost_cb", + exynos_tmu_boost_callback, exynos_tmu_boost_callback); + } if (!IS_ERR(data->tzd)) data->tzd->ops->set_mode(data->tzd, THERMAL_DEVICE_ENABLED); -- 2.20.1