diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index e6ad8b50310a..8f82ff0f34eb 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1474,6 +1474,21 @@ static int rockchip_thermal_remove(struct platform_device *pdev) return 0; } +static void rockchip_thermal_shutdown(struct platform_device *pdev) +{ + struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); + int i; + + for (i = 0; i < thermal->chip->chn_num; i++) { + int id = thermal->sensors[i].id; + + if (thermal->tshut_mode != TSHUT_MODE_CRU) + thermal->chip->set_tshut_mode(id, thermal->regs, + TSHUT_MODE_CRU); + } + pinctrl_pm_select_sleep_state(&pdev->dev); +} + static int __maybe_unused rockchip_thermal_suspend(struct device *dev) { struct rockchip_thermal_data *thermal = dev_get_drvdata(dev); @@ -1548,6 +1563,7 @@ static struct platform_driver rockchip_thermal_driver = { }, .probe = rockchip_thermal_probe, .remove = rockchip_thermal_remove, + .shutdown = rockchip_thermal_shutdown, }; module_platform_driver(rockchip_thermal_driver);