aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-09-23 00:23:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:06:07 -0400
commitc72ba8e6ae7376d20e509a9a54a2dd45fb483fc2 (patch)
tree4f2b407b086309b411e7d7ea80c2a0a71ac604d9
parent44243fc2ef99948bc9b046901880885616dd5e89 (diff)
V4L/DVB: saa7134: get rid of I2C_HW_SAA7134
The only reason for keeping I2C_HW_SAA7134 is to allow setting a per-device polling interval. Just move this info to the platform data, allowing drivers to change it per device, where needed. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/ir-kbd-i2c.c12
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c5
-rw-r--r--include/media/ir-kbd-i2c.h9
4 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 91b2c88d4d72..5a000c65ae98 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -259,15 +259,9 @@ static void ir_key_poll(struct IR_i2c *ir)
259static void ir_work(struct work_struct *work) 259static void ir_work(struct work_struct *work)
260{ 260{
261 struct IR_i2c *ir = container_of(work, struct IR_i2c, work.work); 261 struct IR_i2c *ir = container_of(work, struct IR_i2c, work.work);
262 int polling_interval = 100;
263
264 /* MSI TV@nywhere Plus requires more frequent polling
265 otherwise it will miss some keypresses */
266 if (ir->c->adapter->id == I2C_HW_SAA7134 && ir->c->addr == 0x30)
267 polling_interval = 50;
268 262
269 ir_key_poll(ir); 263 ir_key_poll(ir);
270 schedule_delayed_work(&ir->work, msecs_to_jiffies(polling_interval)); 264 schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling_interval));
271} 265}
272 266
273/* ----------------------------------------------------------------------- */ 267/* ----------------------------------------------------------------------- */
@@ -292,6 +286,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
292 286
293 ir->c = client; 287 ir->c = client;
294 ir->input = input_dev; 288 ir->input = input_dev;
289 ir->polling_interval = DEFAULT_POLLING_INTERVAL;
295 i2c_set_clientdata(client, ir); 290 i2c_set_clientdata(client, ir);
296 291
297 switch(addr) { 292 switch(addr) {
@@ -343,6 +338,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
343 if (init_data->type) 338 if (init_data->type)
344 ir_type = init_data->type; 339 ir_type = init_data->type;
345 340
341 if (init_data->polling_interval)
342 ir->polling_interval = init_data->polling_interval;
343
346 switch (init_data->internal_get_key_func) { 344 switch (init_data->internal_get_key_func) {
347 case IR_KBD_GET_KEY_CUSTOM: 345 case IR_KBD_GET_KEY_CUSTOM:
348 /* The bridge driver provided us its own function */ 346 /* The bridge driver provided us its own function */
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index da41b6b1e64a..2d3f6d265bbf 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -328,7 +328,6 @@ static struct i2c_algorithm saa7134_algo = {
328static struct i2c_adapter saa7134_adap_template = { 328static struct i2c_adapter saa7134_adap_template = {
329 .owner = THIS_MODULE, 329 .owner = THIS_MODULE,
330 .name = "saa7134", 330 .name = "saa7134",
331 .id = I2C_HW_SAA7134,
332 .algo = &saa7134_algo, 331 .algo = &saa7134_algo,
333}; 332};
334 333
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 0b336ca6d55b..52a1ee5aefd0 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -959,6 +959,11 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
959 dev->init_data.name = "MSI TV@nywhere Plus"; 959 dev->init_data.name = "MSI TV@nywhere Plus";
960 dev->init_data.get_key = get_key_msi_tvanywhere_plus; 960 dev->init_data.get_key = get_key_msi_tvanywhere_plus;
961 dev->init_data.ir_codes = RC_MAP_MSI_TVANYWHERE_PLUS; 961 dev->init_data.ir_codes = RC_MAP_MSI_TVANYWHERE_PLUS;
962 /*
963 * MSI TV@nyware Plus requires more frequent polling
964 * otherwise it will miss some keypresses
965 */
966 dev->init_data.polling_interval = 50;
962 info.addr = 0x30; 967 info.addr = 0x30;
963 /* MSI TV@nywhere Plus controller doesn't seem to 968 /* MSI TV@nywhere Plus controller doesn't seem to
964 respond to probes unless we read something from 969 respond to probes unless we read something from
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 4102f0dd5c40..557c676ab7dc 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -3,6 +3,8 @@
3 3
4#include <media/ir-common.h> 4#include <media/ir-common.h>
5 5
6#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7
6struct IR_i2c; 8struct IR_i2c;
7 9
8struct IR_i2c { 10struct IR_i2c {
@@ -15,6 +17,8 @@ struct IR_i2c {
15 /* Used to avoid fast repeating */ 17 /* Used to avoid fast repeating */
16 unsigned char old; 18 unsigned char old;
17 19
20 u32 polling_interval; /* in ms */
21
18 struct delayed_work work; 22 struct delayed_work work;
19 char name[32]; 23 char name[32];
20 char phys[32]; 24 char phys[32];
@@ -34,8 +38,9 @@ enum ir_kbd_get_key_fn {
34/* Can be passed when instantiating an ir_video i2c device */ 38/* Can be passed when instantiating an ir_video i2c device */
35struct IR_i2c_init_data { 39struct IR_i2c_init_data {
36 char *ir_codes; 40 char *ir_codes;
37 const char *name; 41 const char *name;
38 u64 type; /* IR_TYPE_RC5, etc */ 42 u64 type; /* IR_TYPE_RC5, etc */
43 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
39 /* 44 /*
40 * Specify either a function pointer or a value indicating one of 45 * Specify either a function pointer or a value indicating one of
41 * ir_kbd_i2c's internal get_key functions 46 * ir_kbd_i2c's internal get_key functions