[PATCH v3 2/4] i2c: designware: Convert PCI driver to use shutdown hook

William A. Kennington III
2026-05-04T20:15:05Z

Convert the PCI driver to use the new i2c_dw_shutdown() hook, allowing
the controller to gracefully NACK master requests during system shutdown.

Signed-off-by: William A. Kennington III <william@wkennington.com>
---
drivers/i2c/busses/i2c-designware-pcidrv.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index f21f9877c040..87074655c0e7 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -356,11 +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 = 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,
- .driver = {
+ .shutdown = i2c_dw_pci_shutdown,
+ .driver = {
.pm = pm_ptr(&i2c_dw_dev_pm_ops),
},
.id_table = i2c_designware_pci_ids,

--
2.54.0.545.g6539524ca2-goog