aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-03-07 15:55:43 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 15:43:17 -0400
commit7e48b30af033076c85ab48a8306b5588faf5fb4b (patch)
tree42ea19c832b2bcca5c1f888198628684b06232c5 /drivers/media
parent1c488ea9d52032d07dd320d31e0720239c93dd64 (diff)
V4L/DVB: dvb: add support for kworld 340u and ub435-q to em28xx-dvb
This adds support for the KWorld PlusTV 340U and KWorld UB345-Q ATSC sticks, which are really the same device. The sticks have an eMPIA em2870 usb bridge chipset, an LG Electronics LGDT3304 ATSC/QAM demodulator and an NXP TDA18271HD tuner -- early versions of the 340U have a a TDA18271HD/C1, later models and the UB435-Q have a C2. The stick has been tested succesfully with both VSB_8 and QAM_256 signals. Its using lgdt3304 support added to the lgdt3305 driver by a prior patch, rather than the current lgdt3304 driver, as its severely lacking in functionality by comparison (see said patch for details). Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c28
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c33
-rw-r--r--drivers/media/video/em28xx/em28xx.h1
3 files changed, 62 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 3a4fd851451..ffbe544e30f 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -158,6 +158,22 @@ static struct em28xx_reg_seq evga_indtube_digital[] = {
158 { -1, -1, -1, -1}, 158 { -1, -1, -1, -1},
159}; 159};
160 160
161/*
162 * KWorld PlusTV 340U and UB435-Q (ATSC) GPIOs map:
163 * EM_GPIO_0 - currently unknown
164 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
165 * EM_GPIO_2 - currently unknown
166 * EM_GPIO_3 - currently unknown
167 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
168 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
169 * EM_GPIO_6 - currently unknown
170 * EM_GPIO_7 - currently unknown
171 */
172static struct em28xx_reg_seq kworld_a340_digital[] = {
173 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
174 { -1, -1, -1, -1},
175};
176
161/* Pinnacle Hybrid Pro eb1a:2881 */ 177/* Pinnacle Hybrid Pro eb1a:2881 */
162static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = { 178static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
163 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10}, 179 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
@@ -1667,6 +1683,16 @@ struct em28xx_board em28xx_boards[] = {
1667 .tuner_gpio = reddo_dvb_c_usb_box, 1683 .tuner_gpio = reddo_dvb_c_usb_box,
1668 .has_dvb = 1, 1684 .has_dvb = 1,
1669 }, 1685 },
1686 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
1687 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
1688 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
1689 [EM2870_BOARD_KWORLD_A340] = {
1690 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
1691 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1692 .has_dvb = 1,
1693 .dvb_gpio = kworld_a340_digital,
1694 .tuner_gpio = default_tuner_gpio,
1695 },
1670}; 1696};
1671const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); 1697const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
1672 1698
@@ -1788,6 +1814,8 @@ struct usb_device_id em28xx_id_table[] = {
1788 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ }, 1814 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
1789 { USB_DEVICE(0xeb1a, 0x50a6), 1815 { USB_DEVICE(0xeb1a, 0x50a6),
1790 .driver_info = EM2860_BOARD_GADMEI_UTV330 }, 1816 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
1817 { USB_DEVICE(0x1b80, 0xa340),
1818 .driver_info = EM2870_BOARD_KWORLD_A340 },
1791 { }, 1819 { },
1792}; 1820};
1793MODULE_DEVICE_TABLE(usb, em28xx_id_table); 1821MODULE_DEVICE_TABLE(usb, em28xx_id_table);
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index cf1d8c3655f..3ac8d3025fe 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -30,11 +30,13 @@
30#include "tuner-simple.h" 30#include "tuner-simple.h"
31 31
32#include "lgdt330x.h" 32#include "lgdt330x.h"
33#include "lgdt3305.h"
33#include "zl10353.h" 34#include "zl10353.h"
34#include "s5h1409.h" 35#include "s5h1409.h"
35#include "mt352.h" 36#include "mt352.h"
36#include "mt352_priv.h" /* FIXME */ 37#include "mt352_priv.h" /* FIXME */
37#include "tda1002x.h" 38#include "tda1002x.h"
39#include "tda18271.h"
38 40
39MODULE_DESCRIPTION("driver for em28xx based DVB cards"); 41MODULE_DESCRIPTION("driver for em28xx based DVB cards");
40MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); 42MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
@@ -231,6 +233,18 @@ static struct lgdt330x_config em2880_lgdt3303_dev = {
231 .demod_chip = LGDT3303, 233 .demod_chip = LGDT3303,
232}; 234};
233 235
236static struct lgdt3305_config em2870_lgdt3304_dev = {
237 .i2c_addr = 0x0e,
238 .demod_chip = LGDT3304,
239 .spectral_inversion = 1,
240 .deny_i2c_rptr = 1,
241 .mpeg_mode = LGDT3305_MPEG_PARALLEL,
242 .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE,
243 .tpvalid_polarity = LGDT3305_TP_VALID_HIGH,
244 .vsb_if_khz = 3250,
245 .qam_if_khz = 4000,
246};
247
234static struct zl10353_config em28xx_zl10353_with_xc3028 = { 248static struct zl10353_config em28xx_zl10353_with_xc3028 = {
235 .demod_address = (0x1e >> 1), 249 .demod_address = (0x1e >> 1),
236 .no_tuner = 1, 250 .no_tuner = 1,
@@ -247,6 +261,17 @@ static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
247 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 261 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
248}; 262};
249 263
264static struct tda18271_std_map kworld_a340_std_map = {
265 .atsc_6 = { .if_freq = 3250, .agc_mode = 3, .std = 0,
266 .if_lvl = 1, .rfagc_top = 0x37, },
267 .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 1,
268 .if_lvl = 1, .rfagc_top = 0x37, },
269};
270
271static struct tda18271_config kworld_a340_config = {
272 .std_map = &kworld_a340_std_map,
273};
274
250static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = { 275static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
251 .demod_address = (0x1e >> 1), 276 .demod_address = (0x1e >> 1),
252 .no_tuner = 1, 277 .no_tuner = 1,
@@ -572,6 +597,14 @@ static int dvb_init(struct em28xx *dev)
572 } 597 }
573 } 598 }
574 break; 599 break;
600 case EM2870_BOARD_KWORLD_A340:
601 dvb->frontend = dvb_attach(lgdt3305_attach,
602 &em2870_lgdt3304_dev,
603 &dev->i2c_adap);
604 if (dvb->frontend != NULL)
605 dvb_attach(tda18271_attach, dvb->frontend, 0x60,
606 &dev->i2c_adap, &kworld_a340_config);
607 break;
575 default: 608 default:
576 em28xx_errdev("/2: The frontend of your DVB/ATSC card" 609 em28xx_errdev("/2: The frontend of your DVB/ATSC card"
577 " isn't supported yet\n"); 610 " isn't supported yet\n");
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 6216786565c..1c61a6b65d2 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -114,6 +114,7 @@
114#define EM2870_BOARD_REDDO_DVB_C_USB_BOX 73 114#define EM2870_BOARD_REDDO_DVB_C_USB_BOX 73
115#define EM2800_BOARD_VC211A 74 115#define EM2800_BOARD_VC211A 74
116#define EM2882_BOARD_DIKOM_DK300 75 116#define EM2882_BOARD_DIKOM_DK300 75
117#define EM2870_BOARD_KWORLD_A340 76
117 118
118/* Limits minimum and default number of buffers */ 119/* Limits minimum and default number of buffers */
119#define EM28XX_MIN_BUF 4 120#define EM28XX_MIN_BUF 4