aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700.h1
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_core.c7
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c111
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h1
4 files changed, 119 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700.h b/drivers/media/dvb/dvb-usb/dib0700.h
index cc0c51d82f2c..739193943c17 100644
--- a/drivers/media/dvb/dvb-usb/dib0700.h
+++ b/drivers/media/dvb/dvb-usb/dib0700.h
@@ -42,6 +42,7 @@ struct dib0700_state {
42 u8 rc_counter; 42 u8 rc_counter;
43 u8 is_dib7000pc; 43 u8 is_dib7000pc;
44 u8 fw_use_new_i2c_api; 44 u8 fw_use_new_i2c_api;
45 u8 disable_streaming_master_mode;
45}; 46};
46 47
47extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val); 48extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val);
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index 4daac8642006..dd53cee3896d 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -350,7 +350,12 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
350 350
351 b[0] = REQUEST_ENABLE_VIDEO; 351 b[0] = REQUEST_ENABLE_VIDEO;
352 b[1] = (onoff << 4) | 0x00; /* this bit gives a kind of command, rather than enabling something or not */ 352 b[1] = (onoff << 4) | 0x00; /* this bit gives a kind of command, rather than enabling something or not */
353 b[2] = (0x01 << 4); /* Master mode */ 353
354 if (st->disable_streaming_master_mode == 1)
355 b[2] = 0x00;
356 else
357 b[2] = (0x01 << 4); /* Master mode */
358
354 b[3] = 0x00; 359 b[3] = 0x00;
355 360
356 deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id); 361 deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id);
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index d08cd4562097..7d9efd702129 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -14,6 +14,8 @@
14#include "mt2060.h" 14#include "mt2060.h"
15#include "mt2266.h" 15#include "mt2266.h"
16#include "tuner-xc2028.h" 16#include "tuner-xc2028.h"
17#include "xc5000.h"
18#include "s5h1411.h"
17#include "dib0070.h" 19#include "dib0070.h"
18 20
19static int force_lna_activation; 21static int force_lna_activation;
@@ -1078,6 +1080,89 @@ static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap)
1078 return adap->fe == NULL ? -ENODEV : 0; 1080 return adap->fe == NULL ? -ENODEV : 0;
1079} 1081}
1080 1082
1083/* S5H1411 */
1084static struct s5h1411_config pinnacle_801e_config = {
1085 .output_mode = S5H1411_PARALLEL_OUTPUT,
1086 .gpio = S5H1411_GPIO_OFF,
1087 .mpeg_timing = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,
1088 .qam_if = S5H1411_IF_44000,
1089 .vsb_if = S5H1411_IF_44000,
1090 .inversion = S5H1411_INVERSION_OFF,
1091 .status_mode = S5H1411_DEMODLOCKING
1092};
1093
1094/* Pinnacle PCTV HD Pro 801e GPIOs map:
1095 GPIO0 - currently unknown
1096 GPIO1 - xc5000 tuner reset
1097 GPIO2 - CX25843 sleep
1098 GPIO3 - currently unknown
1099 GPIO4 - currently unknown
1100 GPIO6 - currently unknown
1101 GPIO7 - currently unknown
1102 GPIO9 - currently unknown
1103 GPIO10 - CX25843 reset
1104 */
1105static int s5h1411_frontend_attach(struct dvb_usb_adapter *adap)
1106{
1107 struct dib0700_state *st = adap->dev->priv;
1108
1109 /* Make use of the new i2c functions from FW 1.20 */
1110 st->fw_use_new_i2c_api = 1;
1111
1112 /* The s5h1411 requires the dib0700 to not be in master mode */
1113 st->disable_streaming_master_mode = 1;
1114
1115 /* All msleep values taken from Windows USB trace */
1116 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
1117 dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0);
1118 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
1119 msleep(400);
1120 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);
1121 msleep(60);
1122 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
1123 msleep(30);
1124 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
1125 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
1126 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
1127 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
1128 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0);
1129 msleep(30);
1130
1131 /* Put the CX25843 to sleep for now since we're in digital mode */
1132 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1);
1133
1134 /* GPIOs are initialized, do the attach */
1135 adap->fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config,
1136 &adap->dev->i2c_adap);
1137 return adap->fe == NULL ? -ENODEV : 0;
1138}
1139
1140int dib0700_xc5000_tuner_callback(void *priv, int command, int arg)
1141{
1142 struct dvb_usb_adapter *adap = priv;
1143
1144 /* Reset the tuner */
1145 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0);
1146 msleep(330); /* from Windows USB trace */
1147 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1);
1148 msleep(330); /* from Windows USB trace */
1149
1150 return 0;
1151}
1152
1153static struct xc5000_config s5h1411_xc5000_tunerconfig = {
1154 .i2c_address = 0x64,
1155 .if_khz = 5380,
1156 .tuner_callback = dib0700_xc5000_tuner_callback
1157};
1158
1159static int xc5000_tuner_attach(struct dvb_usb_adapter *adap)
1160{
1161 return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap,
1162 &s5h1411_xc5000_tunerconfig, adap)
1163 == NULL ? -ENODEV : 0;
1164}
1165
1081/* DVB-USB and USB stuff follows */ 1166/* DVB-USB and USB stuff follows */
1082struct usb_device_id dib0700_usb_id_table[] = { 1167struct usb_device_id dib0700_usb_id_table[] = {
1083/* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, 1168/* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) },
@@ -1122,6 +1207,7 @@ struct usb_device_id dib0700_usb_id_table[] = {
1122 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) }, 1207 { USB_DEVICE(USB_VID_GIGABYTE, USB_PID_GIGABYTE_U8000) },
1123 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) }, 1208 { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_STK7700PH) },
1124 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) }, 1209 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) },
1210/* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) },
1125 { 0 } /* Terminating entry */ 1211 { 0 } /* Terminating entry */
1126}; 1212};
1127MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); 1213MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
@@ -1442,6 +1528,31 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1442 .rc_key_map = dib0700_rc_keys, 1528 .rc_key_map = dib0700_rc_keys,
1443 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), 1529 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1444 .rc_query = dib0700_rc_query 1530 .rc_query = dib0700_rc_query
1531 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
1532 .num_adapters = 1,
1533 .adapter = {
1534 {
1535 .frontend_attach = s5h1411_frontend_attach,
1536 .tuner_attach = xc5000_tuner_attach,
1537
1538 DIB0700_DEFAULT_STREAMING_CONFIG(0x02),
1539
1540 .size_of_priv = sizeof(struct
1541 dib0700_adapter_state),
1542 },
1543 },
1544
1545 .num_device_descs = 1,
1546 .devices = {
1547 { "Pinnacle PCTV HD Pro USB Stick",
1548 { &dib0700_usb_id_table[40], NULL },
1549 { NULL },
1550 },
1551 },
1552 .rc_interval = DEFAULT_RC_INTERVAL,
1553 .rc_key_map = dib0700_rc_keys,
1554 .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys),
1555 .rc_query = dib0700_rc_query
1445 }, 1556 },
1446}; 1557};
1447 1558
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 8926db2fc489..38a23be68dbc 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -171,6 +171,7 @@
171#define USB_PID_PINNACLE_PCTV71E 0x022b 171#define USB_PID_PINNACLE_PCTV71E 0x022b
172#define USB_PID_PINNACLE_PCTV72E 0x0236 172#define USB_PID_PINNACLE_PCTV72E 0x0236
173#define USB_PID_PINNACLE_PCTV73E 0x0237 173#define USB_PID_PINNACLE_PCTV73E 0x0237
174#define USB_PID_PINNACLE_PCTV801E 0x023a
174#define USB_PID_PCTV_200E 0x020e 175#define USB_PID_PCTV_200E 0x020e
175#define USB_PID_PCTV_400E 0x020f 176#define USB_PID_PCTV_400E 0x020f
176#define USB_PID_PCTV_450E 0x0222 177#define USB_PID_PCTV_450E 0x0222