diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-piix4.c')
| -rw-r--r-- | drivers/i2c/busses/i2c-piix4.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index a028617b8f13..f71b4d381c00 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | Intel PIIX4, 440MX | 22 | Intel PIIX4, 440MX |
| 23 | Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 | 23 | Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 |
| 24 | ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800 | 24 | ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800 |
| 25 | AMD Hudson-2, CZ | 25 | AMD Hudson-2, ML, CZ |
| 26 | SMSC Victory66 | 26 | SMSC Victory66 |
| 27 | 27 | ||
| 28 | Note: we assume there can only be one device, with one or more | 28 | Note: we assume there can only be one device, with one or more |
| @@ -235,7 +235,8 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev, | |||
| 235 | { | 235 | { |
| 236 | unsigned short piix4_smba; | 236 | unsigned short piix4_smba; |
| 237 | unsigned short smba_idx = 0xcd6; | 237 | unsigned short smba_idx = 0xcd6; |
| 238 | u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en; | 238 | u8 smba_en_lo, smba_en_hi, smb_en, smb_en_status; |
| 239 | u8 i2ccfg, i2ccfg_offset = 0x10; | ||
| 239 | 240 | ||
| 240 | /* SB800 and later SMBus does not support forcing address */ | 241 | /* SB800 and later SMBus does not support forcing address */ |
| 241 | if (force || force_addr) { | 242 | if (force || force_addr) { |
| @@ -245,7 +246,15 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev, | |||
| 245 | } | 246 | } |
| 246 | 247 | ||
| 247 | /* Determine the address of the SMBus areas */ | 248 | /* Determine the address of the SMBus areas */ |
| 248 | smb_en = (aux) ? 0x28 : 0x2c; | 249 | if ((PIIX4_dev->vendor == PCI_VENDOR_ID_AMD && |
| 250 | PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && | ||
| 251 | PIIX4_dev->revision >= 0x41) || | ||
| 252 | (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD && | ||
| 253 | PIIX4_dev->device == 0x790b && | ||
| 254 | PIIX4_dev->revision >= 0x49)) | ||
| 255 | smb_en = 0x00; | ||
| 256 | else | ||
| 257 | smb_en = (aux) ? 0x28 : 0x2c; | ||
| 249 | 258 | ||
| 250 | if (!request_region(smba_idx, 2, "smba_idx")) { | 259 | if (!request_region(smba_idx, 2, "smba_idx")) { |
| 251 | dev_err(&PIIX4_dev->dev, "SMBus base address index region " | 260 | dev_err(&PIIX4_dev->dev, "SMBus base address index region " |
| @@ -258,13 +267,22 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev, | |||
| 258 | smba_en_hi = inb_p(smba_idx + 1); | 267 | smba_en_hi = inb_p(smba_idx + 1); |
| 259 | release_region(smba_idx, 2); | 268 | release_region(smba_idx, 2); |
| 260 | 269 | ||
| 261 | if ((smba_en_lo & 1) == 0) { | 270 | if (!smb_en) { |
| 271 | smb_en_status = smba_en_lo & 0x10; | ||
| 272 | piix4_smba = smba_en_hi << 8; | ||
| 273 | if (aux) | ||
| 274 | piix4_smba |= 0x20; | ||
| 275 | } else { | ||
| 276 | smb_en_status = smba_en_lo & 0x01; | ||
| 277 | piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0; | ||
| 278 | } | ||
| 279 | |||
| 280 | if (!smb_en_status) { | ||
| 262 | dev_err(&PIIX4_dev->dev, | 281 | dev_err(&PIIX4_dev->dev, |
| 263 | "Host SMBus controller not enabled!\n"); | 282 | "Host SMBus controller not enabled!\n"); |
| 264 | return -ENODEV; | 283 | return -ENODEV; |
| 265 | } | 284 | } |
| 266 | 285 | ||
| 267 | piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0; | ||
| 268 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) | 286 | if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name)) |
| 269 | return -ENODEV; | 287 | return -ENODEV; |
| 270 | 288 | ||
