Messages in this thread Patch in this message |  | | From | "William A. Kennington III" <> | | Date | Mon, 04 May 2026 20:15:04 +0000 | | Subject | [PATCH v3 3/4] i2c: designware: Convert platform driver to use shutdown hook |
| |
Convert the platform 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-platdrv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 3351c4a9ef11..7ff7c1631e64 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -289,9 +289,22 @@ static const struct platform_device_id dw_i2c_platform_ids[] = { }; MODULE_DEVICE_TABLE(platform, dw_i2c_platform_ids); +static void dw_i2c_plat_shutdown(struct platform_device *pdev) +{ + struct dw_i2c_dev *i_dev = platform_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 platform_driver dw_i2c_driver = { .probe = dw_i2c_plat_probe, .remove = dw_i2c_plat_remove, + .shutdown = dw_i2c_plat_shutdown, .driver = { .name = "i2c_designware", .of_match_table = dw_i2c_of_match, -- 2.54.0.545.g6539524ca2-goog
|  |