From: "William A. Kennington III" <william@wkennington.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jan Dabros <jsd@semihalf.com>,
Andi Shyti <andi.shyti@kernel.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
"William A. Kennington III" <william@wkennington.com>
Subject: [PATCH v5 2/4] i2c: designware: Convert PCI driver to use shutdown hook
Date: Mon, 11 May 2026 20:06:27 +0000 [thread overview]
Message-ID: <20260511-dw-i2c-v5-2-6c382e1b5de6@wkennington.com> (raw)
In-Reply-To: <20260511-dw-i2c-v5-0-6c382e1b5de6@wkennington.com>
Convert the PCI driver to use the new i2c_dw_shutdown() hook, allowing
the controller to gracefully NACK controller requests during system
shutdown.
Signed-off-by: William A. Kennington III <william@wkennington.com>
---
drivers/i2c/busses/i2c-designware-pcidrv.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index f21f9877c040..ab21d4414681 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -356,10 +356,24 @@ static const struct pci_device_id i2c_designware_pci_ids[] = {
};
MODULE_DEVICE_TABLE(pci, i2c_designware_pci_ids);
+static void i2c_dw_pci_shutdown(struct pci_dev *pdev)
+{
+ struct dw_i2c_dev *i_dev;
+
+ i_dev = pci_get_drvdata(pdev);
+ if (!i_dev)
+ return;
+
+ pm_runtime_disable(&pdev->dev);
+ if (!pm_runtime_status_suspended(&pdev->dev))
+ i2c_dw_shutdown(i_dev);
+}
+
static struct pci_driver dw_i2c_driver = {
.name = DRIVER_NAME,
.probe = i2c_dw_pci_probe,
.remove = i2c_dw_pci_remove,
+ .shutdown = i2c_dw_pci_shutdown,
.driver = {
.pm = pm_ptr(&i2c_dw_dev_pm_ops),
},
--
2.54.0.563.g4f69b47b94-goog
next prev parent reply other threads:[~2026-05-11 20:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 20:06 [PATCH v5 0/4] i2c: designware: Improve device disable handling William A. Kennington III
2026-05-11 20:06 ` [PATCH v5 1/4] i2c: designware: Introduce shutdown exported function William A. Kennington III
2026-05-11 20:06 ` William A. Kennington III [this message]
2026-05-11 20:06 ` [PATCH v5 3/4] i2c: designware: Convert platform driver to use shutdown hook William A. Kennington III
2026-05-11 20:06 ` [PATCH v5 4/4] i2c: designware: Handle active target cleanly William A. Kennington III
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=20260511-dw-i2c-v5-2-6c382e1b5de6@wkennington.com \
--to=william@wkennington.com \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/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