diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-i801.c')
| -rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 08847e8b8998..eb3627f35d12 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
| @@ -146,6 +146,7 @@ | |||
| 146 | #define SMBHSTCFG_HST_EN 1 | 146 | #define SMBHSTCFG_HST_EN 1 |
| 147 | #define SMBHSTCFG_SMB_SMI_EN 2 | 147 | #define SMBHSTCFG_SMB_SMI_EN 2 |
| 148 | #define SMBHSTCFG_I2C_EN 4 | 148 | #define SMBHSTCFG_I2C_EN 4 |
| 149 | #define SMBHSTCFG_SPD_WD 0x10 | ||
| 149 | 150 | ||
| 150 | /* TCO configuration bits for TCOCTL */ | 151 | /* TCO configuration bits for TCOCTL */ |
| 151 | #define TCOCTL_EN 0x0100 | 152 | #define TCOCTL_EN 0x0100 |
| @@ -865,9 +866,16 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, | |||
| 865 | block = 1; | 866 | block = 1; |
| 866 | break; | 867 | break; |
| 867 | case I2C_SMBUS_I2C_BLOCK_DATA: | 868 | case I2C_SMBUS_I2C_BLOCK_DATA: |
| 868 | /* NB: page 240 of ICH5 datasheet shows that the R/#W | 869 | /* |
| 869 | * bit should be cleared here, even when reading */ | 870 | * NB: page 240 of ICH5 datasheet shows that the R/#W |
| 870 | outb_p((addr & 0x7f) << 1, SMBHSTADD(priv)); | 871 | * bit should be cleared here, even when reading. |
| 872 | * However if SPD Write Disable is set (Lynx Point and later), | ||
| 873 | * the read will fail if we don't set the R/#W bit. | ||
| 874 | */ | ||
| 875 | outb_p(((addr & 0x7f) << 1) | | ||
| 876 | ((priv->original_hstcfg & SMBHSTCFG_SPD_WD) ? | ||
| 877 | (read_write & 0x01) : 0), | ||
| 878 | SMBHSTADD(priv)); | ||
| 871 | if (read_write == I2C_SMBUS_READ) { | 879 | if (read_write == I2C_SMBUS_READ) { |
| 872 | /* NB: page 240 of ICH5 datasheet also shows | 880 | /* NB: page 240 of ICH5 datasheet also shows |
| 873 | * that DATA1 is the cmd field when reading */ | 881 | * that DATA1 is the cmd field when reading */ |
| @@ -1573,6 +1581,8 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1573 | /* Disable SMBus interrupt feature if SMBus using SMI# */ | 1581 | /* Disable SMBus interrupt feature if SMBus using SMI# */ |
| 1574 | priv->features &= ~FEATURE_IRQ; | 1582 | priv->features &= ~FEATURE_IRQ; |
| 1575 | } | 1583 | } |
| 1584 | if (temp & SMBHSTCFG_SPD_WD) | ||
| 1585 | dev_info(&dev->dev, "SPD Write Disable is set\n"); | ||
| 1576 | 1586 | ||
| 1577 | /* Clear special mode bits */ | 1587 | /* Clear special mode bits */ |
| 1578 | if (priv->features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER)) | 1588 | if (priv->features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER)) |
