[PATCH] i2c: i801: use i2c_mark_adapter_suspended/resumed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When entering the suspend callback, at first we should ensure that
transfers are finished and I2C core can't start further transfers.
Use i2c_mark_adapter_suspended() for this purpose, and complement it
with a call to i2c_mark_adapter_resumed() in the resume path.

Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx>
---
Rebased version of a previously discussed patch, now w/o touching
the remove and shutdown path.
---
 drivers/i2c/busses/i2c-i801.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 6d02a8b88..26f132277 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1818,6 +1818,7 @@ static int i801_suspend(struct device *dev)
 {
 	struct i801_priv *priv = dev_get_drvdata(dev);
 
+	i2c_mark_adapter_suspended(&priv->adapter);
 	i801_restore_regs(priv);
 
 	return 0;
@@ -1829,6 +1830,7 @@ static int i801_resume(struct device *dev)
 
 	i801_setup_hstcfg(priv);
 	i801_enable_host_notify(&priv->adapter);
+	i2c_mark_adapter_resumed(&priv->adapter);
 
 	return 0;
 }
-- 
2.42.0




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux