aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2007-11-19 23:53:31 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:02:36 -0500
commit5ccaf905015c83a9b28e8496b4504b9b8dc25a80 (patch)
tree75fe1936542f6df7bb4f33ddcdd4f0844b656f68 /drivers/media
parent1ad0b796a3fa3d1c1a7d16be7c70b626da2940a9 (diff)
V4L/DVB (6653): Add support for the DViCO FusionHDTV NANO2 w/ZL10353 and firmware
Add support for the DViCO FusionHDTV DVB-T NANO with zl10353 demodulator and firmware in ROM on the device. Again, this is based on the great work of Mike Krufky with my modifications to use the in-tree XC2028 driver. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c88
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h1
2 files changed, 88 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index ec8516ac8105..f6fa2c22b0bf 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -98,6 +98,11 @@ static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
98 cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0); 98 cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0);
99} 99}
100 100
101static void cxusb_nano2_led(struct dvb_usb_device *d, int onoff)
102{
103 cxusb_bluebird_gpio_rw(d, 0x40, onoff ? 0 : 0x40);
104}
105
101/* I2C */ 106/* I2C */
102static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], 107static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
103 int num) 108 int num)
@@ -200,6 +205,17 @@ static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
200 return 0; 205 return 0;
201} 206}
202 207
208static int cxusb_nano2_power_ctrl(struct dvb_usb_device *d, int onoff)
209{
210 int rc = 0;
211
212 rc = cxusb_power_ctrl(d, onoff);
213 if (!onoff)
214 cxusb_nano2_led(d, 0);
215
216 return rc;
217}
218
203static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) 219static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
204{ 220{
205 u8 buf[2] = { 0x03, 0x00 }; 221 u8 buf[2] = { 0x03, 0x00 };
@@ -606,6 +622,26 @@ no_IR:
606 return 0; 622 return 0;
607} 623}
608 624
625static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap)
626{
627 if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
628 err("set interface failed");
629
630 cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
631
632 /* reset the tuner and demodulator */
633 cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0);
634 cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
635 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
636
637 if ((adap->fe = dvb_attach(zl10353_attach,
638 &cxusb_zl10353_xc3028_config,
639 &adap->dev->i2c_adap)) != NULL)
640 return 0;
641
642 return -EIO;
643}
644
609/* 645/*
610 * DViCO bluebird firmware needs the "warm" product ID to be patched into the 646 * DViCO bluebird firmware needs the "warm" product ID to be patched into the
611 * firmware file before download. 647 * firmware file before download.
@@ -639,6 +675,7 @@ static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties;
639static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties; 675static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties;
640static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties; 676static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties;
641static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties; 677static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties;
678static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties;
642 679
643static int cxusb_probe(struct usb_interface *intf, 680static int cxusb_probe(struct usb_interface *intf,
644 const struct usb_device_id *id) 681 const struct usb_device_id *id)
@@ -648,7 +685,8 @@ static int cxusb_probe(struct usb_interface *intf,
648 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 || 685 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
649 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 || 686 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
650 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 || 687 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
651 dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0) { 688 dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 ||
689 dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0) {
652 return 0; 690 return 0;
653 } 691 }
654 692
@@ -670,6 +708,7 @@ static struct usb_device_id cxusb_table [] = {
670 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) }, 708 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) },
671 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) }, 709 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) },
672 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) }, 710 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) },
711 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2) },
673 {} /* Terminating entry */ 712 {} /* Terminating entry */
674}; 713};
675MODULE_DEVICE_TABLE (usb, cxusb_table); 714MODULE_DEVICE_TABLE (usb, cxusb_table);
@@ -975,6 +1014,53 @@ static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = {
975 } 1014 }
976}; 1015};
977 1016
1017static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties = {
1018 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1019
1020 .usb_ctrl = CYPRESS_FX2,
1021
1022 .size_of_priv = sizeof(struct cxusb_state),
1023
1024 .num_adapters = 1,
1025 .adapter = {
1026 {
1027 .streaming_ctrl = cxusb_streaming_ctrl,
1028 .frontend_attach = cxusb_nano2_frontend_attach,
1029 .tuner_attach = cxusb_dvico_xc3028_tuner_attach,
1030 /* parameter for the MPEG2-data transfer */
1031 .stream = {
1032 .type = USB_BULK,
1033 .count = 5,
1034 .endpoint = 0x02,
1035 .u = {
1036 .bulk = {
1037 .buffersize = 8192,
1038 }
1039 }
1040 },
1041 },
1042 },
1043
1044 .power_ctrl = cxusb_nano2_power_ctrl,
1045
1046 .i2c_algo = &cxusb_i2c_algo,
1047
1048 .generic_bulk_ctrl_endpoint = 0x01,
1049
1050 .rc_interval = 100,
1051 .rc_key_map = dvico_portable_rc_keys,
1052 .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
1053 .rc_query = cxusb_bluebird2_rc_query,
1054
1055 .num_device_descs = 1,
1056 .devices = {
1057 { "DViCO FusionHDTV DVB-T NANO2",
1058 { NULL },
1059 { &cxusb_table[14], NULL },
1060 },
1061 }
1062};
1063
978static struct usb_driver cxusb_driver = { 1064static struct usb_driver cxusb_driver = {
979 .name = "dvb_usb_cxusb", 1065 .name = "dvb_usb_cxusb",
980 .probe = cxusb_probe, 1066 .probe = cxusb_probe,
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 6f14c853ffea..53496985ddfd 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -148,6 +148,7 @@
148#define USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD 0xdb58 148#define USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD 0xdb58
149#define USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM 0xdb59 149#define USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM 0xdb59
150#define USB_PID_DVICO_BLUEBIRD_DUAL_4 0xdb78 150#define USB_PID_DVICO_BLUEBIRD_DUAL_4 0xdb78
151#define USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2 0xdb70
151#define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD 0xdb54 152#define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD 0xdb54
152#define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM 0xdb55 153#define USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM 0xdb55
153#define USB_PID_MEDION_MD95700 0x0932 154#define USB_PID_MEDION_MD95700 0x0932