diff options
author | Antti Palosaari <crope@iki.fi> | 2012-03-19 10:48:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 21:38:53 -0400 |
commit | c247d7b107c6654bb73d539485df649db5c0796f (patch) | |
tree | d4bf99cd9bdc37780d077187fe5146a9a62265b2 /drivers/media | |
parent | 02bbb814d8db7b632458fcf8651267798eeef985 (diff) |
[media] em28xx: support for 2013:0251 PCTV QuatroStick nano (520e)
Hardware is based of:
Empia EM2884
Micronas DRX 3926K
NXP TDA18271HDC2
... + analog parts.
Analog is not supported currently. Only DVB-T and DVB-C.
There seems to be still problems for locking DVB-C channels which have
strong signal. Attenuator helps. I think it is demodulator IF/RF AGC
issue. Lets fix it later. Patches are welcome.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 28 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 52 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 1 |
3 files changed, 81 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 70dfd3a7242d..08d4ac659e3d 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -364,6 +364,20 @@ static struct em28xx_reg_seq maxmedia_ub425_tc[] = { | |||
364 | {-1, -1, -1, -1}, | 364 | {-1, -1, -1, -1}, |
365 | }; | 365 | }; |
366 | 366 | ||
367 | /* 2013:0251 PCTV QuatroStick nano (520e) | ||
368 | * GPIO_2: decoder reset, 0=active | ||
369 | * GPIO_4: decoder suspend, 0=active | ||
370 | * GPIO_6: demod reset, 0=active | ||
371 | * GPIO_7: LED, 1=active | ||
372 | */ | ||
373 | static struct em28xx_reg_seq pctv_520e[] = { | ||
374 | {EM2874_R80_GPIO, 0x10, 0xff, 100}, | ||
375 | {EM2874_R80_GPIO, 0x14, 0xff, 100}, /* GPIO_2 = 1 */ | ||
376 | {EM2874_R80_GPIO, 0x54, 0xff, 050}, /* GPIO_6 = 1 */ | ||
377 | {EM2874_R80_GPIO, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */ | ||
378 | { -1, -1, -1, -1}, | ||
379 | }; | ||
380 | |||
367 | /* | 381 | /* |
368 | * Board definitions | 382 | * Board definitions |
369 | */ | 383 | */ |
@@ -1930,6 +1944,18 @@ struct em28xx_board em28xx_boards[] = { | |||
1930 | EM28XX_I2C_CLK_WAIT_ENABLE | | 1944 | EM28XX_I2C_CLK_WAIT_ENABLE | |
1931 | EM28XX_I2C_FREQ_400_KHZ, | 1945 | EM28XX_I2C_FREQ_400_KHZ, |
1932 | }, | 1946 | }, |
1947 | /* 2013:0251 PCTV QuatroStick nano (520e) | ||
1948 | * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ | ||
1949 | [EM2884_BOARD_PCTV_520E] = { | ||
1950 | .name = "PCTV QuatroStick nano (520e)", | ||
1951 | .tuner_type = TUNER_ABSENT, | ||
1952 | .tuner_gpio = pctv_520e, | ||
1953 | .has_dvb = 1, | ||
1954 | .ir_codes = RC_MAP_PINNACLE_PCTV_HD, | ||
1955 | .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT | | ||
1956 | EM28XX_I2C_CLK_WAIT_ENABLE | | ||
1957 | EM28XX_I2C_FREQ_400_KHZ, | ||
1958 | }, | ||
1933 | }; | 1959 | }; |
1934 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); | 1960 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
1935 | 1961 | ||
@@ -2083,6 +2109,8 @@ struct usb_device_id em28xx_id_table[] = { | |||
2083 | .driver_info = EM2860_BOARD_EASYCAP }, | 2109 | .driver_info = EM2860_BOARD_EASYCAP }, |
2084 | { USB_DEVICE(0x1b80, 0xe425), | 2110 | { USB_DEVICE(0x1b80, 0xe425), |
2085 | .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC }, | 2111 | .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC }, |
2112 | { USB_DEVICE(0x2013, 0x0251), | ||
2113 | .driver_info = EM2884_BOARD_PCTV_520E }, | ||
2086 | { }, | 2114 | { }, |
2087 | }; | 2115 | }; |
2088 | MODULE_DEVICE_TABLE(usb, em28xx_id_table); | 2116 | MODULE_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 0b3e301adde9..398d71377930 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -331,6 +331,13 @@ struct drxk_config maxmedia_ub425_tc_drxk = { | |||
331 | .no_i2c_bridge = 1, | 331 | .no_i2c_bridge = 1, |
332 | }; | 332 | }; |
333 | 333 | ||
334 | struct drxk_config pctv_520e_drxk = { | ||
335 | .adr = 0x29, | ||
336 | .single_master = 1, | ||
337 | .microcode_name = "dvb-demod-drxk-pctv.fw", | ||
338 | .chunk_size = 58, | ||
339 | }; | ||
340 | |||
334 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) | 341 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) |
335 | { | 342 | { |
336 | struct em28xx_dvb *dvb = fe->sec_priv; | 343 | struct em28xx_dvb *dvb = fe->sec_priv; |
@@ -464,6 +471,33 @@ static void terratec_h5_init(struct em28xx *dev) | |||
464 | em28xx_gpio_set(dev, terratec_h5_end); | 471 | em28xx_gpio_set(dev, terratec_h5_end); |
465 | }; | 472 | }; |
466 | 473 | ||
474 | static void pctv_520e_init(struct em28xx *dev) | ||
475 | { | ||
476 | /* | ||
477 | * Init TDA8295(?) analog demodulator. Looks like I2C traffic to | ||
478 | * digital demodulator and tuner are routed via TDA8295. | ||
479 | */ | ||
480 | int i; | ||
481 | struct { | ||
482 | unsigned char r[4]; | ||
483 | int len; | ||
484 | } regs[] = { | ||
485 | {{ 0x06, 0x02, 0x00, 0x31 }, 4}, | ||
486 | {{ 0x01, 0x02 }, 2}, | ||
487 | {{ 0x01, 0x02, 0x00, 0xc6 }, 4}, | ||
488 | {{ 0x01, 0x00 }, 2}, | ||
489 | {{ 0x01, 0x00, 0xff, 0xaf }, 4}, | ||
490 | {{ 0x01, 0x00, 0x03, 0xa0 }, 4}, | ||
491 | {{ 0x01, 0x00 }, 2}, | ||
492 | {{ 0x01, 0x00, 0x73, 0xaf }, 4}, | ||
493 | }; | ||
494 | |||
495 | dev->i2c_client.addr = 0x82 >> 1; /* 0x41 */ | ||
496 | |||
497 | for (i = 0; i < ARRAY_SIZE(regs); i++) | ||
498 | i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); | ||
499 | }; | ||
500 | |||
467 | static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) | 501 | static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) |
468 | { | 502 | { |
469 | /* Values extracted from a USB trace of the Terratec Windows driver */ | 503 | /* Values extracted from a USB trace of the Terratec Windows driver */ |
@@ -965,6 +999,24 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
965 | "driver version\n"); | 999 | "driver version\n"); |
966 | 1000 | ||
967 | break; | 1001 | break; |
1002 | case EM2884_BOARD_PCTV_520E: | ||
1003 | pctv_520e_init(dev); | ||
1004 | |||
1005 | /* attach demodulator */ | ||
1006 | dvb->fe[0] = dvb_attach(drxk_attach, &pctv_520e_drxk, | ||
1007 | &dev->i2c_adap); | ||
1008 | |||
1009 | if (dvb->fe[0]) { | ||
1010 | /* attach tuner */ | ||
1011 | if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, | ||
1012 | &dev->i2c_adap, | ||
1013 | &em28xx_cxd2820r_tda18271_config)) { | ||
1014 | dvb_frontend_detach(dvb->fe[0]); | ||
1015 | result = -EINVAL; | ||
1016 | goto out_free; | ||
1017 | } | ||
1018 | } | ||
1019 | break; | ||
968 | default: | 1020 | default: |
969 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" | 1021 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" |
970 | " isn't supported yet\n"); | 1022 | " isn't supported yet\n"); |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index ca90a4dcc93f..4669ea108c4e 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -126,6 +126,7 @@ | |||
126 | #define EM2884_BOARD_CINERGY_HTC_STICK 82 | 126 | #define EM2884_BOARD_CINERGY_HTC_STICK 82 |
127 | #define EM2860_BOARD_HT_VIDBOX_NW03 83 | 127 | #define EM2860_BOARD_HT_VIDBOX_NW03 83 |
128 | #define EM2874_BOARD_MAXMEDIA_UB425_TC 84 | 128 | #define EM2874_BOARD_MAXMEDIA_UB425_TC 84 |
129 | #define EM2884_BOARD_PCTV_520E 85 | ||
129 | 130 | ||
130 | /* Limits minimum and default number of buffers */ | 131 | /* Limits minimum and default number of buffers */ |
131 | #define EM28XX_MIN_BUF 4 | 132 | #define EM28XX_MIN_BUF 4 |