aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/adv7170.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/adv7170.c')
-rw-r--r--drivers/media/video/adv7170.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
index 4ce07ae62dac..671e36db224d 100644
--- a/drivers/media/video/adv7170.c
+++ b/drivers/media/video/adv7170.c
@@ -53,7 +53,6 @@ MODULE_AUTHOR("Maxim Yevtyushkin");
53MODULE_LICENSE("GPL"); 53MODULE_LICENSE("GPL");
54 54
55#include <linux/i2c.h> 55#include <linux/i2c.h>
56#include <linux/i2c-dev.h>
57 56
58#define I2C_NAME(x) (x)->name 57#define I2C_NAME(x) (x)->name
59 58
@@ -125,24 +124,21 @@ adv7170_write_block (struct i2c_client *client,
125 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 124 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
126 /* do raw I2C, not smbus compatible */ 125 /* do raw I2C, not smbus compatible */
127 struct adv7170 *encoder = i2c_get_clientdata(client); 126 struct adv7170 *encoder = i2c_get_clientdata(client);
128 struct i2c_msg msg;
129 u8 block_data[32]; 127 u8 block_data[32];
128 int block_len;
130 129
131 msg.addr = client->addr;
132 msg.flags = 0;
133 while (len >= 2) { 130 while (len >= 2) {
134 msg.buf = (char *) block_data; 131 block_len = 0;
135 msg.len = 0; 132 block_data[block_len++] = reg = data[0];
136 block_data[msg.len++] = reg = data[0];
137 do { 133 do {
138 block_data[msg.len++] = 134 block_data[block_len++] =
139 encoder->reg[reg++] = data[1]; 135 encoder->reg[reg++] = data[1];
140 len -= 2; 136 len -= 2;
141 data += 2; 137 data += 2;
142 } while (len >= 2 && data[0] == reg && 138 } while (len >= 2 && data[0] == reg &&
143 msg.len < 32); 139 block_len < 32);
144 if ((ret = i2c_transfer(client->adapter, 140 if ((ret = i2c_master_send(client, block_data,
145 &msg, 1)) < 0) 141 block_len)) < 0)
146 break; 142 break;
147 } 143 }
148 } else { 144 } else {