blob: 6dd50bc8418e0d83788ea3915f0170078f46688e [file] [log] [blame]
Patrick Boettcher3706a4d2005-09-09 13:02:41 -07001/* DVB USB compliant Linux driver for the TwinhanDTV StarBox USB2.0 DVB-S
2 * receiver.
3 *
4 * Copyright (C) 2005 Ralph Metzler <rjkm@metzlerbros.de>
5 * Metzler Brothers Systementwicklung GbR
6 *
7 * Copyright (C) 2005 Patrick Boettcher <patrick.boettcher@desy.de>
8 *
9 * Thanks to Twinhan who kindly provided hardware and information.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation, version 2.
14 *
15 * see Documentation/dvb/README.dvb-usb for more information
16 */
17#include "vp702x.h"
Florian Mickler1c6410f2011-03-21 07:19:08 -030018#include <linux/mutex.h>
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070019
20/* debug */
21int dvb_usb_vp702x_debug;
22module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
23MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
24
Janne Grunau78e92002008-04-09 19:13:13 -030025DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
26
Florian Mickler36f773e2011-03-21 07:19:07 -030027struct vp702x_adapter_state {
Patrick Boettcher0540c492006-09-19 12:51:43 -030028 int pid_filter_count;
29 int pid_filter_can_bypass;
30 u8 pid_filter_state;
31};
32
Florian Mickler9a187c42011-03-21 07:19:11 -030033static int vp702x_usb_in_op_unlocked(struct dvb_usb_device *d, u8 req,
34 u16 value, u16 index, u8 *b, int blen)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070035{
Florian Micklerd30615d2011-03-21 07:19:06 -030036 int ret;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070037
Florian Micklerd30615d2011-03-21 07:19:06 -030038 ret = usb_control_msg(d->udev,
39 usb_rcvctrlpipe(d->udev, 0),
40 req,
41 USB_TYPE_VENDOR | USB_DIR_IN,
42 value, index, b, blen,
43 2000);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070044
Patrick Boettcher0540c492006-09-19 12:51:43 -030045 if (ret < 0) {
46 warn("usb in operation failed. (%d)", ret);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070047 ret = -EIO;
48 } else
49 ret = 0;
50
Patrick Boettcher0540c492006-09-19 12:51:43 -030051
52 deb_xfer("in: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070053 debug_dump(b,blen,deb_xfer);
54
55 return ret;
56}
57
Florian Mickler9a187c42011-03-21 07:19:11 -030058int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value,
59 u16 index, u8 *b, int blen)
60{
61 int ret;
62
63 mutex_lock(&d->usb_mutex);
64 ret = vp702x_usb_in_op_unlocked(d, req, value, index, b, blen);
65 mutex_unlock(&d->usb_mutex);
66
67 return ret;
68}
69
70int vp702x_usb_out_op_unlocked(struct dvb_usb_device *d, u8 req, u16 value,
71 u16 index, u8 *b, int blen)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070072{
Patrick Boettcher0540c492006-09-19 12:51:43 -030073 int ret;
74 deb_xfer("out: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070075 debug_dump(b,blen,deb_xfer);
76
Patrick Boettcher0540c492006-09-19 12:51:43 -030077 if ((ret = usb_control_msg(d->udev,
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070078 usb_sndctrlpipe(d->udev,0),
79 req,
80 USB_TYPE_VENDOR | USB_DIR_OUT,
81 value,index,b,blen,
Patrick Boettcher0540c492006-09-19 12:51:43 -030082 2000)) != blen) {
83 warn("usb out operation failed. (%d)",ret);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -070084 return -EIO;
85 } else
86 return 0;
87}
88
Florian Mickler9a187c42011-03-21 07:19:11 -030089int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
90 u16 index, u8 *b, int blen)
91{
92 int ret;
93
94 mutex_lock(&d->usb_mutex);
95 ret = vp702x_usb_out_op_unlocked(d, req, value, index, b, blen);
96 mutex_unlock(&d->usb_mutex);
97
98 return ret;
99}
100
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700101int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec)
102{
103 int ret;
104
Ingo Molnar3593cab2006-02-07 06:49:14 -0200105 if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700106 return ret;
107
Florian Mickler9a187c42011-03-21 07:19:11 -0300108 ret = vp702x_usb_out_op_unlocked(d, REQUEST_OUT, 0, 0, o, olen);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700109 msleep(msec);
Florian Mickler9a187c42011-03-21 07:19:11 -0300110 ret = vp702x_usb_in_op_unlocked(d, REQUEST_IN, 0, 0, i, ilen);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700111
Ingo Molnar3593cab2006-02-07 06:49:14 -0200112 mutex_unlock(&d->usb_mutex);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700113 return ret;
114}
115
Adrian Bunk703cb2c2006-01-23 17:11:09 -0200116static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o,
117 int olen, u8 *i, int ilen, int msec)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700118{
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700119 int ret = 0;
Florian Mickler57873c72011-03-21 07:19:10 -0300120 u8 *buf;
121 int buflen = max(olen + 2, ilen + 1);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700122
Florian Mickler57873c72011-03-21 07:19:10 -0300123 buf = kmalloc(buflen, GFP_KERNEL);
124 if (!buf)
125 return -ENOMEM;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700126
Florian Mickler57873c72011-03-21 07:19:10 -0300127 buf[0] = 0x00;
128 buf[1] = cmd;
129 memcpy(&buf[2], o, olen);
130
131 ret = vp702x_usb_inout_op(d, buf, olen+2, buf, ilen+1, msec);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700132
133 if (ret == 0)
Florian Mickler57873c72011-03-21 07:19:10 -0300134 memcpy(i, &buf[1], ilen);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700135
Florian Mickler57873c72011-03-21 07:19:10 -0300136 kfree(buf);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700137 return ret;
138}
139
Patrick Boettcher0540c492006-09-19 12:51:43 -0300140static int vp702x_set_pld_mode(struct dvb_usb_adapter *adap, u8 bypass)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700141{
Florian Mickler57873c72011-03-21 07:19:10 -0300142 int ret;
Florian Mickler8ea793a2011-03-21 07:19:12 -0300143 struct vp702x_device_state *st = adap->dev->priv;
144 u8 *buf;
145
146 mutex_lock(&st->buf_mutex);
147
148 buf = st->buf;
149 memset(buf, 0, 16);
Florian Mickler57873c72011-03-21 07:19:10 -0300150
151 ret = vp702x_usb_in_op(adap->dev, 0xe0, (bypass << 8) | 0x0e,
152 0, buf, 16);
Florian Mickler8ea793a2011-03-21 07:19:12 -0300153 mutex_unlock(&st->buf_mutex);
Florian Mickler57873c72011-03-21 07:19:10 -0300154 return ret;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700155}
156
Patrick Boettcher0540c492006-09-19 12:51:43 -0300157static int vp702x_set_pld_state(struct dvb_usb_adapter *adap, u8 state)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700158{
Florian Mickler57873c72011-03-21 07:19:10 -0300159 int ret;
Florian Mickler8ea793a2011-03-21 07:19:12 -0300160 struct vp702x_device_state *st = adap->dev->priv;
161 u8 *buf;
Florian Mickler57873c72011-03-21 07:19:10 -0300162
Florian Mickler8ea793a2011-03-21 07:19:12 -0300163 mutex_lock(&st->buf_mutex);
164
165 buf = st->buf;
166 memset(buf, 0, 16);
Florian Mickler57873c72011-03-21 07:19:10 -0300167 ret = vp702x_usb_in_op(adap->dev, 0xe0, (state << 8) | 0x0f,
168 0, buf, 16);
Florian Mickler8ea793a2011-03-21 07:19:12 -0300169
170 mutex_unlock(&st->buf_mutex);
171
Florian Mickler57873c72011-03-21 07:19:10 -0300172 return ret;
Patrick Boettcher0540c492006-09-19 12:51:43 -0300173}
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700174
Patrick Boettcher0540c492006-09-19 12:51:43 -0300175static int vp702x_set_pid(struct dvb_usb_adapter *adap, u16 pid, u8 id, int onoff)
176{
Florian Mickler36f773e2011-03-21 07:19:07 -0300177 struct vp702x_adapter_state *st = adap->priv;
Florian Mickler8ea793a2011-03-21 07:19:12 -0300178 struct vp702x_device_state *dst = adap->dev->priv;
Florian Mickler57873c72011-03-21 07:19:10 -0300179 u8 *buf;
180
Patrick Boettcher0540c492006-09-19 12:51:43 -0300181 if (onoff)
182 st->pid_filter_state |= (1 << id);
183 else {
184 st->pid_filter_state &= ~(1 << id);
185 pid = 0xffff;
186 }
187
188 id = 0x10 + id*2;
189
190 vp702x_set_pld_state(adap, st->pid_filter_state);
Florian Mickler8ea793a2011-03-21 07:19:12 -0300191
192 mutex_lock(&dst->buf_mutex);
193
194 buf = dst->buf;
195 memset(buf, 0, 16);
Patrick Boettcher0540c492006-09-19 12:51:43 -0300196 vp702x_usb_in_op(adap->dev, 0xe0, (((pid >> 8) & 0xff) << 8) | (id), 0, buf, 16);
197 vp702x_usb_in_op(adap->dev, 0xe0, (((pid ) & 0xff) << 8) | (id+1), 0, buf, 16);
Florian Mickler57873c72011-03-21 07:19:10 -0300198
Florian Mickler8ea793a2011-03-21 07:19:12 -0300199 mutex_unlock(&dst->buf_mutex);
200
Patrick Boettcher0540c492006-09-19 12:51:43 -0300201 return 0;
202}
203
204
205static int vp702x_init_pid_filter(struct dvb_usb_adapter *adap)
206{
Florian Mickler36f773e2011-03-21 07:19:07 -0300207 struct vp702x_adapter_state *st = adap->priv;
Florian Mickler8ea793a2011-03-21 07:19:12 -0300208 struct vp702x_device_state *dst = adap->dev->priv;
Patrick Boettcher0540c492006-09-19 12:51:43 -0300209 int i;
Florian Mickler57873c72011-03-21 07:19:10 -0300210 u8 *b;
211
Patrick Boettcher0540c492006-09-19 12:51:43 -0300212 st->pid_filter_count = 8;
213 st->pid_filter_can_bypass = 1;
214 st->pid_filter_state = 0x00;
215
Florian Mickler57873c72011-03-21 07:19:10 -0300216 vp702x_set_pld_mode(adap, 1); /* bypass */
Patrick Boettcher0540c492006-09-19 12:51:43 -0300217
218 for (i = 0; i < st->pid_filter_count; i++)
219 vp702x_set_pid(adap, 0xffff, i, 1);
220
Florian Mickler8ea793a2011-03-21 07:19:12 -0300221 mutex_lock(&dst->buf_mutex);
222 b = dst->buf;
223 memset(b, 0, 10);
Patrick Boettcher0540c492006-09-19 12:51:43 -0300224 vp702x_usb_in_op(adap->dev, 0xb5, 3, 0, b, 10);
225 vp702x_usb_in_op(adap->dev, 0xb5, 0, 0, b, 10);
226 vp702x_usb_in_op(adap->dev, 0xb5, 1, 0, b, 10);
Florian Mickler8ea793a2011-03-21 07:19:12 -0300227 mutex_unlock(&dst->buf_mutex);
228 /*vp702x_set_pld_mode(d, 0); // filter */
Patrick Boettcher0540c492006-09-19 12:51:43 -0300229
Patrick Boettcher0540c492006-09-19 12:51:43 -0300230 return 0;
231}
232
233static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
234{
235 return 0;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700236}
237
238/* keys for the enclosed remote control */
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300239static struct rc_map_table rc_map_vp702x_table[] = {
Mauro Carvalho Chehab2e365882009-08-29 15:19:31 -0300240 { 0x0001, KEY_1 },
241 { 0x0002, KEY_2 },
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700242};
243
244/* remote control stuff (does not work with my box) */
245static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
246{
Florian Mickler57873c72011-03-21 07:19:10 -0300247 u8 *key;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700248 int i;
249
250/* remove the following return to enabled remote querying */
251 return 0;
252
Florian Mickler57873c72011-03-21 07:19:10 -0300253 key = kmalloc(10, GFP_KERNEL);
254 if (!key)
255 return -ENOMEM;
256
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700257 vp702x_usb_in_op(d,READ_REMOTE_REQ,0,0,key,10);
258
259 deb_rc("remote query key: %x %d\n",key[1],key[1]);
260
261 if (key[1] == 0x44) {
262 *state = REMOTE_NO_KEY_PRESSED;
Florian Mickler57873c72011-03-21 07:19:10 -0300263 kfree(key);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700264 return 0;
265 }
266
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300267 for (i = 0; i < ARRAY_SIZE(rc_map_vp702x_table); i++)
268 if (rc5_custom(&rc_map_vp702x_table[i]) == key[1]) {
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700269 *state = REMOTE_KEY_PRESSED;
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300270 *event = rc_map_vp702x_table[i].keycode;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700271 break;
272 }
Florian Mickler57873c72011-03-21 07:19:10 -0300273 kfree(key);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700274 return 0;
275}
276
Patrick Boettcher0540c492006-09-19 12:51:43 -0300277
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700278static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6])
279{
Florian Mickler57873c72011-03-21 07:19:10 -0300280 u8 i, *buf;
Florian Mickler8ea793a2011-03-21 07:19:12 -0300281 struct vp702x_device_state *st = d->priv;
Florian Mickler57873c72011-03-21 07:19:10 -0300282
Florian Mickler8ea793a2011-03-21 07:19:12 -0300283 mutex_lock(&st->buf_mutex);
284 buf = st->buf;
Patrick Boettcher0540c492006-09-19 12:51:43 -0300285 for (i = 6; i < 12; i++)
Florian Mickler57873c72011-03-21 07:19:10 -0300286 vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1, &buf[i - 6], 1);
287
288 memcpy(mac, buf, 6);
Florian Mickler8ea793a2011-03-21 07:19:12 -0300289 mutex_unlock(&st->buf_mutex);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700290 return 0;
291}
292
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300293static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700294{
Patrick Boettcher0540c492006-09-19 12:51:43 -0300295 u8 buf[10] = { 0 };
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700296
Patrick Boettcher0540c492006-09-19 12:51:43 -0300297 vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 0, 7, NULL, 0);
298
Florian Micklerd30615d2011-03-21 07:19:06 -0300299 if (vp702x_usb_inout_cmd(adap->dev, GET_SYSTEM_STRING, NULL, 0,
300 buf, 10, 10))
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700301 return -EIO;
302
Patrick Boettcher0540c492006-09-19 12:51:43 -0300303 buf[9] = '\0';
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700304 info("system string: %s",&buf[1]);
305
Patrick Boettcher0540c492006-09-19 12:51:43 -0300306 vp702x_init_pid_filter(adap);
307
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300308 adap->fe = vp702x_fe_attach(adap->dev);
Patrick Boettcher0540c492006-09-19 12:51:43 -0300309 vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0);
310
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700311 return 0;
312}
313
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300314static struct dvb_usb_device_properties vp702x_properties;
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700315
316static int vp702x_usb_probe(struct usb_interface *intf,
317 const struct usb_device_id *id)
318{
Florian Mickler1c6410f2011-03-21 07:19:08 -0300319 struct dvb_usb_device *d;
320 struct vp702x_device_state *st;
321 int ret;
322
323 ret = dvb_usb_device_init(intf, &vp702x_properties,
324 THIS_MODULE, &d, adapter_nr);
325 if (ret)
326 goto out;
327
328 st = d->priv;
329 st->buf_len = 16;
330 st->buf = kmalloc(st->buf_len, GFP_KERNEL);
331 if (!st->buf) {
332 ret = -ENOMEM;
333 dvb_usb_device_exit(intf);
334 goto out;
335 }
336 mutex_init(&st->buf_mutex);
337
338out:
339 return ret;
340
341}
342
343static void vp702x_usb_disconnect(struct usb_interface *intf)
344{
345 struct dvb_usb_device *d = usb_get_intfdata(intf);
346 struct vp702x_device_state *st = d->priv;
347 mutex_lock(&st->buf_mutex);
348 kfree(st->buf);
349 mutex_unlock(&st->buf_mutex);
350 dvb_usb_device_exit(intf);
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700351}
352
353static struct usb_device_id vp702x_usb_table [] = {
354 { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7021_COLD) },
Patrick Boettcher0540c492006-09-19 12:51:43 -0300355// { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_COLD) },
356// { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_WARM) },
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700357 { 0 },
358};
359MODULE_DEVICE_TABLE(usb, vp702x_usb_table);
360
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300361static struct dvb_usb_device_properties vp702x_properties = {
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700362 .usb_ctrl = CYPRESS_FX2,
Patrick Boettcher0540c492006-09-19 12:51:43 -0300363 .firmware = "dvb-usb-vp702x-02.fw",
364 .no_reconnect = 1,
365
366 .size_of_priv = sizeof(struct vp702x_device_state),
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700367
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300368 .num_adapters = 1,
369 .adapter = {
370 {
Patrick Boettcher0540c492006-09-19 12:51:43 -0300371 .caps = DVB_USB_ADAP_RECEIVES_204_BYTE_TS,
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300372
Patrick Boettcher0540c492006-09-19 12:51:43 -0300373 .streaming_ctrl = vp702x_streaming_ctrl,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300374 .frontend_attach = vp702x_frontend_attach,
Patrick Boettcher0540c492006-09-19 12:51:43 -0300375
Patrick Boettcher01451e72006-10-13 11:34:46 -0300376 /* parameter for the MPEG2-data transfer */
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300377 .stream = {
378 .type = USB_BULK,
Patrick Boettcher0540c492006-09-19 12:51:43 -0300379 .count = 10,
Patrick Boettcher01451e72006-10-13 11:34:46 -0300380 .endpoint = 0x02,
381 .u = {
382 .bulk = {
383 .buffersize = 4096,
384 }
385 }
386 },
Florian Mickler36f773e2011-03-21 07:19:07 -0300387 .size_of_priv = sizeof(struct vp702x_adapter_state),
Patrick Boettcher0540c492006-09-19 12:51:43 -0300388 }
Patrick Boettcher01451e72006-10-13 11:34:46 -0300389 },
Patrick Boettcher4d43e132006-09-30 06:53:48 -0300390 .read_mac_address = vp702x_read_mac_addr,
391
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300392 .rc.legacy = {
Mauro Carvalho Chehab2f4f58d2010-11-17 15:46:09 -0300393 .rc_map_table = rc_map_vp702x_table,
394 .rc_map_size = ARRAY_SIZE(rc_map_vp702x_table),
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -0300395 .rc_interval = 400,
396 .rc_query = vp702x_rc_query,
397 },
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700398
Patrick Boettcher0540c492006-09-19 12:51:43 -0300399 .num_device_descs = 1,
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700400 .devices = {
401 { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7021)",
402 .cold_ids = { &vp702x_usb_table[0], NULL },
Patrick Boettcher0540c492006-09-19 12:51:43 -0300403 .warm_ids = { NULL },
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700404 },
Patrick Boettcher0540c492006-09-19 12:51:43 -0300405/* { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7020)",
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700406 .cold_ids = { &vp702x_usb_table[2], NULL },
407 .warm_ids = { &vp702x_usb_table[3], NULL },
408 },
Patrick Boettcher0540c492006-09-19 12:51:43 -0300409*/ { NULL },
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700410 }
411};
412
413/* usb specific object needed to register this driver with the usb subsystem */
414static struct usb_driver vp702x_usb_driver = {
Patrick Boettcher0540c492006-09-19 12:51:43 -0300415 .name = "dvb_usb_vp702x",
Florian Micklerd30615d2011-03-21 07:19:06 -0300416 .probe = vp702x_usb_probe,
Florian Mickler1c6410f2011-03-21 07:19:08 -0300417 .disconnect = vp702x_usb_disconnect,
Florian Micklerd30615d2011-03-21 07:19:06 -0300418 .id_table = vp702x_usb_table,
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700419};
420
421/* module stuff */
422static int __init vp702x_usb_module_init(void)
423{
424 int result;
425 if ((result = usb_register(&vp702x_usb_driver))) {
426 err("usb_register failed. (%d)",result);
427 return result;
428 }
429
430 return 0;
431}
432
433static void __exit vp702x_usb_module_exit(void)
434{
435 /* deregister this driver from the USB subsystem */
436 usb_deregister(&vp702x_usb_driver);
437}
438
439module_init(vp702x_usb_module_init);
440module_exit(vp702x_usb_module_exit);
441
442MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
443MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones");
Patrick Boettcher0540c492006-09-19 12:51:43 -0300444MODULE_VERSION("1.0");
Patrick Boettcher3706a4d2005-09-09 13:02:41 -0700445MODULE_LICENSE("GPL");