Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1133902pxj; Wed, 2 Jun 2021 22:26:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDHw7tRAmn5sBYisck18oE2H4a5/uQxzm2yDJ1hHB4d+CLfBWlPpWhQzEWRXBBkc//DAgw X-Received: by 2002:a17:907:1c1b:: with SMTP id nc27mr38578088ejc.114.1622697981024; Wed, 02 Jun 2021 22:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622697981; cv=none; d=google.com; s=arc-20160816; b=GnGuDutr7ycirA4Q0pBWFNpg50IeSxZtM7hLcEz/ugNwwTAmgUvK2Bpq2dqDpXz50C aT6kQ28jUDM1M7dLEDvCIJsn+QFvU/0Sk9x51tnqyQgcXHfimQiZLHX5EfVDBipk3wtP Lpl+Ympq84y0DdpCxJ00CXqpP3huEfRXaCgpyxIngftGfBRJspHn3GpIp6wJsw2d47Mp A0UBDbQhi02qvbnjB88CvGDb3BU8pRpjD4YMJzew42Q/MLBM0cenIgi0fKwNoMq50Kt7 9P8zT8gg2szbRNiZXc+Oildq2GPV2qcmHHYNJj+/RNWnF9qJ/+Kro85yQi1c9sC+A6Nt ZcHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=LTApVzdf2wv0mGqG9wauaQW0n7idtD+VY/e7PMEi/n8=; b=FNhZ29L+9wblGc+UKKlnG0AEGucB4TuGD5YuBzCxLKtIgB0VqMCW9gNbp4PXPm2yqC va+ssGv82rXRziV08BeHlRlOM/H+OqewciAu6j9GseTnkyHJQ3G6uOKquEFZdWdavrCh aVXVohxJQ9uCEz82BdsXFD0TOVPABSGB0shJqGMDfUXCG8A8pq+WYPRejYd2DSN31zll 4hvX1+sR9SlLLcl9U066GaoPklQ0YW9vQU4QEenossOc/V6ebrTMmyrj4Iz7iaV6rWRb aEOJIUGYzVot5z1gdmF9de48pbD2jgykxXjS1NkTs/dAgPdcVui/3Y+3tRH9zPU5hVr/ JwdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=H3f8ScJu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si1153159edv.565.2021.06.02.22.25.58; Wed, 02 Jun 2021 22:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=H3f8ScJu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbhFCFZ0 (ORCPT + 99 others); Thu, 3 Jun 2021 01:25:26 -0400 Received: from mout02.posteo.de ([185.67.36.66]:45303 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbhFCFZ0 (ORCPT ); Thu, 3 Jun 2021 01:25:26 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id A0F9D2400FD for ; Thu, 3 Jun 2021 07:23:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1622697820; bh=wABl0gIXHD83vUh96O7dBds8ys0Ab9hhQdDQP6Ecg44=; h=Date:From:To:Cc:Subject:From; b=H3f8ScJuqLpW3PxG/jt+bSyGFDPmuvss7d1SYLHsNNgJubg4BBDWyFQH6JlPM618V nLIa/AtF0o8Yvg/+ZjiJ1pvnfEJonESCXNxzIqXohf6TLmnc3pngdInmz096VNvTno 73eChTRm124cTXa0BXBHT1YjFRqlVXvIr/kmOX8voigQMA2HuKKEZ2feP9UttnC5zz PZS9f7YKzhvaoZ3IwTq5A17tvTjbYPEUrwUmQOkpuoAqWDsE/e9J7NgRCQVNsC5k1S UfYEXyPx74Wl+308Bn2hCO4t6hzKSr4dkRi5i9KCnfTkqFBhj9qRQdLYnoMQZmx7Y/ Yyw2ZmxcrW39g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FwZ7H5Lvnz9rxD; Thu, 3 Jun 2021 07:23:39 +0200 (CEST) Date: Thu, 3 Jun 2021 05:23:38 +0000 From: Wilken Gottwalt To: linux-kernel@vger.kernel.org Cc: Jean Delvare , Guenter Roeck , Jonathan Corbet , linux-hwmon@vger.kernel.org Subject: [PATCH] hwmon: corsair-psu: fix suspend behavior Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During standby some PSUs turn off the microcontroller. A re-init is required during resume or the microcontroller stays unresponsive. Fixes: 726c945ab2eb ("hwmon: (corsair-psu) Remove unneeded semicolons") Signed-off-by: Wilken Gottwalt --- drivers/hwmon/corsair-psu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c index 02298b86b57b..731d5117f9f1 100644 --- a/drivers/hwmon/corsair-psu.c +++ b/drivers/hwmon/corsair-psu.c @@ -771,6 +771,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 */ @@ -793,6 +803,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); -- 2.31.1