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 ce5a740e923e..4a1f841d0c77 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c | |||
@@ -138,9 +138,6 @@ saa7114_write (struct i2c_client *client, | |||
138 | u8 reg, | 138 | u8 reg, |
139 | u8 value) | 139 | u8 value) |
140 | { | 140 | { |
141 | /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ | ||
142 | |||
143 | /*decoder->reg[reg] = value;*/ | ||
144 | return i2c_smbus_write_byte_data(client, reg, value); | 141 | return i2c_smbus_write_byte_data(client, reg, value); |
145 | } | 142 | } |
146 | 143 | ||
@@ -156,25 +153,21 @@ saa7114_write_block (struct i2c_client *client, | |||
156 | * the adapter understands raw I2C */ | 153 | * the adapter understands raw I2C */ |
157 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 154 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
158 | /* do raw I2C, not smbus compatible */ | 155 | /* do raw I2C, not smbus compatible */ |
159 | /*struct saa7114 *decoder = i2c_get_clientdata(client);*/ | ||
160 | struct i2c_msg msg; | ||
161 | u8 block_data[32]; | 156 | u8 block_data[32]; |
157 | int block_len; | ||
162 | 158 | ||
163 | msg.addr = client->addr; | ||
164 | msg.flags = 0; | ||
165 | while (len >= 2) { | 159 | while (len >= 2) { |
166 | msg.buf = (char *) block_data; | 160 | block_len = 0; |
167 | msg.len = 0; | 161 | block_data[block_len++] = reg = data[0]; |
168 | block_data[msg.len++] = reg = data[0]; | ||
169 | do { | 162 | do { |
170 | block_data[msg.len++] = | 163 | block_data[block_len++] = data[1]; |
171 | /*decoder->reg[reg++] =*/ data[1]; | 164 | reg++; |
172 | len -= 2; | 165 | len -= 2; |
173 | data += 2; | 166 | data += 2; |
174 | } while (len >= 2 && data[0] == reg && | 167 | } while (len >= 2 && data[0] == reg && |
175 | msg.len < 32); | 168 | block_len < 32); |
176 | if ((ret = i2c_transfer(client->adapter, | 169 | if ((ret = i2c_master_send(client, block_data, |
177 | &msg, 1)) < 0) | 170 | block_len)) < 0) |
178 | break; | 171 | break; |
179 | } | 172 | } |
180 | } else { | 173 | } else { |