diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-17 20:37:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:41 -0400 |
commit | 3ca9c09379e8f3be0744c47f72769457fa46e9f3 (patch) | |
tree | ab50d7301c0fbf6d1c250f45864e851954a37609 /drivers/media | |
parent | 227ad4ab9058ef2624934183e8083886cf64bf56 (diff) |
V4L/DVB (7597): em28xx: share the same xc3028 setup for analog and digital modes
Thanks to Devin Heitmueller <devin.heitmueller@gmail.com> and Aidan
Thornton" <makosoft@googlemail.com> for pointing some errors with the
previous scenario.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 24 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 17 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 2 |
3 files changed, 29 insertions, 14 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 710f110b6e8a..f4883b4a6b7a 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
37 | 37 | ||
38 | #include "em28xx.h" | 38 | #include "em28xx.h" |
39 | #include "tuner-xc2028.h" | ||
40 | 39 | ||
41 | static int tuner = -1; | 40 | static int tuner = -1; |
42 | module_param(tuner, int, 0444); | 41 | module_param(tuner, int, 0444); |
@@ -553,10 +552,25 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
553 | }; | 552 | }; |
554 | } | 553 | } |
555 | 554 | ||
555 | void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) | ||
556 | { | ||
557 | memset(ctl, 0, sizeof(*ctl)); | ||
558 | |||
559 | ctl->fname = XC2028_DEFAULT_FIRMWARE; | ||
560 | ctl->max_len = 64; | ||
561 | ctl->mts = em28xx_boards[dev->model].mts_firmware; | ||
562 | |||
563 | switch (dev->model) { | ||
564 | /* Add card-specific parameters for xc3028 here */ | ||
565 | default: | ||
566 | ctl->demod = XC3028_FE_OREN538; | ||
567 | } | ||
568 | } | ||
569 | EXPORT_SYMBOL_GPL(em28xx_setup_xc3028); | ||
570 | |||
556 | static void em28xx_config_tuner(struct em28xx *dev) | 571 | static void em28xx_config_tuner(struct em28xx *dev) |
557 | { | 572 | { |
558 | struct v4l2_priv_tun_config xc2028_cfg; | 573 | struct v4l2_priv_tun_config xc2028_cfg; |
559 | struct xc2028_ctrl ctl; | ||
560 | struct tuner_setup tun_setup; | 574 | struct tuner_setup tun_setup; |
561 | struct v4l2_frequency f; | 575 | struct v4l2_frequency f; |
562 | 576 | ||
@@ -571,11 +585,9 @@ static void em28xx_config_tuner(struct em28xx *dev) | |||
571 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); | 585 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
572 | 586 | ||
573 | if (dev->tuner_type == TUNER_XC2028) { | 587 | if (dev->tuner_type == TUNER_XC2028) { |
574 | memset(&ctl, 0, sizeof(ctl)); | 588 | struct xc2028_ctrl ctl; |
575 | 589 | ||
576 | ctl.fname = XC2028_DEFAULT_FIRMWARE; | 590 | em28xx_setup_xc3028(dev, &ctl); |
577 | ctl.max_len = 64; | ||
578 | ctl.mts = em28xx_boards[dev->model].mts_firmware; | ||
579 | 591 | ||
580 | xc2028_cfg.tuner = TUNER_XC2028; | 592 | xc2028_cfg.tuner = TUNER_XC2028; |
581 | xc2028_cfg.priv = &ctl; | 593 | xc2028_cfg.priv = &ctl; |
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 1645021191a8..1ceabeac4f7b 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -20,8 +20,6 @@ | |||
20 | #include <media/videobuf-vmalloc.h> | 20 | #include <media/videobuf-vmalloc.h> |
21 | 21 | ||
22 | #include "lgdt330x.h" | 22 | #include "lgdt330x.h" |
23 | #include "tuner-xc2028.h" | ||
24 | #include "tuner-xc2028-types.h" | ||
25 | 23 | ||
26 | MODULE_DESCRIPTION("driver for em28xx based DVB cards"); | 24 | MODULE_DESCRIPTION("driver for em28xx based DVB cards"); |
27 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 25 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); |
@@ -69,12 +67,15 @@ static int attach_xc3028(u8 addr, struct em28xx *dev) | |||
69 | { | 67 | { |
70 | struct dvb_frontend *fe; | 68 | struct dvb_frontend *fe; |
71 | struct xc2028_ctrl ctl; | 69 | struct xc2028_ctrl ctl; |
72 | struct xc2028_config cfg = { | 70 | struct xc2028_config cfg; |
73 | .i2c_adap = &dev->i2c_adap, | 71 | |
74 | .i2c_addr = addr, | 72 | memset (&cfg, 0, sizeof(cfg)); |
75 | .ctrl = &ctl, | 73 | cfg.i2c_adap = &dev->i2c_adap; |
76 | .callback = em28xx_tuner_callback, | 74 | cfg.i2c_addr = addr; |
77 | }; | 75 | cfg.ctrl = &ctl; |
76 | cfg.callback = em28xx_tuner_callback; | ||
77 | |||
78 | em28xx_setup_xc3028(dev, &ctl); | ||
78 | 79 | ||
79 | if (!dev->dvb.frontend) { | 80 | if (!dev->dvb.frontend) { |
80 | printk(KERN_ERR "%s/2: dvb frontend not attached. " | 81 | printk(KERN_ERR "%s/2: dvb frontend not attached. " |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 00d2f62142e3..fa1c74217a52 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) | 34 | #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) |
35 | #include <media/videobuf-dvb.h> | 35 | #include <media/videobuf-dvb.h> |
36 | #endif | 36 | #endif |
37 | #include "tuner-xc2028.h" | ||
37 | 38 | ||
38 | /* Boards supported by driver */ | 39 | /* Boards supported by driver */ |
39 | #define EM2800_BOARD_UNKNOWN 0 | 40 | #define EM2800_BOARD_UNKNOWN 0 |
@@ -462,6 +463,7 @@ extern struct usb_device_id em28xx_id_table[]; | |||
462 | extern const unsigned int em28xx_bcount; | 463 | extern const unsigned int em28xx_bcount; |
463 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir); | 464 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir); |
464 | int em28xx_tuner_callback(void *ptr, int command, int arg); | 465 | int em28xx_tuner_callback(void *ptr, int command, int arg); |
466 | void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl); | ||
465 | 467 | ||
466 | /* Provided by em28xx-input.c */ | 468 | /* Provided by em28xx-input.c */ |
467 | /* TODO: Check if the standard get_key handlers on ir-common can be used */ | 469 | /* TODO: Check if the standard get_key handlers on ir-common can be used */ |