18 static int dvb_usb_vp7045_debug;
24 #define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
25 #define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
26 #define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
45 if (out !=
NULL && outlen > 0)
46 memcpy(&buf[1], out, outlen);
53 usb_sndctrlpipe(d->
udev,0),
55 buf, 20, 2000) != 20) {
56 err(
"USB control message 'out' went wrong.");
64 usb_rcvctrlpipe(d->
udev,0),
66 buf, 12, 2000) != 12) {
67 err(
"USB control message 'in' went wrong.");
75 if (in !=
NULL && inlen > 0)
76 memcpy(in, &buf[1], inlen);
163 deb_rc(
"remote query key: %x %d\n",key,key);
170 for (i = 0; i <
ARRAY_SIZE(rc_map_vp7045_table); i++)
171 if (rc5_data(&rc_map_vp7045_table[i]) ==
key) {
173 *
event = rc_map_vp7045_table[
i].
keycode;
183 for (i=0; i < len; i++) {
188 deb_info(
"VP7045 EEPROM read (offs: %d, len: %d) : ",offset, i);
195 return vp7045_read_eeprom(d,mac, 6,
MAC_0_ADDR);
242 .firmware =
"dvb-usb-vp7045-01.fw",
250 .frontend_attach = vp7045_frontend_attach,
265 .power_ctrl = vp7045_power_ctrl,
266 .read_mac_address = vp7045_read_mac_addr,
270 .rc_map_table = rc_map_vp7045_table,
271 .rc_map_size =
ARRAY_SIZE(rc_map_vp7045_table),
272 .rc_query = vp7045_rc_query,
275 .num_device_descs = 2,
277 { .name =
"Twinhan USB2.0 DVB-T receiver (TwinhanDTV Alpha/MagicBox II)",
278 .cold_ids = { &vp7045_usb_table[0],
NULL },
279 .warm_ids = { &vp7045_usb_table[1],
NULL },
281 { .name =
"DigitalNow TinyUSB 2 DVB-t Receiver",
282 .cold_ids = { &vp7045_usb_table[2],
NULL },
283 .warm_ids = { &vp7045_usb_table[3],
NULL },
290 static struct usb_driver vp7045_usb_driver = {
291 .name =
"dvb_usb_vp7045",
292 .probe = vp7045_usb_probe,
294 .id_table = vp7045_usb_table,
300 MODULE_DESCRIPTION(
"Driver for Twinhan MagicBox/Alpha and DNTV tinyUSB2 DVB-T USB2.0");