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

hwmon: (corsair-psu) fix suspend behavior

During standby some PSUs turn off the microcontroller. A re-init is
required during resume or the microcontroller stays unresponsive.

Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver")
Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Link: https://lore.kernel.org/r/YLjCJiVtu5zgTabI@monster.powergraphx.local
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Wilken Gottwalt and committed by
Guenter Roeck
7656cd21 faffc5d8

+14
+14
drivers/hwmon/corsair-psu.c
··· 771 771 return 0; 772 772 } 773 773 774 + #ifdef CONFIG_PM 775 + static int corsairpsu_resume(struct hid_device *hdev) 776 + { 777 + struct corsairpsu_data *priv = hid_get_drvdata(hdev); 778 + 779 + /* some PSUs turn off the microcontroller during standby, so a reinit is required */ 780 + return corsairpsu_init(priv); 781 + } 782 + #endif 783 + 774 784 static const struct hid_device_id corsairpsu_idtable[] = { 775 785 { HID_USB_DEVICE(0x1b1c, 0x1c03) }, /* Corsair HX550i */ 776 786 { HID_USB_DEVICE(0x1b1c, 0x1c04) }, /* Corsair HX650i */ ··· 803 793 .probe = corsairpsu_probe, 804 794 .remove = corsairpsu_remove, 805 795 .raw_event = corsairpsu_raw_event, 796 + #ifdef CONFIG_PM 797 + .resume = corsairpsu_resume, 798 + .reset_resume = corsairpsu_resume, 799 + #endif 806 800 }; 807 801 module_hid_driver(corsairpsu_driver); 808 802