diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
commit | 0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch) | |
tree | 4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/media/video/ir-kbd-i2c.c | |
parent | 00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff) | |
parent | 7655e594945289b418af39f6669fea4666a7b520 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits)
[media] af9015: Fix max I2C message size when used with tda18271
[media] IR: initialize ir_raw_event in few more drivers
[media] Guard a divide in v4l1 compat layer
[media] imon: fix nomouse modprobe option
[media] imon: remove redundant change_protocol call
[media] imon: fix my egregious brown paper bag w/rdev/idev split
[media] cafe_ccic: Configure ov7670 correctly
[media] ov7670: allow configuration of image size, clock speed, and I/O method
[media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016]
[media] af9015: map DigitalNow TinyTwin v2 remote
[media] DigitalNow TinyTwin remote controller
[media] af9015: RC fixes and improvements
videodev2.h.xml: Update to reflect the latest changes at videodev2.h
[media] v4l: document new Bayer and monochrome pixel formats
[media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
[media] tm6000: fix a macro coding style issue
tm6000: Remove some ugly debug code
[media] Nova-S-Plus audio line input
[media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers
...
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r-- | drivers/media/video/ir-kbd-i2c.c | 62 |
1 files changed, 5 insertions, 57 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 27ae8bbfb477..5a000c65ae98 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -146,26 +146,6 @@ static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | |||
146 | return 1; | 146 | return 1; |
147 | } | 147 | } |
148 | 148 | ||
149 | static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | ||
150 | { | ||
151 | unsigned char b; | ||
152 | |||
153 | /* poll IR chip */ | ||
154 | if (1 != i2c_master_recv(ir->c, &b, 1)) { | ||
155 | dprintk(1,"read error\n"); | ||
156 | return -EIO; | ||
157 | } | ||
158 | |||
159 | /* ignore 0xaa */ | ||
160 | if (b==0xaa) | ||
161 | return 0; | ||
162 | dprintk(2,"key %02x\n", b); | ||
163 | |||
164 | *ir_key = b; | ||
165 | *ir_raw = b; | ||
166 | return 1; | ||
167 | } | ||
168 | |||
169 | static int get_key_fusionhdtv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | 149 | static int get_key_fusionhdtv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) |
170 | { | 150 | { |
171 | unsigned char buf[4]; | 151 | unsigned char buf[4]; |
@@ -279,15 +259,9 @@ static void ir_key_poll(struct IR_i2c *ir) | |||
279 | static void ir_work(struct work_struct *work) | 259 | static void ir_work(struct work_struct *work) |
280 | { | 260 | { |
281 | 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); |
282 | int polling_interval = 100; | ||
283 | |||
284 | /* MSI TV@nywhere Plus requires more frequent polling | ||
285 | otherwise it will miss some keypresses */ | ||
286 | if (ir->c->adapter->id == I2C_HW_SAA7134 && ir->c->addr == 0x30) | ||
287 | polling_interval = 50; | ||
288 | 262 | ||
289 | ir_key_poll(ir); | 263 | ir_key_poll(ir); |
290 | schedule_delayed_work(&ir->work, msecs_to_jiffies(polling_interval)); | 264 | schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling_interval)); |
291 | } | 265 | } |
292 | 266 | ||
293 | /* ----------------------------------------------------------------------- */ | 267 | /* ----------------------------------------------------------------------- */ |
@@ -312,6 +286,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
312 | 286 | ||
313 | ir->c = client; | 287 | ir->c = client; |
314 | ir->input = input_dev; | 288 | ir->input = input_dev; |
289 | ir->polling_interval = DEFAULT_POLLING_INTERVAL; | ||
315 | i2c_set_clientdata(client, ir); | 290 | i2c_set_clientdata(client, ir); |
316 | 291 | ||
317 | switch(addr) { | 292 | switch(addr) { |
@@ -321,12 +296,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
321 | ir_type = IR_TYPE_OTHER; | 296 | ir_type = IR_TYPE_OTHER; |
322 | ir_codes = RC_MAP_EMPTY; | 297 | ir_codes = RC_MAP_EMPTY; |
323 | break; | 298 | break; |
324 | case 0x4b: | ||
325 | name = "PV951"; | ||
326 | ir->get_key = get_key_pv951; | ||
327 | ir_type = IR_TYPE_OTHER; | ||
328 | ir_codes = RC_MAP_PV951; | ||
329 | break; | ||
330 | case 0x18: | 299 | case 0x18: |
331 | case 0x1f: | 300 | case 0x1f: |
332 | case 0x1a: | 301 | case 0x1a: |
@@ -351,27 +320,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
351 | ir_type = IR_TYPE_RC5; | 320 | ir_type = IR_TYPE_RC5; |
352 | ir_codes = RC_MAP_FUSIONHDTV_MCE; | 321 | ir_codes = RC_MAP_FUSIONHDTV_MCE; |
353 | break; | 322 | break; |
354 | case 0x0b: | ||
355 | case 0x47: | ||
356 | case 0x71: | ||
357 | if (adap->id == I2C_HW_B_CX2388x || | ||
358 | adap->id == I2C_HW_B_CX2341X) { | ||
359 | /* Handled by cx88-input */ | ||
360 | name = adap->id == I2C_HW_B_CX2341X ? "CX2341x remote" | ||
361 | : "CX2388x remote"; | ||
362 | ir_type = IR_TYPE_RC5; | ||
363 | ir->get_key = get_key_haup_xvr; | ||
364 | if (hauppauge == 1) { | ||
365 | ir_codes = RC_MAP_HAUPPAUGE_NEW; | ||
366 | } else { | ||
367 | ir_codes = RC_MAP_RC5_TV; | ||
368 | } | ||
369 | } else { | ||
370 | /* Handled by saa7134-input */ | ||
371 | name = "SAA713x remote"; | ||
372 | ir_type = IR_TYPE_OTHER; | ||
373 | } | ||
374 | break; | ||
375 | case 0x40: | 323 | case 0x40: |
376 | name = "AVerMedia Cardbus remote"; | 324 | name = "AVerMedia Cardbus remote"; |
377 | ir->get_key = get_key_avermedia_cardbus; | 325 | ir->get_key = get_key_avermedia_cardbus; |
@@ -390,6 +338,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
390 | if (init_data->type) | 338 | if (init_data->type) |
391 | ir_type = init_data->type; | 339 | ir_type = init_data->type; |
392 | 340 | ||
341 | if (init_data->polling_interval) | ||
342 | ir->polling_interval = init_data->polling_interval; | ||
343 | |||
393 | switch (init_data->internal_get_key_func) { | 344 | switch (init_data->internal_get_key_func) { |
394 | case IR_KBD_GET_KEY_CUSTOM: | 345 | case IR_KBD_GET_KEY_CUSTOM: |
395 | /* The bridge driver provided us its own function */ | 346 | /* The bridge driver provided us its own function */ |
@@ -398,9 +349,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
398 | case IR_KBD_GET_KEY_PIXELVIEW: | 349 | case IR_KBD_GET_KEY_PIXELVIEW: |
399 | ir->get_key = get_key_pixelview; | 350 | ir->get_key = get_key_pixelview; |
400 | break; | 351 | break; |
401 | case IR_KBD_GET_KEY_PV951: | ||
402 | ir->get_key = get_key_pv951; | ||
403 | break; | ||
404 | case IR_KBD_GET_KEY_HAUP: | 352 | case IR_KBD_GET_KEY_HAUP: |
405 | ir->get_key = get_key_haup; | 353 | ir->get_key = get_key_haup; |
406 | break; | 354 | break; |