diff options
author | Johannes Stezenbach <js@linuxtv.org> | 2005-06-24 01:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:05:30 -0400 |
commit | 776338e121b9db3156bfb4e21622a0219bbab9d4 (patch) | |
tree | 5102272b708a9e8ff81165714870d3d38363cc23 /drivers/media/dvb/dvb-usb/dibusb-mc.c | |
parent | b6a235b1186dda0800c8bedc2526830a4a36b44e (diff) |
[PATCH] dvb: Add generalized dvb-usb driver
Add generalized dvb-usb driver which supports a wide variety of devices.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dibusb-mc.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mc.c | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c new file mode 100644 index 000000000000..aad8ed3fe005 --- /dev/null +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -0,0 +1,116 @@ | |||
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 | |||
17 | /* USB Driver stuff */ | ||
18 | static struct dvb_usb_properties dibusb_mc_properties; | ||
19 | |||
20 | static int dibusb_mc_probe(struct usb_interface *intf, | ||
21 | const struct usb_device_id *id) | ||
22 | { | ||
23 | return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE); | ||
24 | } | ||
25 | |||
26 | /* do not change the order of the ID table */ | ||
27 | static 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) }, | ||
31 | { } /* Terminating entry */ | ||
32 | }; | ||
33 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); | ||
34 | |||
35 | static struct dvb_usb_properties dibusb_mc_properties = { | ||
36 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, | ||
37 | .pid_filter_count = 32, | ||
38 | |||
39 | .usb_ctrl = CYPRESS_FX2, | ||
40 | .firmware = "dvb-usb-dibusb-6.0.0.8.fw", | ||
41 | |||
42 | .size_of_priv = sizeof(struct dibusb_state), | ||
43 | |||
44 | .streaming_ctrl = dibusb2_0_streaming_ctrl, | ||
45 | .pid_filter = dibusb_pid_filter, | ||
46 | .pid_filter_ctrl = dibusb_pid_filter_ctrl, | ||
47 | .power_ctrl = dibusb2_0_power_ctrl, | ||
48 | .frontend_attach = dibusb_dib3000mc_frontend_attach, | ||
49 | .tuner_attach = dibusb_dib3000mc_tuner_attach, | ||
50 | |||
51 | .rc_interval = DEFAULT_RC_INTERVAL, | ||
52 | .rc_key_map = dibusb_rc_keys, | ||
53 | .rc_key_map_size = 63, /* FIXME */ | ||
54 | .rc_query = dibusb_rc_query, | ||
55 | |||
56 | .i2c_algo = &dibusb_i2c_algo, | ||
57 | |||
58 | .generic_bulk_ctrl_endpoint = 0x01, | ||
59 | /* parameter for the MPEG2-data transfer */ | ||
60 | .urb = { | ||
61 | .type = DVB_USB_BULK, | ||
62 | .count = 7, | ||
63 | .endpoint = 0x06, | ||
64 | .u = { | ||
65 | .bulk = { | ||
66 | .buffersize = 4096, | ||
67 | } | ||
68 | } | ||
69 | }, | ||
70 | |||
71 | .num_device_descs = 2, | ||
72 | .devices = { | ||
73 | { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", | ||
74 | { &dibusb_dib3000mc_table[0], NULL }, | ||
75 | { &dibusb_dib3000mc_table[1], NULL }, | ||
76 | }, | ||
77 | { "Artec T1 USB2.0 TVBOX (please report the warm ID)", | ||
78 | { &dibusb_dib3000mc_table[2], NULL }, | ||
79 | { NULL }, | ||
80 | }, | ||
81 | } | ||
82 | }; | ||
83 | |||
84 | static struct usb_driver dibusb_mc_driver = { | ||
85 | .owner = THIS_MODULE, | ||
86 | .name = "DiBcom based USB2.0 DVB-T (DiB3000M-C/P based) devices", | ||
87 | .probe = dibusb_mc_probe, | ||
88 | .disconnect = dvb_usb_device_exit, | ||
89 | .id_table = dibusb_dib3000mc_table, | ||
90 | }; | ||
91 | |||
92 | /* module stuff */ | ||
93 | static int __init dibusb_mc_module_init(void) | ||
94 | { | ||
95 | int result; | ||
96 | if ((result = usb_register(&dibusb_mc_driver))) { | ||
97 | err("usb_register failed. Error number %d",result); | ||
98 | return result; | ||
99 | } | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static void __exit dibusb_mc_module_exit(void) | ||
105 | { | ||
106 | /* deregister this driver from the USB subsystem */ | ||
107 | usb_deregister(&dibusb_mc_driver); | ||
108 | } | ||
109 | |||
110 | module_init (dibusb_mc_module_init); | ||
111 | module_exit (dibusb_mc_module_exit); | ||
112 | |||
113 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | ||
114 | MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices"); | ||
115 | MODULE_VERSION("1.0"); | ||
116 | MODULE_LICENSE("GPL"); | ||