diff options
author | Ivan Kalvachev <ikalvachev@gmail.com> | 2012-03-19 19:09:55 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 21:44:46 -0400 |
commit | fa5527cd3f428845d7950e6b2bab6babcbcd907b (patch) | |
tree | ca327113cfafa2f79c3492ca12a3aadbf9b85690 /drivers/media | |
parent | c247d7b107c6654bb73d539485df649db5c0796f (diff) |
[media] em28xx: support for 2304:0242 PCTV QuatroStick (510e)
It is mostly copy/paste of the 520e code with setting GPIO7 removed
(no LED light).
I've worked on just released vanilla linux-3.3.0 kernel, so there may
be 1/2 lines offset to the internal working source, but most of the
code should apply cleanly.
I was able to get the DVB-C working (tuned and watched TV). Haven't
tested DVB-T (no signal atm).
Special thanks to everybody who worked on the code and to Antti
Palosaari and Devin Heitmueller who provided essential support on irc.
Hardware is based of:
Empia EM2884
Micronas DRX 3926K
NXP TDA18271HDC2
AVF4910 (not used atm)
Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 27 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-dvb.c | 53 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 3 |
3 files changed, 82 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 08d4ac659e3d..9fd8cc7dbb23 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -364,6 +364,19 @@ static struct em28xx_reg_seq maxmedia_ub425_tc[] = { | |||
364 | {-1, -1, -1, -1}, | 364 | {-1, -1, -1, -1}, |
365 | }; | 365 | }; |
366 | 366 | ||
367 | /* 2304:0242 PCTV QuatroStick (510e) | ||
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_510e[] = { | ||
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 | { -1, -1, -1, -1}, | ||
378 | }; | ||
379 | |||
367 | /* 2013:0251 PCTV QuatroStick nano (520e) | 380 | /* 2013:0251 PCTV QuatroStick nano (520e) |
368 | * GPIO_2: decoder reset, 0=active | 381 | * GPIO_2: decoder reset, 0=active |
369 | * GPIO_4: decoder suspend, 0=active | 382 | * GPIO_4: decoder suspend, 0=active |
@@ -1944,6 +1957,18 @@ struct em28xx_board em28xx_boards[] = { | |||
1944 | EM28XX_I2C_CLK_WAIT_ENABLE | | 1957 | EM28XX_I2C_CLK_WAIT_ENABLE | |
1945 | EM28XX_I2C_FREQ_400_KHZ, | 1958 | EM28XX_I2C_FREQ_400_KHZ, |
1946 | }, | 1959 | }, |
1960 | /* 2304:0242 PCTV QuatroStick (510e) | ||
1961 | * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ | ||
1962 | [EM2884_BOARD_PCTV_510E] = { | ||
1963 | .name = "PCTV QuatroStick (510e)", | ||
1964 | .tuner_type = TUNER_ABSENT, | ||
1965 | .tuner_gpio = pctv_510e, | ||
1966 | .has_dvb = 1, | ||
1967 | .ir_codes = RC_MAP_PINNACLE_PCTV_HD, | ||
1968 | .i2c_speed = EM2874_I2C_SECONDARY_BUS_SELECT | | ||
1969 | EM28XX_I2C_CLK_WAIT_ENABLE | | ||
1970 | EM28XX_I2C_FREQ_400_KHZ, | ||
1971 | }, | ||
1947 | /* 2013:0251 PCTV QuatroStick nano (520e) | 1972 | /* 2013:0251 PCTV QuatroStick nano (520e) |
1948 | * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ | 1973 | * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */ |
1949 | [EM2884_BOARD_PCTV_520E] = { | 1974 | [EM2884_BOARD_PCTV_520E] = { |
@@ -2109,6 +2134,8 @@ struct usb_device_id em28xx_id_table[] = { | |||
2109 | .driver_info = EM2860_BOARD_EASYCAP }, | 2134 | .driver_info = EM2860_BOARD_EASYCAP }, |
2110 | { USB_DEVICE(0x1b80, 0xe425), | 2135 | { USB_DEVICE(0x1b80, 0xe425), |
2111 | .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC }, | 2136 | .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC }, |
2137 | { USB_DEVICE(0x2304, 0x0242), | ||
2138 | .driver_info = EM2884_BOARD_PCTV_510E }, | ||
2112 | { USB_DEVICE(0x2013, 0x0251), | 2139 | { USB_DEVICE(0x2013, 0x0251), |
2113 | .driver_info = EM2884_BOARD_PCTV_520E }, | 2140 | .driver_info = EM2884_BOARD_PCTV_520E }, |
2114 | { }, | 2141 | { }, |
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 398d71377930..d8dd971ad644 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -338,6 +338,13 @@ struct drxk_config pctv_520e_drxk = { | |||
338 | .chunk_size = 58, | 338 | .chunk_size = 58, |
339 | }; | 339 | }; |
340 | 340 | ||
341 | struct drxk_config pctv_520e_drxk = { | ||
342 | .adr = 0x29, | ||
343 | .single_master = 1, | ||
344 | .microcode_name = "dvb-demod-drxk-pctv.fw", | ||
345 | .chunk_size = 58, | ||
346 | }; | ||
347 | |||
341 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) | 348 | static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) |
342 | { | 349 | { |
343 | struct em28xx_dvb *dvb = fe->sec_priv; | 350 | struct em28xx_dvb *dvb = fe->sec_priv; |
@@ -498,6 +505,33 @@ static void pctv_520e_init(struct em28xx *dev) | |||
498 | i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); | 505 | i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); |
499 | }; | 506 | }; |
500 | 507 | ||
508 | static void pctv_520e_init(struct em28xx *dev) | ||
509 | { | ||
510 | /* | ||
511 | * Init TDA8295(?) analog demodulator. Looks like I2C traffic to | ||
512 | * digital demodulator and tuner are routed via TDA8295. | ||
513 | */ | ||
514 | int i; | ||
515 | struct { | ||
516 | unsigned char r[4]; | ||
517 | int len; | ||
518 | } regs[] = { | ||
519 | {{ 0x06, 0x02, 0x00, 0x31 }, 4}, | ||
520 | {{ 0x01, 0x02 }, 2}, | ||
521 | {{ 0x01, 0x02, 0x00, 0xc6 }, 4}, | ||
522 | {{ 0x01, 0x00 }, 2}, | ||
523 | {{ 0x01, 0x00, 0xff, 0xaf }, 4}, | ||
524 | {{ 0x01, 0x00, 0x03, 0xa0 }, 4}, | ||
525 | {{ 0x01, 0x00 }, 2}, | ||
526 | {{ 0x01, 0x00, 0x73, 0xaf }, 4}, | ||
527 | }; | ||
528 | |||
529 | dev->i2c_client.addr = 0x82 >> 1; /* 0x41 */ | ||
530 | |||
531 | for (i = 0; i < ARRAY_SIZE(regs); i++) | ||
532 | i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len); | ||
533 | }; | ||
534 | |||
501 | static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) | 535 | static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe) |
502 | { | 536 | { |
503 | /* Values extracted from a USB trace of the Terratec Windows driver */ | 537 | /* Values extracted from a USB trace of the Terratec Windows driver */ |
@@ -1017,6 +1051,25 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1017 | } | 1051 | } |
1018 | } | 1052 | } |
1019 | break; | 1053 | break; |
1054 | case EM2884_BOARD_PCTV_510E: | ||
1055 | case EM2884_BOARD_PCTV_520E: | ||
1056 | pctv_520e_init(dev); | ||
1057 | |||
1058 | /* attach demodulator */ | ||
1059 | dvb->fe[0] = dvb_attach(drxk_attach, &pctv_520e_drxk, | ||
1060 | &dev->i2c_adap); | ||
1061 | |||
1062 | if (dvb->fe[0]) { | ||
1063 | /* attach tuner */ | ||
1064 | if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, | ||
1065 | &dev->i2c_adap, | ||
1066 | &em28xx_cxd2820r_tda18271_config)) { | ||
1067 | dvb_frontend_detach(dvb->fe[0]); | ||
1068 | result = -EINVAL; | ||
1069 | goto out_free; | ||
1070 | } | ||
1071 | } | ||
1072 | break; | ||
1020 | default: | 1073 | default: |
1021 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" | 1074 | em28xx_errdev("/2: The frontend of your DVB/ATSC card" |
1022 | " isn't supported yet\n"); | 1075 | " isn't supported yet\n"); |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 4669ea108c4e..2868b19f8b54 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -126,7 +126,8 @@ | |||
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 | #define EM2884_BOARD_PCTV_510E 85 |
130 | #define EM2884_BOARD_PCTV_520E 86 | ||
130 | 131 | ||
131 | /* Limits minimum and default number of buffers */ | 132 | /* Limits minimum and default number of buffers */ |
132 | #define EM28XX_MIN_BUF 4 | 133 | #define EM28XX_MIN_BUF 4 |