Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (raspberrypi) Add PM suspend/resume support

Add suspend/resume handler in order to stop firmware polling
during s2idle. This was just waking-up the system without a real
benefit.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Stefan Wahren and committed by
Guenter Roeck
c26eef89 4d2ffc42

+22
+22
drivers/hwmon/raspberrypi-hwmon.c
··· 128 128 return 0; 129 129 } 130 130 131 + static int rpi_hwmon_suspend(struct device *dev) 132 + { 133 + struct rpi_hwmon_data *data = dev_get_drvdata(dev); 134 + 135 + cancel_delayed_work_sync(&data->get_values_poll_work); 136 + 137 + return 0; 138 + } 139 + 140 + static int rpi_hwmon_resume(struct device *dev) 141 + { 142 + struct rpi_hwmon_data *data = dev_get_drvdata(dev); 143 + 144 + get_values_poll(&data->get_values_poll_work.work); 145 + 146 + return 0; 147 + } 148 + 149 + static DEFINE_SIMPLE_DEV_PM_OPS(rpi_hwmon_pm_ops, rpi_hwmon_suspend, 150 + rpi_hwmon_resume); 151 + 131 152 static struct platform_driver rpi_hwmon_driver = { 132 153 .probe = rpi_hwmon_probe, 133 154 .driver = { 134 155 .name = "raspberrypi-hwmon", 156 + .pm = pm_ptr(&rpi_hwmon_pm_ops), 135 157 }, 136 158 }; 137 159 module_platform_driver(rpi_hwmon_driver);