Merge git://git.infradead.org/battery-2.6
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / media / dvb / dvb-usb / dibusb-mc.c
CommitLineData
776338e1
JS
1/* 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
78e92006
JG
17DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
18
776338e1 19/* USB Driver stuff */
4d43e13f 20static struct dvb_usb_device_properties dibusb_mc_properties;
776338e1
JS
21
22static int dibusb_mc_probe(struct usb_interface *intf,
23 const struct usb_device_id *id)
24{
78e92006
JG
25 return dvb_usb_device_init(intf, &dibusb_mc_properties, THIS_MODULE,
26 NULL, adapter_nr);
776338e1
JS
27}
28
29/* do not change the order of the ID table */
30static struct usb_device_id dibusb_dib3000mc_table [] = {
31/* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) },
32/* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) },
33/* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) },
a16bf5d5
OD
34/* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? )
35/* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) },
36/* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) },
37/* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) },
38/* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) },
e4d6c1f7
PB
39/* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) },
40/* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) },
cb25a74d
PB
41/* 10 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_COLD) },
42/* 11 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ARTEC_T14_WARM) },
d7357a53
OD
43/* 12 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_COLD) },
44/* 13 */ { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_WARM) },
ce212f05
NPT
45/* 14 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD) },
46/* 15 */ { USB_DEVICE(USB_VID_HUMAX_COEX, USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM) },
776338e1
JS
47 { } /* Terminating entry */
48};
49MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table);
50
4d43e13f
PB
51static struct dvb_usb_device_properties dibusb_mc_properties = {
52 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
776338e1
JS
53
54 .usb_ctrl = CYPRESS_FX2,
55 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
56
4d43e13f
PB
57 .num_adapters = 1,
58 .adapter = {
59 {
60 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
61 .pid_filter_count = 32,
01451e72
PB
62 .streaming_ctrl = dibusb2_0_streaming_ctrl,
63 .pid_filter = dibusb_pid_filter,
64 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
65 .frontend_attach = dibusb_dib3000mc_frontend_attach,
66 .tuner_attach = dibusb_dib3000mc_tuner_attach,
776338e1 67
776338e1 68 /* parameter for the MPEG2-data transfer */
4d43e13f
PB
69 .stream = {
70 .type = USB_BULK,
ce212f05 71 .count = 8,
01451e72
PB
72 .endpoint = 0x06,
73 .u = {
74 .bulk = {
75 .buffersize = 4096,
76 }
77 }
78 },
4d43e13f
PB
79 .size_of_priv = sizeof(struct dibusb_state),
80 }
81 },
82 .power_ctrl = dibusb2_0_power_ctrl,
83
f72a27b8
MCC
84 .rc.legacy = {
85 .rc_interval = DEFAULT_RC_INTERVAL,
2f4f58d6
MCC
86 .rc_map_table = rc_map_dibusb_table,
87 .rc_map_size = 111, /* FIXME */
f72a27b8
MCC
88 .rc_query = dibusb_rc_query,
89 },
4d43e13f
PB
90
91 .i2c_algo = &dibusb_i2c_algo,
92
93 .generic_bulk_ctrl_endpoint = 0x01,
776338e1 94
ce212f05 95 .num_device_descs = 8,
776338e1
JS
96 .devices = {
97 { "DiBcom USB2.0 DVB-T reference design (MOD3000P)",
98 { &dibusb_dib3000mc_table[0], NULL },
99 { &dibusb_dib3000mc_table[1], NULL },
100 },
a16bf5d5 101 { "Artec T1 USB2.0 TVBOX (please check the warm ID)",
776338e1 102 { &dibusb_dib3000mc_table[2], NULL },
a16bf5d5 103 { &dibusb_dib3000mc_table[3], NULL },
776338e1 104 },
a16bf5d5
OD
105 { "LITE-ON USB2.0 DVB-T Tuner",
106 /* Also rebranded as Intuix S800, Toshiba */
107 { &dibusb_dib3000mc_table[4], NULL },
108 { &dibusb_dib3000mc_table[5], NULL },
109 },
110 { "MSI Digivox Mini SL",
111 { &dibusb_dib3000mc_table[6], NULL },
112 { &dibusb_dib3000mc_table[7], NULL },
113 },
114 { "GRAND - USB2.0 DVB-T adapter",
115 { &dibusb_dib3000mc_table[8], NULL },
116 { &dibusb_dib3000mc_table[9], NULL },
117 },
cb25a74d
PB
118 { "Artec T14 - USB2.0 DVB-T",
119 { &dibusb_dib3000mc_table[10], NULL },
120 { &dibusb_dib3000mc_table[11], NULL },
121 },
d7357a53
OD
122 { "Leadtek - USB2.0 Winfast DTV dongle",
123 { &dibusb_dib3000mc_table[12], NULL },
124 { &dibusb_dib3000mc_table[13], NULL },
125 },
ce212f05
NPT
126 { "Humax/Coex DVB-T USB Stick 2.0 High Speed",
127 { &dibusb_dib3000mc_table[14], NULL },
128 { &dibusb_dib3000mc_table[15], NULL },
129 },
a16bf5d5 130 { NULL },
776338e1
JS
131 }
132};
133
134static struct usb_driver dibusb_mc_driver = {
63b5c1c4 135 .name = "dvb_usb_dibusb_mc",
776338e1
JS
136 .probe = dibusb_mc_probe,
137 .disconnect = dvb_usb_device_exit,
138 .id_table = dibusb_dib3000mc_table,
139};
140
141/* module stuff */
142static int __init dibusb_mc_module_init(void)
143{
144 int result;
145 if ((result = usb_register(&dibusb_mc_driver))) {
146 err("usb_register failed. Error number %d",result);
147 return result;
148 }
149
150 return 0;
151}
152
153static void __exit dibusb_mc_module_exit(void)
154{
155 /* deregister this driver from the USB subsystem */
156 usb_deregister(&dibusb_mc_driver);
157}
158
159module_init (dibusb_mc_module_init);
160module_exit (dibusb_mc_module_exit);
161
162MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
163MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices");
164MODULE_VERSION("1.0");
165MODULE_LICENSE("GPL");