aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-09-22 23:51:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:06:07 -0400
commit44243fc2ef99948bc9b046901880885616dd5e89 (patch)
tree48c84ea222cbb44db21842dbed24727e2cec6931 /drivers/media/video
parentc0c46826274a4da5d9e312d7cfd4ca0806c0a358 (diff)
V4L/DVB: Remove the usage of I2C_HW_B_CX2388x on ir-kbd-i2c.c
Move the cx88 specific initialization for Hauppauge XVR remotes into cx88-input, removing the need for test it inside ir-kbd-i2c. The reference at cx88 for this symbol, at: drivers/media/video/cx88/cx88-i2c.c: core->i2c_adap.id = I2C_HW_B_CX2388x; drivers/media/video/cx88/cx88-vp3054-i2c.c: vp3054_i2c->adap.id = I2C_HW_B_CX2388x; Can't be removed yet, since lirc-i2c still uses it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c27
-rw-r--r--drivers/media/video/cx88/cx88-input.c51
-rw-r--r--drivers/media/video/cx88/cx88.h15
-rw-r--r--drivers/media/video/ir-kbd-i2c.c19
4 files changed, 51 insertions, 61 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 9d25d4f49268..f53836bb6a5a 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -183,30 +183,3 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
183 183
184 return core->i2c_rc; 184 return core->i2c_rc;
185} 185}
186
187void cx88_i2c_init_ir(struct cx88_core *core)
188{
189 /* Instantiate the IR receiver device, if present */
190 if (0 == core->i2c_rc) {
191 struct i2c_board_info info;
192 const unsigned short addr_list[] = {
193 0x18, 0x6b, 0x71,
194 I2C_CLIENT_END
195 };
196
197 memset(&info, 0, sizeof(struct i2c_board_info));
198 strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
199 /* Use quick read command for probe, some IR chips don't
200 * support writes */
201 i2c_new_probed_device(&core->i2c_adap, &info, addr_list,
202 i2c_probe_func_quick_read);
203 }
204}
205
206/* ----------------------------------------------------------------------- */
207
208/*
209 * Local variables:
210 * c-basic-offset: 8
211 * End:
212 */
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index eccc5e49a350..d52ce0e3bec9 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -609,13 +609,54 @@ void cx88_ir_irq(struct cx88_core *core)
609 return; 609 return;
610} 610}
611 611
612
613void cx88_i2c_init_ir(struct cx88_core *core)
614{
615 struct i2c_board_info info;
616 const unsigned short addr_list[] = {
617 0x18, 0x6b, 0x71,
618 I2C_CLIENT_END
619 };
620 const unsigned short *addrp;
621 /* Instantiate the IR receiver device, if present */
622 if (0 != core->i2c_rc)
623 return;
624
625 memset(&info, 0, sizeof(struct i2c_board_info));
626 strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
627
628 /*
629 * We can't call i2c_new_probed_device() because it uses
630 * quick writes for probing and at least some RC receiver
631 * devices only reply to reads.
632 * Also, Hauppauge XVR needs to be specified, as address 0x71
633 * conflicts with another remote type used with saa7134
634 */
635 for (addrp = addr_list; *addrp != I2C_CLIENT_END; addrp++) {
636 info.platform_data = NULL;
637 memset(&core->init_data, 0, sizeof(core->init_data));
638
639 if (*addrp == 0x71) {
640 /* Hauppauge XVR */
641 core->init_data.name = "cx88 Hauppauge XVR remote";
642 core->init_data.ir_codes = RC_MAP_HAUPPAUGE_NEW;
643 core->init_data.type = IR_TYPE_RC5;
644 core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
645
646 info.platform_data = &core->init_data;
647 }
648 if (i2c_smbus_xfer(&core->i2c_adap, *addrp, 0,
649 I2C_SMBUS_READ, 0,
650 I2C_SMBUS_QUICK, NULL) >= 0) {
651 info.addr = *addrp;
652 i2c_new_device(&core->i2c_adap, &info);
653 break;
654 }
655 }
656}
657
612/* ---------------------------------------------------------------------- */ 658/* ---------------------------------------------------------------------- */
613 659
614MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe"); 660MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe");
615MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls"); 661MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls");
616MODULE_LICENSE("GPL"); 662MODULE_LICENSE("GPL");
617/*
618 * Local variables:
619 * c-basic-offset: 8
620 * End:
621 */
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index bda9e3ee425e..127118f4b650 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -31,9 +31,8 @@
31#include <media/videobuf-dma-sg.h> 31#include <media/videobuf-dma-sg.h>
32#include <media/v4l2-chip-ident.h> 32#include <media/v4l2-chip-ident.h>
33#include <media/cx2341x.h> 33#include <media/cx2341x.h>
34#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
35#include <media/videobuf-dvb.h> 34#include <media/videobuf-dvb.h>
36#endif 35#include <media/ir-kbd-i2c.h>
37 36
38#include "btcx-risc.h" 37#include "btcx-risc.h"
39#include "cx88-reg.h" 38#include "cx88-reg.h"
@@ -377,6 +376,9 @@ struct cx88_core {
377 /* IR remote control state */ 376 /* IR remote control state */
378 struct cx88_IR *ir; 377 struct cx88_IR *ir;
379 378
379 /* I2C remote data */
380 struct IR_i2c_init_data init_data;
381
380 struct mutex lock; 382 struct mutex lock;
381 /* various v4l controls */ 383 /* various v4l controls */
382 u32 freq; 384 u32 freq;
@@ -650,7 +652,6 @@ extern const struct videobuf_queue_ops cx8800_vbi_qops;
650/* cx88-i2c.c */ 652/* cx88-i2c.c */
651 653
652extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci); 654extern int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci);
653extern void cx88_i2c_init_ir(struct cx88_core *core);
654 655
655 656
656/* ----------------------------------------------------------- */ 657/* ----------------------------------------------------------- */
@@ -688,6 +689,7 @@ int cx88_ir_fini(struct cx88_core *core);
688void cx88_ir_irq(struct cx88_core *core); 689void cx88_ir_irq(struct cx88_core *core);
689int cx88_ir_start(struct cx88_core *core); 690int cx88_ir_start(struct cx88_core *core);
690void cx88_ir_stop(struct cx88_core *core); 691void cx88_ir_stop(struct cx88_core *core);
692extern void cx88_i2c_init_ir(struct cx88_core *core);
691 693
692/* ----------------------------------------------------------- */ 694/* ----------------------------------------------------------- */
693/* cx88-mpeg.c */ 695/* cx88-mpeg.c */
@@ -707,10 +709,3 @@ int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f);
707int cx88_get_control(struct cx88_core *core, struct v4l2_control *ctl); 709int cx88_get_control(struct cx88_core *core, struct v4l2_control *ctl);
708int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl); 710int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl);
709int cx88_video_mux(struct cx88_core *core, unsigned int input); 711int cx88_video_mux(struct cx88_core *core, unsigned int input);
710
711/*
712 * Local variables:
713 * c-basic-offset: 8
714 * End:
715 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
716 */
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 02fbd08112c9..91b2c88d4d72 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -325,25 +325,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
325 ir_type = IR_TYPE_RC5; 325 ir_type = IR_TYPE_RC5;
326 ir_codes = RC_MAP_FUSIONHDTV_MCE; 326 ir_codes = RC_MAP_FUSIONHDTV_MCE;
327 break; 327 break;
328 case 0x0b:
329 case 0x47:
330 case 0x71:
331 if (adap->id == I2C_HW_B_CX2388x) {
332 /* Handled by cx88-input */
333 name = "CX2388x remote";
334 ir_type = IR_TYPE_RC5;
335 ir->get_key = get_key_haup_xvr;
336 if (hauppauge == 1) {
337 ir_codes = RC_MAP_HAUPPAUGE_NEW;
338 } else {
339 ir_codes = RC_MAP_RC5_TV;
340 }
341 } else {
342 /* Handled by saa7134-input */
343 name = "SAA713x remote";
344 ir_type = IR_TYPE_OTHER;
345 }
346 break;
347 case 0x40: 328 case 0x40:
348 name = "AVerMedia Cardbus remote"; 329 name = "AVerMedia Cardbus remote";
349 ir->get_key = get_key_avermedia_cardbus; 330 ir->get_key = get_key_avermedia_cardbus;