diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-09-23 01:23:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 01:06:07 -0200 |
commit | c72ba8e6ae7376d20e509a9a54a2dd45fb483fc2 (patch) | |
tree | 4f2b407b086309b411e7d7ea80c2a0a71ac604d9 /drivers/media | |
parent | 44243fc2ef99948bc9b046901880885616dd5e89 (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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/ir-kbd-i2c.c | 12 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-i2c.c | 1 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 5 |
3 files changed, 10 insertions, 8 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) static void ir_work(struct work_struct *work) { struct IR_i2c *ir = container_of(work, struct IR_i2c, work.work); - int polling_interval = 100; - - /* MSI TV@nywhere Plus requires more frequent polling - otherwise it will miss some keypresses */ - if (ir->c->adapter->id == I2C_HW_SAA7134 && ir->c->addr == 0x30) - polling_interval = 50; ir_key_poll(ir); - schedule_delayed_work(&ir->work, msecs_to_jiffies(polling_interval)); + schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling_interval)); } /* ----------------------------------------------------------------------- */ @@ -292,6 +286,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir->c = client; ir->input = input_dev; + ir->polling_interval = DEFAULT_POLLING_INTERVAL; i2c_set_clientdata(client, ir); switch(addr) { @@ -343,6 +338,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) if (init_data->type) ir_type = init_data->type; + if (init_data->polling_interval) + ir->polling_interval = init_data->polling_interval; + switch (init_data->internal_get_key_func) { case IR_KBD_GET_KEY_CUSTOM: /* 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 = { static struct i2c_adapter saa7134_adap_template = { .owner = THIS_MODULE, .name = "saa7134", - .id = I2C_HW_SAA7134, .algo = &saa7134_algo, }; 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) dev->init_data.name = "MSI TV@nywhere Plus"; dev->init_data.get_key = get_key_msi_tvanywhere_plus; dev->init_data.ir_codes = RC_MAP_MSI_TVANYWHERE_PLUS; + /* + * MSI TV@nyware Plus requires more frequent polling + * otherwise it will miss some keypresses + */ + dev->init_data.polling_interval = 50; info.addr = 0x30; /* MSI TV@nywhere Plus controller doesn't seem to respond to probes unless we read something from |