aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Ludwig <michel.ludwig@gmail.com>2007-09-24 16:01:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:39:46 -0400
commit4386136d29327a6645f7dba963d609d2452db843 (patch)
treeffbace1f9b18e406774902eaae5d780c197f612f
parenta228618c1a2c15da35f8cc60286a25541fbc6348 (diff)
V4L/DVB (12801): tm6000: Add support for ADSTech Mini Dual TV (PTV-339).
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/staging/tm6000/tm6000-cards.c19
-rw-r--r--drivers/staging/tm6000/tm6000-core.c7
-rw-r--r--drivers/staging/tm6000/tm6000-dvb.c19
-rw-r--r--drivers/staging/tm6000/tm6000-i2c.c6
-rw-r--r--drivers/staging/tm6000/tm6000.h1
5 files changed, 42 insertions, 10 deletions
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c
index 608de59c9c13..c16f765aae57 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -37,6 +37,7 @@
37#define TM5600_BOARD_10MOONS_UT330 4 37#define TM5600_BOARD_10MOONS_UT330 4
38#define TM6000_BOARD_ADSTECH_DUAL_TV 5 38#define TM6000_BOARD_ADSTECH_DUAL_TV 5
39#define TM6000_BOARD_FREECOM_AND_SIMILAR 6 39#define TM6000_BOARD_FREECOM_AND_SIMILAR 6
40#define TM6000_BOARD_ADSTECH_MINI_DUAL_TV 7
40 41
41#define TM6000_MAXBOARDS 16 42#define TM6000_MAXBOARDS 16
42static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET }; 43static unsigned int card[] = {[0 ... (TM6000_MAXBOARDS - 1)] = UNSET };
@@ -55,7 +56,6 @@ struct tm6000_board {
55 int gpio_addr_tun_reset; /* GPIO used for tuner reset */ 56 int gpio_addr_tun_reset; /* GPIO used for tuner reset */
56}; 57};
57 58
58
59struct tm6000_board tm6000_boards[] = { 59struct tm6000_board tm6000_boards[] = {
60 [TM6000_BOARD_UNKNOWN] = { 60 [TM6000_BOARD_UNKNOWN] = {
61 .name = "Unknown tm6000 video grabber", 61 .name = "Unknown tm6000 video grabber",
@@ -118,7 +118,7 @@ struct tm6000_board tm6000_boards[] = {
118 }, 118 },
119 [TM6000_BOARD_FREECOM_AND_SIMILAR] = { 119 [TM6000_BOARD_FREECOM_AND_SIMILAR] = {
120 .name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual", 120 .name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual",
121 .tuner_type = TUNER_XC2028, 121 .tuner_type = TUNER_XC2028, /* has a XC3028 */
122 .tuner_addr = 0xc2, 122 .tuner_addr = 0xc2,
123 .demod_addr = 0x1e, 123 .demod_addr = 0x1e,
124 .caps = { 124 .caps = {
@@ -126,6 +126,20 @@ struct tm6000_board tm6000_boards[] = {
126 .has_dvb = 1, 126 .has_dvb = 1,
127 .has_zl10353 = 1, 127 .has_zl10353 = 1,
128 .has_eeprom = 0, 128 .has_eeprom = 0,
129 .has_remote = 1,
130 },
131 .gpio_addr_tun_reset = TM6000_GPIO_4,
132 },
133 [TM6000_BOARD_ADSTECH_MINI_DUAL_TV] = {
134 .name = "ADSTECH Mini Dual TV USB",
135 .tuner_type = TUNER_XC2028, /* has a XC3028 */
136 .tuner_addr = 0xc8,
137 .demod_addr = 0x1e,
138 .caps = {
139 .has_tuner = 1,
140 .has_dvb = 1,
141 .has_zl10353 = 1,
142 .has_eeprom = 0,
129 }, 143 },
130 .gpio_addr_tun_reset = TM6000_GPIO_4, 144 .gpio_addr_tun_reset = TM6000_GPIO_4,
131 }, 145 },
@@ -136,6 +150,7 @@ struct usb_device_id tm6000_id_table [] = {
136 { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_10MOONS_UT821 }, 150 { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_10MOONS_UT821 },
137 { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV }, 151 { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
138 { USB_DEVICE(0x14aa, 0x0620), .driver_info = TM6000_BOARD_FREECOM_AND_SIMILAR }, 152 { USB_DEVICE(0x14aa, 0x0620), .driver_info = TM6000_BOARD_FREECOM_AND_SIMILAR },
153 { USB_DEVICE(0x06e1, 0xb339), .driver_info = TM6000_BOARD_ADSTECH_MINI_DUAL_TV },
139 { }, 154 { },
140}; 155};
141 156
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c
index 3f2727d5b957..7728e40a34db 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -226,12 +226,17 @@ int tm6000_init_digital_mode (struct tm6000_core *dev)
226 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d1, 0xd8); 226 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d1, 0xd8);
227 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d2, 0xc0); 227 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d2, 0xc0);
228 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d6, 0x60); 228 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00d6, 0x60);
229
230 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00e2, 0x0c);
231 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00e8, 0xff);
232 tm6000_set_reg (dev, REQ_07_SET_GET_AVREG, 0x00eb, 0x08);
229 msleep(50); 233 msleep(50);
230 234
231 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); 235 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00);
236 msleep(50);
232 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x01); 237 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x01);
238 msleep(50);
233 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); 239 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00);
234
235 msleep(100); 240 msleep(100);
236 241
237 return 0; 242 return 0;
diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c
index d2ec6ca766cb..9df93cfe3106 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -61,10 +61,6 @@ int tm6000_start_stream(struct tm6000_core *dev)
61 61
62 tm6000_init_digital_mode(dev); 62 tm6000_init_digital_mode(dev);
63 63
64// ret = usb_set_interface(dev->udev, 0, 1);
65// if (ret<0)
66// return ret;
67
68/* 64/*
69 ret = tm6000_set_led_status(tm6000_dev, 0x1); 65 ret = tm6000_set_led_status(tm6000_dev, 0x1);
70 if(ret < 0) { 66 if(ret < 0) {
@@ -94,10 +90,17 @@ int tm6000_start_stream(struct tm6000_core *dev)
94 dvb->bulk_urb->transfer_buffer, 90 dvb->bulk_urb->transfer_buffer,
95 maxPaketSize, 91 maxPaketSize,
96 tm6000_urb_received, dev); 92 tm6000_urb_received, dev);
93
94 ret = usb_set_interface(dev->udev, 0, 1);
95 if(ret < 0) {
96 printk(KERN_ERR "tm6000: error %i in %s during set interface\n", ret, __FUNCTION__);
97 return ret;
98 }
99
97 ret = usb_clear_halt(dev->udev, pipe); 100 ret = usb_clear_halt(dev->udev, pipe);
98 if(ret < 0) { 101 if(ret < 0) {
99 printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",ret,__FUNCTION__); 102 printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",ret,__FUNCTION__);
100// return ret; 103 return ret;
101 } 104 }
102 else { 105 else {
103 printk(KERN_ERR "tm6000: pipe resetted\n"); 106 printk(KERN_ERR "tm6000: pipe resetted\n");
@@ -121,10 +124,16 @@ int tm6000_start_stream(struct tm6000_core *dev)
121 124
122void tm6000_stop_stream(struct tm6000_core *dev) 125void tm6000_stop_stream(struct tm6000_core *dev)
123{ 126{
127 int ret;
124 struct tm6000_dvb *dvb = dev->dvb; 128 struct tm6000_dvb *dvb = dev->dvb;
125 129
126// tm6000_set_led_status(tm6000_dev, 0x0); 130// tm6000_set_led_status(tm6000_dev, 0x0);
127 131
132 ret = usb_set_interface(dev->udev, 0, 0);
133 if(ret < 0) {
134 printk(KERN_ERR "tm6000: error %i in %s during set interface\n",ret,__FUNCTION__);
135 }
136
128 if(dvb->bulk_urb) { 137 if(dvb->bulk_urb) {
129 usb_kill_urb(dvb->bulk_urb); 138 usb_kill_urb(dvb->bulk_urb);
130 kfree(dvb->bulk_urb->transfer_buffer); 139 kfree(dvb->bulk_urb->transfer_buffer);
diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c
index 48473bdabb76..10c7d947d53e 100644
--- a/drivers/staging/tm6000/tm6000-i2c.c
+++ b/drivers/staging/tm6000/tm6000-i2c.c
@@ -299,9 +299,10 @@ static int tm6000_tuner_callback(void *ptr, int command, int arg)
299 case 0: 299 case 0:
300 tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, 300 tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN,
301 dev->tuner_reset_gpio, 0x00); 301 dev->tuner_reset_gpio, 0x00);
302 msleep(10); 302 msleep(130);
303 tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, 303 tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN,
304 dev->tuner_reset_gpio, 0x01); 304 dev->tuner_reset_gpio, 0x01);
305 msleep(130);
305 break; 306 break;
306 case 1: 307 case 1:
307 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 308 tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT,
@@ -314,9 +315,10 @@ static int tm6000_tuner_callback(void *ptr, int command, int arg)
314 TM6000_GPIO_CLK, 0); 315 TM6000_GPIO_CLK, 0);
315 if (rc<0) 316 if (rc<0)
316 return rc; 317 return rc;
317 msleep(10); 318 msleep(100);
318 rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, 319 rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN,
319 TM6000_GPIO_CLK, 1); 320 TM6000_GPIO_CLK, 1);
321 msleep(100);
320 break; 322 break;
321 } 323 }
322 } 324 }
diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h
index a5977e7ce51b..ffc55019390d 100644
--- a/drivers/staging/tm6000/tm6000.h
+++ b/drivers/staging/tm6000/tm6000.h
@@ -103,6 +103,7 @@ struct tm6000_capabilities {
103 unsigned int has_dvb:1; 103 unsigned int has_dvb:1;
104 unsigned int has_zl10353:1; 104 unsigned int has_zl10353:1;
105 unsigned int has_eeprom:1; 105 unsigned int has_eeprom:1;
106 unsigned int has_remote:1;
106}; 107};
107 108
108struct tm6000_dvb { 109struct tm6000_dvb {