linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bastian Rieck <bastian@rieck.me>,
	grzegorz.alibozek@gmail.com, andrew.co@free.fr,
	meven29@gmail.com, pchernik@gmail.com, jorge.cep.mart@gmail.com,
	danielmorgan@disroot.org, bernie@codewiz.org,
	saipavanchitta1998@gmail.com, rubin@starset.net,
	maniette@gmail.com, nate@kde.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v1 2/2] usb: typec: ucsi: acpi: Implement resume callback
Date: Fri,  7 Oct 2022 13:09:51 +0300	[thread overview]
Message-ID: <20221007100951.43798-3-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20221007100951.43798-1-heikki.krogerus@linux.intel.com>

The ACPI driver needs to resume the interface by calling
ucsi_resume(). Otherwise we may fail to detect connections
and disconnections that happen while the system is
suspended.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=210425
Fixes: a94ecde41f7e ("usb: typec: ucsi: ccg: enable runtime pm support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi_acpi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index 8873c1644a295..ce0c8ef80c043 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -185,6 +185,15 @@ static int ucsi_acpi_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int ucsi_acpi_resume(struct device *dev)
+{
+	struct ucsi_acpi *ua = dev_get_drvdata(dev);
+
+	return ucsi_resume(ua->ucsi);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(ucsi_acpi_pm_ops, NULL, ucsi_acpi_resume);
+
 static const struct acpi_device_id ucsi_acpi_match[] = {
 	{ "PNP0CA0", 0 },
 	{ },
@@ -194,6 +203,7 @@ MODULE_DEVICE_TABLE(acpi, ucsi_acpi_match);
 static struct platform_driver ucsi_acpi_platform_driver = {
 	.driver = {
 		.name = "ucsi_acpi",
+		.pm = pm_ptr(&ucsi_acpi_pm_ops),
 		.acpi_match_table = ACPI_PTR(ucsi_acpi_match),
 	},
 	.probe = ucsi_acpi_probe,
-- 
2.35.1


  parent reply	other threads:[~2022-10-07 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 10:09 [PATCH v1 0/2] usb: typec: UCSI resume fix Heikki Krogerus
2022-10-07 10:09 ` [PATCH v1 1/2] usb: typec: ucsi: Check the connection on resume Heikki Krogerus
2022-10-07 10:09 ` Heikki Krogerus [this message]
2022-10-07 14:39 ` [PATCH v1 0/2] usb: typec: UCSI resume fix Greg Kroah-Hartman
2022-10-10  7:52   ` Heikki Krogerus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221007100951.43798-3-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andrew.co@free.fr \
    --cc=bastian@rieck.me \
    --cc=bernie@codewiz.org \
    --cc=danielmorgan@disroot.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=grzegorz.alibozek@gmail.com \
    --cc=jorge.cep.mart@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maniette@gmail.com \
    --cc=meven29@gmail.com \
    --cc=nate@kde.org \
    --cc=pchernik@gmail.com \
    --cc=rubin@starset.net \
    --cc=saipavanchitta1998@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).