diff options
Diffstat (limited to 'drivers/media/video/adv7175.c')
-rw-r--r-- | drivers/media/video/adv7175.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index ca86de0c2805..1a2b111897d5 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c | |||
@@ -115,24 +115,21 @@ adv7175_write_block (struct i2c_client *client, | |||
115 | * the adapter understands raw I2C */ | 115 | * the adapter understands raw I2C */ |
116 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 116 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
117 | /* do raw I2C, not smbus compatible */ | 117 | /* do raw I2C, not smbus compatible */ |
118 | struct i2c_msg msg; | ||
119 | u8 block_data[32]; | 118 | u8 block_data[32]; |
119 | int block_len; | ||
120 | 120 | ||
121 | msg.addr = client->addr; | ||
122 | msg.flags = 0; | ||
123 | while (len >= 2) { | 121 | while (len >= 2) { |
124 | msg.buf = (char *) block_data; | 122 | block_len = 0; |
125 | msg.len = 0; | 123 | block_data[block_len++] = reg = data[0]; |
126 | block_data[msg.len++] = reg = data[0]; | ||
127 | do { | 124 | do { |
128 | block_data[msg.len++] = data[1]; | 125 | block_data[block_len++] = data[1]; |
129 | reg++; | 126 | reg++; |
130 | len -= 2; | 127 | len -= 2; |
131 | data += 2; | 128 | data += 2; |
132 | } while (len >= 2 && data[0] == reg && | 129 | } while (len >= 2 && data[0] == reg && |
133 | msg.len < 32); | 130 | block_len < 32); |
134 | if ((ret = i2c_transfer(client->adapter, | 131 | if ((ret = i2c_master_send(client, block_data, |
135 | &msg, 1)) < 0) | 132 | block_len)) < 0) |
136 | break; | 133 | break; |
137 | } | 134 | } |
138 | } else { | 135 | } else { |