Skip to content

Commit

Permalink
hwmon: (corsair-psu) fix suspend behavior
Browse files Browse the repository at this point in the history
commit 7656cd2 upstream.

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 <wilken.gottwalt@posteo.net>
Link: https://lore.kernel.org/r/YLjCJiVtu5zgTabI@monster.powergraphx.local
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
wgottwalt authored and gregkh committed Jun 16, 2021
1 parent 0c010ea commit e3b478d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/hwmon/corsair-psu.c
Expand Up @@ -570,6 +570,16 @@ static int corsairpsu_raw_event(struct hid_device *hdev, struct hid_report *repo
return 0;
}

#ifdef CONFIG_PM
static int corsairpsu_resume(struct hid_device *hdev)
{
struct corsairpsu_data *priv = hid_get_drvdata(hdev);

/* some PSUs turn off the microcontroller during standby, so a reinit is required */
return corsairpsu_init(priv);
}
#endif

static const struct hid_device_id corsairpsu_idtable[] = {
{ HID_USB_DEVICE(0x1b1c, 0x1c03) }, /* Corsair HX550i */
{ HID_USB_DEVICE(0x1b1c, 0x1c04) }, /* Corsair HX650i */
Expand All @@ -592,6 +602,10 @@ static struct hid_driver corsairpsu_driver = {
.probe = corsairpsu_probe,
.remove = corsairpsu_remove,
.raw_event = corsairpsu_raw_event,
#ifdef CONFIG_PM
.resume = corsairpsu_resume,
.reset_resume = corsairpsu_resume,
#endif
};
module_hid_driver(corsairpsu_driver);

Expand Down

0 comments on commit e3b478d

Please sign in to comment.