diff options
Diffstat (limited to 'drivers/media/video/saa7114.c')
-rw-r--r-- | drivers/media/video/saa7114.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index ce5a740..4a1f841 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -138,9 +138,6 @@ saa7114_write (struct i2c_client *client, u8 reg, u8 value) { - /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ - - /*decoder->reg[reg] = value;*/ return i2c_smbus_write_byte_data(client, reg, value); } @@ -156,25 +153,21 @@ saa7114_write_block (struct i2c_client *client, * the adapter understands raw I2C */ if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { /* do raw I2C, not smbus compatible */ - /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ - struct i2c_msg msg; u8 block_data[32]; + int block_len; - msg.addr = client->addr; - msg.flags = 0; while (len >= 2) { - msg.buf = (char *) block_data; - msg.len = 0; - block_data[msg.len++] = reg = data[0]; + block_len = 0; + block_data[block_len++] = reg = data[0]; do { - block_data[msg.len++] = - /*decoder->reg[reg++] =*/ data[1]; + block_data[block_len++] = data[1]; + reg++; len -= 2; data += 2; } while (len >= 2 && data[0] == reg && - msg.len < 32); - if ((ret = i2c_transfer(client->adapter, - &msg, 1)) < 0) + block_len < 32); + if ((ret = i2c_master_send(client, block_data, + block_len)) < 0) break; } } else { |