Skip to content

Commit 7656cd2

Browse files
wgottwaltgroeck
authored andcommitted
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: d115b51 ("hwmon: add Corsair PSU HID controller driver") Signed-off-by: Wilken Gottwalt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent faffc5d commit 7656cd2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/hwmon/corsair-psu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,16 @@ static int corsairpsu_raw_event(struct hid_device *hdev, struct hid_report *repo
771771
return 0;
772772
}
773773

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+
774784
static const struct hid_device_id corsairpsu_idtable[] = {
775785
{ HID_USB_DEVICE(0x1b1c, 0x1c03) }, /* Corsair HX550i */
776786
{ HID_USB_DEVICE(0x1b1c, 0x1c04) }, /* Corsair HX650i */
@@ -793,6 +803,10 @@ static struct hid_driver corsairpsu_driver = {
793803
.probe = corsairpsu_probe,
794804
.remove = corsairpsu_remove,
795805
.raw_event = corsairpsu_raw_event,
806+
#ifdef CONFIG_PM
807+
.resume = corsairpsu_resume,
808+
.reset_resume = corsairpsu_resume,
809+
#endif
796810
};
797811
module_hid_driver(corsairpsu_driver);
798812

0 commit comments

Comments
 (0)