[PATCH] i2c: i801: Fix SMBus ENXIO on resume from suspend.

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

 



Disabling I2C_EN on resume as it was restored in
suspend when we set pci config to its original value.

ENXIO landing in rmi_smb_get_version,  i2c-i802 debug
pointing at i801_check_post and guesswork from reading
probe which has this tweak.

i801_smbus 0000:00:1f.3: No response
rmi4_smbus 0-002c: failed to get SMBus version number!
i801_smbus 0000:00:1f.3: No response
rmi4_physical rmi4-00: rmi_driver_reset_handler: Failed to read current IRQ mask.
i801_smbus 0000:00:1f.3: No response
rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -6.
rmi4_f01 rmi4-00.fn01: Resume failed with code -6.
rmi4_physical rmi4-00: Failed to suspend functions: -6
rmi4_smbus 0-002c: Failed to resume device: -6
rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).
i801_smbus 0000:00:1f.3: No response
rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).

Signed-off-by: Alban Browaeys <alban.browaeys@xxxxxxxxx>
---
 drivers/i2c/busses/i2c-i801.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 9e12a53ef7b8..b7b6c8ee2176 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1707,9 +1707,14 @@ static int i801_suspend(struct device *dev)
 
 static int i801_resume(struct device *dev)
 {
+	unsigned char temp;
 	struct pci_dev *pci_dev = to_pci_dev(dev);
 	struct i801_priv *priv = pci_get_drvdata(pci_dev);
 
+	pci_read_config_byte(pci_dev, SMBHSTCFG, &temp);
+	temp &= ~SMBHSTCFG_I2C_EN;	/* SMBus timing */
+	pci_write_config_byte(pci_dev, SMBHSTCFG, temp);
+
 	i801_enable_host_notify(&priv->adapter);
 
 	return 0;
-- 
2.15.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