mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 controllers requests during system shutdown. Signed-off-by: William A. Kennington III <william@wkennington.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260527-dw-i2c-v5-3-3483057f8d67@wkennington.com
This commit is contained in:
parent
42b4f04a2f
commit
0a1b80e9db
|
|
@ -289,9 +289,23 @@ 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;
|
||||
|
||||
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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user