Show
Ignore:
Timestamp:
08/12/00 18:37:15 (13 years ago)
Author:
mds
Message:

(mds) add i2c block read/write support from Rickard Westman.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c/trunk/kernel/i2c-core.c

    r3482 r3491  
    11101110} 
    11111111 
     1112extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 
     1113                                          u8 command, u8 length, u8 *values) 
     1114{ 
     1115        union i2c_smbus_data data; 
     1116        int i; 
     1117        if (length > 32) 
     1118                length = 32; 
     1119        for (i = 1; i <= length; i++) 
     1120                data.block[i] = values[i-1]; 
     1121        data.block[0] = length; 
     1122        return i2c_smbus_xfer(client->adapter,client->addr,client->flags, 
     1123                              I2C_SMBUS_WRITE,command, 
     1124                              I2C_SMBUS_I2C_BLOCK_DATA,&data); 
     1125} 
     1126 
    11121127/* Simulate a SMBus command using the i2c protocol  
    11131128   No checking of parameters is done!  */