mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
i2c: designware: Convert PCI driver to use shutdown hook
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> 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-2-3483057f8d67@wkennington.com
This commit is contained in:
parent
199a0fd953
commit
42b4f04a2f
|
|
@ -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),
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user