aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2015-02-28 10:25:24 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-03 08:36:12 -0500
commit809abdbf46377abe39a72884d026979bb1dbd6d3 (patch)
tree3da95d6527c64f0a282827b65b292691a482e2cf
parentc28aebe178a403f0e8632a283bc4d683b0c93e83 (diff)
[media] cx231xx: Hauppauge HVR-955Q ATSC/QAM tuner
Hauppauge HVR-955Q is a ATSC/QAM USB tuner with LGDT3306A demodulator and SiLabs Si2157-A30 tuner. Only digital TV has been tested (both ATSC and QAM256). Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/cx231xx/Kconfig1
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-cards.c42
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-dvb.c67
-rw-r--r--drivers/media/usb/cx231xx/cx231xx.h1
4 files changed, 111 insertions, 0 deletions
diff --git a/drivers/media/usb/cx231xx/Kconfig b/drivers/media/usb/cx231xx/Kconfig
index 173c0e287a08..0cced3e5b040 100644
--- a/drivers/media/usb/cx231xx/Kconfig
+++ b/drivers/media/usb/cx231xx/Kconfig
@@ -47,6 +47,7 @@ config VIDEO_CX231XX_DVB
47 select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT 47 select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
48 select DVB_MB86A20S if MEDIA_SUBDRV_AUTOSELECT 48 select DVB_MB86A20S if MEDIA_SUBDRV_AUTOSELECT
49 select DVB_LGDT3305 if MEDIA_SUBDRV_AUTOSELECT 49 select DVB_LGDT3305 if MEDIA_SUBDRV_AUTOSELECT
50 select DVB_LGDT3306A if MEDIA_SUBDRV_AUTOSELECT
50 select DVB_TDA18271C2DD if MEDIA_SUBDRV_AUTOSELECT 51 select DVB_TDA18271C2DD if MEDIA_SUBDRV_AUTOSELECT
51 select DVB_SI2165 if MEDIA_SUBDRV_AUTOSELECT 52 select DVB_SI2165 if MEDIA_SUBDRV_AUTOSELECT
52 select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT 53 select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 372b70eb042c..85220b97e8b2 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -776,6 +776,45 @@ struct cx231xx_board cx231xx_boards[] = {
776 .gpio = NULL, 776 .gpio = NULL,
777 } }, 777 } },
778 }, 778 },
779 [CX231XX_BOARD_HAUPPAUGE_955Q] = {
780 .name = "Hauppauge WinTV-HVR-955Q (111401)",
781 .tuner_type = TUNER_ABSENT,
782 .tuner_addr = 0x60,
783 .tuner_gpio = RDE250_XCV_TUNER,
784 .tuner_sif_gpio = 0x05,
785 .tuner_scl_gpio = 0x1a,
786 .tuner_sda_gpio = 0x1b,
787 .decoder = CX231XX_AVDECODER,
788 .output_mode = OUT_MODE_VIP11,
789 .demod_xfer_mode = 0,
790 .ctl_pin_status_mask = 0xFFFFFFC4,
791 .agc_analog_digital_select_gpio = 0x0c,
792 .gpio_pin_status_mask = 0x4001000,
793 .tuner_i2c_master = I2C_1_MUX_3,
794 .demod_i2c_master = I2C_2,
795 .has_dvb = 1,
796 .demod_addr = 0x0e,
797 .norm = V4L2_STD_NTSC,
798
799 .input = {{
800 .type = CX231XX_VMUX_TELEVISION,
801 .vmux = CX231XX_VIN_3_1,
802 .amux = CX231XX_AMUX_VIDEO,
803 .gpio = NULL,
804 }, {
805 .type = CX231XX_VMUX_COMPOSITE1,
806 .vmux = CX231XX_VIN_2_1,
807 .amux = CX231XX_AMUX_LINE_IN,
808 .gpio = NULL,
809 }, {
810 .type = CX231XX_VMUX_SVIDEO,
811 .vmux = CX231XX_VIN_1_1 |
812 (CX231XX_VIN_1_2 << 8) |
813 CX25840_SVIDEO_ON,
814 .amux = CX231XX_AMUX_LINE_IN,
815 .gpio = NULL,
816 } },
817 },
779}; 818};
780const unsigned int cx231xx_bcount = ARRAY_SIZE(cx231xx_boards); 819const unsigned int cx231xx_bcount = ARRAY_SIZE(cx231xx_boards);
781 820
@@ -805,6 +844,8 @@ struct usb_device_id cx231xx_id_table[] = {
805 .driver_info = CX231XX_BOARD_HAUPPAUGE_USB2_FM_NTSC}, 844 .driver_info = CX231XX_BOARD_HAUPPAUGE_USB2_FM_NTSC},
806 {USB_DEVICE(0x2040, 0xb120), 845 {USB_DEVICE(0x2040, 0xb120),
807 .driver_info = CX231XX_BOARD_HAUPPAUGE_EXETER}, 846 .driver_info = CX231XX_BOARD_HAUPPAUGE_EXETER},
847 {USB_DEVICE(0x2040, 0xb123),
848 .driver_info = CX231XX_BOARD_HAUPPAUGE_955Q},
808 {USB_DEVICE(0x2040, 0xb130), 849 {USB_DEVICE(0x2040, 0xb130),
809 .driver_info = CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx}, 850 .driver_info = CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx},
810 {USB_DEVICE(0x2040, 0xb131), 851 {USB_DEVICE(0x2040, 0xb131),
@@ -1049,6 +1090,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
1049 switch (dev->model) { 1090 switch (dev->model) {
1050 case CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx: 1091 case CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx:
1051 case CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx: 1092 case CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx:
1093 case CX231XX_BOARD_HAUPPAUGE_955Q:
1052 { 1094 {
1053 struct tveeprom tvee; 1095 struct tveeprom tvee;
1054 static u8 eeprom[256]; 1096 static u8 eeprom[256];
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index ff39bf22442d..610d5675bde6 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -34,6 +34,7 @@
34#include "si2165.h" 34#include "si2165.h"
35#include "mb86a20s.h" 35#include "mb86a20s.h"
36#include "si2157.h" 36#include "si2157.h"
37#include "lgdt3306a.h"
37 38
38MODULE_DESCRIPTION("driver for cx231xx based DVB cards"); 39MODULE_DESCRIPTION("driver for cx231xx based DVB cards");
39MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>"); 40MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>");
@@ -160,6 +161,18 @@ static const struct si2165_config pctv_quatro_stick_1114xx_si2165_config = {
160 .ref_freq_Hz = 24000000, 161 .ref_freq_Hz = 24000000,
161}; 162};
162 163
164static struct lgdt3306a_config hauppauge_955q_lgdt3306a_config = {
165 .i2c_addr = 0x59,
166 .qam_if_khz = 4000,
167 .vsb_if_khz = 3250,
168 .deny_i2c_rptr = 1,
169 .spectral_inversion = 1,
170 .mpeg_mode = LGDT3306A_MPEG_SERIAL,
171 .tpclk_edge = LGDT3306A_TPCLK_RISING_EDGE,
172 .tpvalid_polarity = LGDT3306A_TP_VALID_HIGH,
173 .xtalMHz = 25,
174};
175
163static inline void print_err_status(struct cx231xx *dev, int packet, int status) 176static inline void print_err_status(struct cx231xx *dev, int packet, int status)
164{ 177{
165 char *errmsg = "Unknown"; 178 char *errmsg = "Unknown";
@@ -811,7 +824,61 @@ static int dvb_init(struct cx231xx *dev)
811 dev->dvb->i2c_client_tuner = client; 824 dev->dvb->i2c_client_tuner = client;
812 break; 825 break;
813 } 826 }
827 case CX231XX_BOARD_HAUPPAUGE_955Q:
828 {
829 struct i2c_client *client;
830 struct i2c_board_info info;
831 struct si2157_config si2157_config;
832
833 memset(&info, 0, sizeof(struct i2c_board_info));
834
835 dev->dvb->frontend = dvb_attach(lgdt3306a_attach,
836 &hauppauge_955q_lgdt3306a_config,
837 tuner_i2c
838 );
839
840 if (dev->dvb->frontend == NULL) {
841 dev_err(dev->dev,
842 "Failed to attach LGDT3306A frontend.\n");
843 result = -EINVAL;
844 goto out_free;
845 }
846
847 dev->dvb->frontend->ops.i2c_gate_ctrl = NULL;
848
849 /* define general-purpose callback pointer */
850 dvb->frontend->callback = cx231xx_tuner_callback;
851
852 /* attach tuner */
853 memset(&si2157_config, 0, sizeof(si2157_config));
854 si2157_config.fe = dev->dvb->frontend;
855 si2157_config.inversion = true;
856 strlcpy(info.type, "si2157", I2C_NAME_SIZE);
857 info.addr = 0x60;
858 info.platform_data = &si2157_config;
859 request_module("si2157");
860
861 client = i2c_new_device(
862 tuner_i2c,
863 &info);
864 if (client == NULL || client->dev.driver == NULL) {
865 dvb_frontend_detach(dev->dvb->frontend);
866 result = -ENODEV;
867 goto out_free;
868 }
869
870 if (!try_module_get(client->dev.driver->owner)) {
871 i2c_unregister_device(client);
872 dvb_frontend_detach(dev->dvb->frontend);
873 result = -ENODEV;
874 goto out_free;
875 }
876
877 dev->cx231xx_reset_analog_tuner = NULL;
814 878
879 dev->dvb->i2c_client_tuner = client;
880 break;
881 }
815 case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID: 882 case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID:
816 case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID: 883 case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID:
817 884
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index e0d3106f6b44..573b3c036a65 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -76,6 +76,7 @@
76#define CX231XX_BOARD_KWORLD_UB445_USB_HYBRID 18 76#define CX231XX_BOARD_KWORLD_UB445_USB_HYBRID 18
77#define CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx 19 77#define CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx 19
78#define CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx 20 78#define CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx 20
79#define CX231XX_BOARD_HAUPPAUGE_955Q 21
79 80
80/* Limits minimum and default number of buffers */ 81/* Limits minimum and default number of buffers */
81#define CX231XX_MIN_BUF 4 82#define CX231XX_MIN_BUF 4