aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/adv7170.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 19:23:20 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 19:23:20 -0500
commit88f07ffb63add018bfafd480ec6a294088277f06 (patch)
tree64b657d06b3ae7de3f87544a85d83d0ed6a7e3a9 /drivers/media/video/adv7170.c
parentb6585dedac232ca79fe978d97a95fdaa6da24f66 (diff)
parent9aa45e34d2948f360f8c0e63d10f49015ca51edd (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: V4L/DVB (3568k): zoran: Use i2c_master_send when possible V4L/DVB (3568j): adv7175: Drop unused encoder dump command V4L/DVB (3568i): adv7175: Drop unused register cache V4L/DVB (3568h): cpia: correct email address V4L/DVB (3568g): sem2mutex: zoran V4L/DVB (3568f): saa7110: Fix array overrun V4L/DVB (3568e): bt856: Spare memory V4L/DVB (3568d): saa7111.c fix V4L/DVB (3568c): zoran: Init cleanups V4L/DVB (3568b): saa7111: Prevent array overrun V4L/DVB (3568a): saa7114: Fix i2c block write
Diffstat (limited to 'drivers/media/video/adv7170.c')
-rw-r--r--drivers/media/video/adv7170.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
index 6e2004cdec1f..671e36db224d 100644
--- a/drivers/media/video/adv7170.c
+++ b/drivers/media/video/adv7170.c
@@ -124,24 +124,21 @@ adv7170_write_block (struct i2c_client *client,
124 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 124 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
125 /* do raw I2C, not smbus compatible */ 125 /* do raw I2C, not smbus compatible */
126 struct adv7170 *encoder = i2c_get_clientdata(client); 126 struct adv7170 *encoder = i2c_get_clientdata(client);
127 struct i2c_msg msg;
128 u8 block_data[32]; 127 u8 block_data[32];
128 int block_len;
129 129
130 msg.addr = client->addr;
131 msg.flags = 0;
132 while (len >= 2) { 130 while (len >= 2) {
133 msg.buf = (char *) block_data; 131 block_len = 0;
134 msg.len = 0; 132 block_data[block_len++] = reg = data[0];
135 block_data[msg.len++] = reg = data[0];
136 do { 133 do {
137 block_data[msg.len++] = 134 block_data[block_len++] =
138 encoder->reg[reg++] = data[1]; 135 encoder->reg[reg++] = data[1];
139 len -= 2; 136 len -= 2;
140 data += 2; 137 data += 2;
141 } while (len >= 2 && data[0] == reg && 138 } while (len >= 2 && data[0] == reg &&
142 msg.len < 32); 139 block_len < 32);
143 if ((ret = i2c_transfer(client->adapter, 140 if ((ret = i2c_master_send(client, block_data,
144 &msg, 1)) < 0) 141 block_len)) < 0)
145 break; 142 break;
146 } 143 }
147 } else { 144 } else {