diff options
author | Kevin Cheng <kcheng@gmail.com> | 2017-01-09 22:14:29 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 10:46:42 -0500 |
commit | 1586342e428d80e53f9a926b2e238d2175b9f5b5 (patch) | |
tree | 49944fd2683e492b04f75261ebd9ca1a6674c8d2 | |
parent | 4f75189024f4186a7ff9d56f4a8cb690774412ec (diff) |
[media] em28xx: support for Hauppauge WinTV-dualHD 01595 ATSC/QAM
Hauppauge WinTV-dualHD model 01595 is a USB 2.0 dual ATSC/QAM tuner with
the following components:
USB bridge: Empia em28274
Demodulator: 2x LG LGDT3306a at addresses 0xb2 and 0x1c
Tuner: 2x Silicon Labs si2157 at addresses 0xc0 and 0xc4
This patch enables only the first tuner.
Signed-off-by: Kevin Cheng <kcheng@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 19 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 74 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 1 |
3 files changed, 94 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 23c67494762d..5f90d0899a45 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
@@ -509,6 +509,7 @@ static struct em28xx_reg_seq plex_px_bcud[] = { | |||
509 | 509 | ||
510 | /* | 510 | /* |
511 | * 2040:0265 Hauppauge WinTV-dualHD DVB | 511 | * 2040:0265 Hauppauge WinTV-dualHD DVB |
512 | * 2040:026d Hauppauge WinTV-dualHD ATSC/QAM | ||
512 | * reg 0x80/0x84: | 513 | * reg 0x80/0x84: |
513 | * GPIO_0: Yellow LED tuner 1, 0=on, 1=off | 514 | * GPIO_0: Yellow LED tuner 1, 0=on, 1=off |
514 | * GPIO_1: Green LED tuner 1, 0=on, 1=off | 515 | * GPIO_1: Green LED tuner 1, 0=on, 1=off |
@@ -2389,6 +2390,21 @@ struct em28xx_board em28xx_boards[] = { | |||
2389 | .ir_codes = RC_MAP_HAUPPAUGE, | 2390 | .ir_codes = RC_MAP_HAUPPAUGE, |
2390 | .leds = hauppauge_dualhd_leds, | 2391 | .leds = hauppauge_dualhd_leds, |
2391 | }, | 2392 | }, |
2393 | /* | ||
2394 | * 2040:026d Hauppauge WinTV-dualHD (model 01595 - ATSC/QAM). | ||
2395 | * Empia EM28274, 2x LG LGDT3306A, 2x Silicon Labs Si2157 | ||
2396 | */ | ||
2397 | [EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595] = { | ||
2398 | .name = "Hauppauge WinTV-dualHD 01595 ATSC/QAM", | ||
2399 | .def_i2c_bus = 1, | ||
2400 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | | ||
2401 | EM28XX_I2C_FREQ_400_KHZ, | ||
2402 | .tuner_type = TUNER_ABSENT, | ||
2403 | .tuner_gpio = hauppauge_dualhd_dvb, | ||
2404 | .has_dvb = 1, | ||
2405 | .ir_codes = RC_MAP_HAUPPAUGE, | ||
2406 | .leds = hauppauge_dualhd_leds, | ||
2407 | }, | ||
2392 | }; | 2408 | }; |
2393 | EXPORT_SYMBOL_GPL(em28xx_boards); | 2409 | EXPORT_SYMBOL_GPL(em28xx_boards); |
2394 | 2410 | ||
@@ -2514,6 +2530,8 @@ struct usb_device_id em28xx_id_table[] = { | |||
2514 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 }, | 2530 | .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 }, |
2515 | { USB_DEVICE(0x2040, 0x0265), | 2531 | { USB_DEVICE(0x2040, 0x0265), |
2516 | .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB }, | 2532 | .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB }, |
2533 | { USB_DEVICE(0x2040, 0x026d), | ||
2534 | .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 }, | ||
2517 | { USB_DEVICE(0x0438, 0xb002), | 2535 | { USB_DEVICE(0x0438, 0xb002), |
2518 | .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, | 2536 | .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 }, |
2519 | { USB_DEVICE(0x2001, 0xf112), | 2537 | { USB_DEVICE(0x2001, 0xf112), |
@@ -2945,6 +2963,7 @@ static void em28xx_card_setup(struct em28xx *dev) | |||
2945 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: | 2963 | case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: |
2946 | case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: | 2964 | case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: |
2947 | case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB: | 2965 | case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB: |
2966 | case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595: | ||
2948 | { | 2967 | { |
2949 | struct tveeprom tv; | 2968 | struct tveeprom tv; |
2950 | 2969 | ||
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 75a75dab2e8e..82edd37f0d73 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
@@ -37,6 +37,7 @@ | |||
37 | 37 | ||
38 | #include "lgdt330x.h" | 38 | #include "lgdt330x.h" |
39 | #include "lgdt3305.h" | 39 | #include "lgdt3305.h" |
40 | #include "lgdt3306a.h" | ||
40 | #include "zl10353.h" | 41 | #include "zl10353.h" |
41 | #include "s5h1409.h" | 42 | #include "s5h1409.h" |
42 | #include "mt2060.h" | 43 | #include "mt2060.h" |
@@ -920,6 +921,17 @@ static struct tda18271_config pinnacle_80e_dvb_config = { | |||
920 | .role = TDA18271_MASTER, | 921 | .role = TDA18271_MASTER, |
921 | }; | 922 | }; |
922 | 923 | ||
924 | static struct lgdt3306a_config hauppauge_01595_lgdt3306a_config = { | ||
925 | .qam_if_khz = 4000, | ||
926 | .vsb_if_khz = 3250, | ||
927 | .spectral_inversion = 0, | ||
928 | .deny_i2c_rptr = 0, | ||
929 | .mpeg_mode = LGDT3306A_MPEG_SERIAL, | ||
930 | .tpclk_edge = LGDT3306A_TPCLK_RISING_EDGE, | ||
931 | .tpvalid_polarity = LGDT3306A_TP_VALID_HIGH, | ||
932 | .xtalMHz = 25, | ||
933 | }; | ||
934 | |||
923 | /* ------------------------------------------------------------------ */ | 935 | /* ------------------------------------------------------------------ */ |
924 | 936 | ||
925 | static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) | 937 | static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) |
@@ -1950,6 +1962,68 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1950 | 1962 | ||
1951 | } | 1963 | } |
1952 | break; | 1964 | break; |
1965 | case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595: | ||
1966 | { | ||
1967 | struct i2c_adapter *adapter; | ||
1968 | struct i2c_client *client; | ||
1969 | struct i2c_board_info info = {}; | ||
1970 | struct lgdt3306a_config lgdt3306a_config; | ||
1971 | struct si2157_config si2157_config = {}; | ||
1972 | |||
1973 | /* attach demod */ | ||
1974 | lgdt3306a_config = hauppauge_01595_lgdt3306a_config; | ||
1975 | lgdt3306a_config.fe = &dvb->fe[0]; | ||
1976 | lgdt3306a_config.i2c_adapter = &adapter; | ||
1977 | strlcpy(info.type, "lgdt3306a", sizeof(info.type)); | ||
1978 | info.addr = 0x59; | ||
1979 | info.platform_data = &lgdt3306a_config; | ||
1980 | request_module(info.type); | ||
1981 | client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], | ||
1982 | &info); | ||
1983 | if (client == NULL || client->dev.driver == NULL) { | ||
1984 | result = -ENODEV; | ||
1985 | goto out_free; | ||
1986 | } | ||
1987 | |||
1988 | if (!try_module_get(client->dev.driver->owner)) { | ||
1989 | i2c_unregister_device(client); | ||
1990 | result = -ENODEV; | ||
1991 | goto out_free; | ||
1992 | } | ||
1993 | |||
1994 | dvb->i2c_client_demod = client; | ||
1995 | |||
1996 | /* attach tuner */ | ||
1997 | si2157_config.fe = dvb->fe[0]; | ||
1998 | si2157_config.if_port = 1; | ||
1999 | si2157_config.inversion = 1; | ||
2000 | #ifdef CONFIG_MEDIA_CONTROLLER_DVB | ||
2001 | si2157_config.mdev = dev->media_dev; | ||
2002 | #endif | ||
2003 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
2004 | strlcpy(info.type, "si2157", sizeof(info.type)); | ||
2005 | info.addr = 0x60; | ||
2006 | info.platform_data = &si2157_config; | ||
2007 | request_module(info.type); | ||
2008 | |||
2009 | client = i2c_new_device(adapter, &info); | ||
2010 | if (client == NULL || client->dev.driver == NULL) { | ||
2011 | module_put(dvb->i2c_client_demod->dev.driver->owner); | ||
2012 | i2c_unregister_device(dvb->i2c_client_demod); | ||
2013 | result = -ENODEV; | ||
2014 | goto out_free; | ||
2015 | } | ||
2016 | if (!try_module_get(client->dev.driver->owner)) { | ||
2017 | i2c_unregister_device(client); | ||
2018 | module_put(dvb->i2c_client_demod->dev.driver->owner); | ||
2019 | i2c_unregister_device(dvb->i2c_client_demod); | ||
2020 | result = -ENODEV; | ||
2021 | goto out_free; | ||
2022 | } | ||
2023 | |||
2024 | dvb->i2c_client_tuner = client; | ||
2025 | } | ||
2026 | break; | ||
1953 | default: | 2027 | default: |
1954 | dev_err(&dev->intf->dev, | 2028 | dev_err(&dev->intf->dev, |
1955 | "The frontend of your DVB/ATSC card isn't supported yet\n"); | 2029 | "The frontend of your DVB/ATSC card isn't supported yet\n"); |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index ca59e2d4fccf..e9f379959fa5 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -147,6 +147,7 @@ | |||
147 | #define EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 97 | 147 | #define EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 97 |
148 | #define EM28178_BOARD_PLEX_PX_BCUD 98 | 148 | #define EM28178_BOARD_PLEX_PX_BCUD 98 |
149 | #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB 99 | 149 | #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB 99 |
150 | #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 100 | ||
150 | 151 | ||
151 | /* Limits minimum and default number of buffers */ | 152 | /* Limits minimum and default number of buffers */ |
152 | #define EM28XX_MIN_BUF 4 | 153 | #define EM28XX_MIN_BUF 4 |