diff options
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index a6f3bc38fbe5..3f1f30313cd7 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -109,12 +109,16 @@ | |||
109 | 109 | ||
110 | /* PCI Address Constants */ | 110 | /* PCI Address Constants */ |
111 | #define SMBBAR 4 | 111 | #define SMBBAR 4 |
112 | #define SMBPCICTL 0x004 | ||
112 | #define SMBPCISTS 0x006 | 113 | #define SMBPCISTS 0x006 |
113 | #define SMBHSTCFG 0x040 | 114 | #define SMBHSTCFG 0x040 |
114 | 115 | ||
115 | /* Host status bits for SMBPCISTS */ | 116 | /* Host status bits for SMBPCISTS */ |
116 | #define SMBPCISTS_INTS 0x08 | 117 | #define SMBPCISTS_INTS 0x08 |
117 | 118 | ||
119 | /* Control bits for SMBPCICTL */ | ||
120 | #define SMBPCICTL_INTDIS 0x0400 | ||
121 | |||
118 | /* Host configuration bits for SMBHSTCFG */ | 122 | /* Host configuration bits for SMBHSTCFG */ |
119 | #define SMBHSTCFG_HST_EN 1 | 123 | #define SMBHSTCFG_HST_EN 1 |
120 | #define SMBHSTCFG_SMB_SMI_EN 2 | 124 | #define SMBHSTCFG_SMB_SMI_EN 2 |
@@ -1232,6 +1236,22 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1232 | priv->adapter.timeout = HZ / 5; | 1236 | priv->adapter.timeout = HZ / 5; |
1233 | 1237 | ||
1234 | if (priv->features & FEATURE_IRQ) { | 1238 | if (priv->features & FEATURE_IRQ) { |
1239 | u16 pcictl, pcists; | ||
1240 | |||
1241 | /* Complain if an interrupt is already pending */ | ||
1242 | pci_read_config_word(priv->pci_dev, SMBPCISTS, &pcists); | ||
1243 | if (pcists & SMBPCISTS_INTS) | ||
1244 | dev_warn(&dev->dev, "An interrupt is pending!\n"); | ||
1245 | |||
1246 | /* Check if interrupts have been disabled */ | ||
1247 | pci_read_config_word(priv->pci_dev, SMBPCICTL, &pcictl); | ||
1248 | if (pcictl & SMBPCICTL_INTDIS) { | ||
1249 | dev_info(&dev->dev, "Interrupts are disabled\n"); | ||
1250 | priv->features &= ~FEATURE_IRQ; | ||
1251 | } | ||
1252 | } | ||
1253 | |||
1254 | if (priv->features & FEATURE_IRQ) { | ||
1235 | init_waitqueue_head(&priv->waitq); | 1255 | init_waitqueue_head(&priv->waitq); |
1236 | 1256 | ||
1237 | err = request_irq(dev->irq, i801_isr, IRQF_SHARED, | 1257 | err = request_irq(dev->irq, i801_isr, IRQF_SHARED, |