blob: 2170e11d101420cac62ac8adc21306e874223c25 [file] [log] [blame]
Johannes Stezenbach776338e2005-06-23 22:02:35 -07001/* DVB USB compliant linux driver for mobile DVB-T USB devices based on
2 * reference designs made by DiBcom (http://www.dibcom.fr/) (DiB3000M-C/P)
3 *
4 * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
5 *
6 * based on GPL code from DiBcom, which has
7 * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr)
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation, version 2.
12 *
13 * see Documentation/dvb/README.dvb-usb for more information
14 */
15#include "dibusb.h"
16
17/* USB Driver stuff */
18static struct dvb_usb_properties dibusb_mc_properties;
19
20static int dibusb_mc_probe(struct usb_interface *intf,
21 const struct usb_device_id *id)
22{
Patrick Boettcher47dc3d62005-09-09 13:02:47 -070023 return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
Johannes Stezenbach776338e2005-06-23 22:02:35 -070024}
25
26/* do not change the order of the ID table */
27static struct usb_device_id dibusb_dib3000mc_table [] = {
28/* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) },
29/* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) },
30/* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
Olivier DANETa16bf5d2006-08-08 15:48:09 -030031/* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? )
32/* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) },
33/* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) },
34/* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) },
35/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) },
Patrick Boettchere4d6c1f2006-08-08 15:48:09 -030036/* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) },
37/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) },
Patrick Boettchercb25a742006-03-31 18:48:39 -030038/* 10 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_COLD) },
39/* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) },
Johannes Stezenbach776338e2005-06-23 22:02:35 -070040 { } /* Terminating entry */
41};
42MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
43
44static struct dvb_usb_properties dibusb_mc_properties = {
45 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER,
46 .pid_filter_count = 32,
47
48 .usb_ctrl = CYPRESS_FX2,
49 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
50
51 .size_of_priv = sizeof(struct dibusb_state),
52
53 .streaming_ctrl = dibusb2_0_streaming_ctrl,
54 .pid_filter = dibusb_pid_filter,
55 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
56 .power_ctrl = dibusb2_0_power_ctrl,
57 .frontend_attach = dibusb_dib3000mc_frontend_attach,
58 .tuner_attach = dibusb_dib3000mc_tuner_attach,
59
60 .rc_interval = DEFAULT_RC_INTERVAL,
61 .rc_key_map = dibusb_rc_keys,
62 .rc_key_map_size = 63, /* FIXME */
63 .rc_query = dibusb_rc_query,
64
65 .i2c_algo = &dibusb_i2c_algo,
66
67 .generic_bulk_ctrl_endpoint = 0x01,
68 /* parameter for the MPEG2-data transfer */
69 .urb = {
70 .type = DVB_USB_BULK,
71 .count = 7,
72 .endpoint = 0x06,
73 .u = {
74 .bulk = {
75 .buffersize = 4096,
76 }
77 }
78 },
79
Patrick Boettchercb25a742006-03-31 18:48:39 -030080 .num_device_descs = 6,
Johannes Stezenbach776338e2005-06-23 22:02:35 -070081 .devices = {
82 { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
83 { &dibusb_dib3000mc_table[0], NULL },
84 { &dibusb_dib3000mc_table[1], NULL },
85 },
Olivier DANETa16bf5d2006-08-08 15:48:09 -030086 { "Artec T1 USB2.0 TVBOX (please check the warm ID)",
Johannes Stezenbach776338e2005-06-23 22:02:35 -070087 { &dibusb_dib3000mc_table[2], NULL },
Olivier DANETa16bf5d2006-08-08 15:48:09 -030088 { &dibusb_dib3000mc_table[3], NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -070089 },
Olivier DANETa16bf5d2006-08-08 15:48:09 -030090 { "LITE-ON USB2.0 DVB-T Tuner",
91 /* Also rebranded as Intuix S800, Toshiba */
92 { &dibusb_dib3000mc_table[4], NULL },
93 { &dibusb_dib3000mc_table[5], NULL },
94 },
95 { "MSI Digivox Mini SL",
96 { &dibusb_dib3000mc_table[6], NULL },
97 { &dibusb_dib3000mc_table[7], NULL },
98 },
99 { "GRAND - USB2.0 DVB-T adapter",
100 { &dibusb_dib3000mc_table[8], NULL },
101 { &dibusb_dib3000mc_table[9], NULL },
102 },
Patrick Boettchercb25a742006-03-31 18:48:39 -0300103 { "Artec T14 - USB2.0 DVB-T",
104 { &dibusb_dib3000mc_table[10], NULL },
105 { &dibusb_dib3000mc_table[11], NULL },
106 },
Olivier DANETa16bf5d2006-08-08 15:48:09 -0300107 { NULL },
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700108 }
109};
110
111static struct usb_driver dibusb_mc_driver = {
Patrick Boettcher63b5c1c2005-07-07 17:58:30 -0700112 .name = "dvb_usb_dibusb_mc",
Johannes Stezenbach776338e2005-06-23 22:02:35 -0700113 .probe = dibusb_mc_probe,
114 .disconnect = dvb_usb_device_exit,
115 .id_table = dibusb_dib3000mc_table,
116};
117
118/* module stuff */
119static int __init dibusb_mc_module_init(void)
120{
121 int result;
122 if ((result = usb_register(&dibusb_mc_driver))) {
123 err("usb_register failed. Error number %d",result);
124 return result;
125 }
126
127 return 0;
128}
129
130static void __exit dibusb_mc_module_exit(void)
131{
132 /* deregister this driver from the USB subsystem */
133 usb_deregister(&dibusb_mc_driver);
134}
135
136module_init (dibusb_mc_module_init);
137module_exit (dibusb_mc_module_exit);
138
139MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
140MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
141MODULE_VERSION("1.0");
142MODULE_LICENSE("GPL");