Changeset 5148

Show
Ignore:
Timestamp:
03/16/08 19:04:20 (6 months ago)
Author:
khali
Message:

Drop broken I2C block read support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r5147 r5148  
    44SVN-HEAD 
    55  Library: Don't choke on unrecognized devices, part 2 
     6  Module i2c-i801: Drop broken I2C block read support 
    67  Program sensors-detect: New device ID for the SMSC SCH5317 
    78 
  • lm-sensors/trunk/kernel/busses/i2c-i801.c

    r4946 r5148  
    4040    of Intel's '810' and other chipsets. 
    4141    See the doc/busses/i2c-i801 file for details. 
    42     I2C Block Read supported for ICH5 and higher
     42    I2C Block Read not supported
    4343    Block Process Call are not supported. 
    4444*/ 
     
    146146#define I801_PROC_CALL          0x10    /* later chips only, unimplemented */ 
    147147#define I801_BLOCK_DATA         0x14 
    148 #define I801_I2C_BLOCK_DATA     0x18    /* ich4 and later */ 
     148#define I801_I2C_BLOCK_DATA     0x18    /* unimplemented */ 
    149149#define I801_BLOCK_LAST         0x34 
    150150#define I801_I2C_BLOCK_LAST     0x38    /* unimplemented */ 
     
    166166static struct pci_dev *I801_dev; 
    167167static int isich4;      /* is PEC supported? */ 
    168 static int isich5;      /* is i2c block read supported? */ 
    169168 
    170169static int __devinit i801_setup(struct pci_dev *dev) 
     
    185184        else 
    186185                isich4 = 0; 
    187         isich5 = isich4 && dev->device != PCI_DEVICE_ID_INTEL_82801DB_3; 
    188186 
    189187        /* Determine the address of the SMBus area */ 
     
    326324                        pci_write_config_byte(I801_dev, SMBHSTCFG, 
    327325                                              hostc | SMBHSTCFG_I2C_EN); 
    328                 } else if (!isich5)
     326                } else
    329327                        dev_err(I801_dev, 
    330328                                "I2C_SMBUS_I2C_BLOCK_READ unsupported!\n"); 
     
    348346                if (i == len && read_write == I2C_SMBUS_READ) 
    349347                        smbcmd = I801_BLOCK_LAST; 
    350                 else if (command == I2C_SMBUS_I2C_BLOCK_DATA && 
    351                          read_write == I2C_SMBUS_READ) 
    352                         smbcmd = I801_I2C_BLOCK_DATA; 
    353348                else 
    354349                        smbcmd = I801_BLOCK_DATA; 
     
    419414 
    420415                if (i == 1 && read_write == I2C_SMBUS_READ) { 
    421                         if (command != I2C_SMBUS_I2C_BLOCK_DATA) { 
    422                                 len = inb_p(SMBHSTDAT0); 
    423                                 if (len < 1) 
    424                                         len = 1; 
    425                                 if (len > I2C_SMBUS_BLOCK_MAX) 
    426                                         len = I2C_SMBUS_BLOCK_MAX; 
    427                                 data->block[0] = len; 
    428                         } else { 
    429                                 /* if slave returns < 32 bytes transaction will fail */ 
    430                                 data->block[0] = 32; 
    431                         } 
     416                        len = inb_p(SMBHSTDAT0); 
     417                        if (len < 1) 
     418                                len = 1; 
     419                        if (len > I2C_SMBUS_BLOCK_MAX) 
     420                                len = I2C_SMBUS_BLOCK_MAX; 
     421                        data->block[0] = len; 
    432422                } 
    433423 
     
    592582             | (isich4 ? I2C_FUNC_SMBUS_HWPEC_CALC : 0) 
    593583#endif 
    594 #if 0 
    595              | (isich5 ? I2C_FUNC_SMBUS_READ_I2C_BLOCK 
    596                        : 0) 
    597 #endif 
    598584            ; 
    599585}