aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/adv7175.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/adv7175.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/adv7175.c')
-rw-r--r--drivers/media/video/adv7175.c51
1 files changed, 8 insertions, 43 deletions
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
index 6b17247adf87..085e8863cacb 100644
--- a/drivers/media/video/adv7175.c
+++ b/drivers/media/video/adv7175.c
@@ -67,8 +67,6 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
67/* ----------------------------------------------------------------------- */ 67/* ----------------------------------------------------------------------- */
68 68
69struct adv7175 { 69struct adv7175 {
70 unsigned char reg[128];
71
72 int norm; 70 int norm;
73 int input; 71 int input;
74 int enable; 72 int enable;
@@ -94,9 +92,6 @@ adv7175_write (struct i2c_client *client,
94 u8 reg, 92 u8 reg,
95 u8 value) 93 u8 value)
96{ 94{
97 struct adv7175 *encoder = i2c_get_clientdata(client);
98
99 encoder->reg[reg] = value;
100 return i2c_smbus_write_byte_data(client, reg, value); 95 return i2c_smbus_write_byte_data(client, reg, value);
101} 96}
102 97
@@ -119,25 +114,21 @@ adv7175_write_block (struct i2c_client *client,
119 * the adapter understands raw I2C */ 114 * the adapter understands raw I2C */
120 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 115 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
121 /* do raw I2C, not smbus compatible */ 116 /* do raw I2C, not smbus compatible */
122 struct adv7175 *encoder = i2c_get_clientdata(client);
123 struct i2c_msg msg;
124 u8 block_data[32]; 117 u8 block_data[32];
118 int block_len;
125 119
126 msg.addr = client->addr;
127 msg.flags = 0;
128 while (len >= 2) { 120 while (len >= 2) {
129 msg.buf = (char *) block_data; 121 block_len = 0;
130 msg.len = 0; 122 block_data[block_len++] = reg = data[0];
131 block_data[msg.len++] = reg = data[0];
132 do { 123 do {
133 block_data[msg.len++] = 124 block_data[block_len++] = data[1];
134 encoder->reg[reg++] = data[1]; 125 reg++;
135 len -= 2; 126 len -= 2;
136 data += 2; 127 data += 2;
137 } while (len >= 2 && data[0] == reg && 128 } while (len >= 2 && data[0] == reg &&
138 msg.len < 32); 129 block_len < 32);
139 if ((ret = i2c_transfer(client->adapter, 130 if ((ret = i2c_master_send(client, block_data,
140 &msg, 1)) < 0) 131 block_len)) < 0)
141 break; 132 break;
142 } 133 }
143 } else { 134 } else {
@@ -170,24 +161,6 @@ set_subcarrier_freq (struct i2c_client *client,
170 adv7175_write(client, 0x05, 0x25); 161 adv7175_write(client, 0x05, 0x25);
171} 162}
172 163
173#ifdef ENCODER_DUMP
174static void
175dump (struct i2c_client *client)
176{
177 struct adv7175 *encoder = i2c_get_clientdata(client);
178 int i, j;
179
180 printk(KERN_INFO "%s: registry dump\n", I2C_NAME(client));
181 for (i = 0; i < 182 / 8; i++) {
182 printk("%s: 0x%02x -", I2C_NAME(client), i * 8);
183 for (j = 0; j < 8; j++) {
184 printk(" 0x%02x", encoder->reg[i * 8 + j]);
185 }
186 printk("\n");
187 }
188}
189#endif
190
191/* ----------------------------------------------------------------------- */ 164/* ----------------------------------------------------------------------- */
192// Output filter: S-Video Composite 165// Output filter: S-Video Composite
193 166
@@ -406,14 +379,6 @@ adv7175_command (struct i2c_client *client,
406 } 379 }
407 break; 380 break;
408 381
409#ifdef ENCODER_DUMP
410 case ENCODER_DUMP:
411 {
412 dump(client);
413 }
414 break;
415#endif
416
417 default: 382 default:
418 return -EINVAL; 383 return -EINVAL;
419 } 384 }