aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dibusb-mb.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-09-30 05:53:48 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-03 14:10:54 -0400
commit4d43e13f723e12734257277cc38497fab1efc605 (patch)
tree7debc4f9b7997f7d768dcf387210436b532198f4 /drivers/media/dvb/dvb-usb/dibusb-mb.c
parent8ccb3dcd1f8e80e8702642e1de26541b52f6bb7c (diff)
V4L/DVB (4643): Multi-input patch for DVB-USB device
This patch is the first commit of the Multiple Input Patch for the DVB-USB frame work. It changes the DVB-USB-device to be able to have more than one streaming input (e.g. multiple DVB-T sources) on one device. This is a necessary feature for the upcoming DiB7700 driven devices. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dibusb-mb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mb.c198
1 files changed, 112 insertions, 86 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c
index effd34cc4b02..4fe363e48352 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -14,35 +14,35 @@
14 */ 14 */
15#include "dibusb.h" 15#include "dibusb.h"
16 16
17static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d) 17static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_adapter *adap)
18{ 18{
19 struct dib3000_config demod_cfg; 19 struct dib3000_config demod_cfg;
20 struct dibusb_state *st = d->priv; 20 struct dibusb_state *st = adap->priv;
21 21
22 demod_cfg.demod_address = 0x8; 22 demod_cfg.demod_address = 0x8;
23 23
24 if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) 24 if ((adap->fe = dib3000mb_attach(&demod_cfg,&adap->dev->i2c_adap,&st->ops)) == NULL)
25 return -ENODEV; 25 return -ENODEV;
26 26
27 d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; 27 adap->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
28 d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; 28 adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
29 29
30 d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; 30 adap->tuner_pass_ctrl = st->ops.tuner_pass_ctrl;
31 31
32 return 0; 32 return 0;
33} 33}
34 34
35static int dibusb_thomson_tuner_attach(struct dvb_usb_device *d) 35static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap)
36{ 36{
37 d->pll_addr = 0x61; 37 adap->pll_addr = 0x61;
38 d->pll_desc = &dvb_pll_tua6010xs; 38 adap->pll_desc = &dvb_pll_tua6010xs;
39 return 0; 39 return 0;
40} 40}
41 41
42/* Some of the Artec 1.1 device aren't equipped with the default tuner 42/* Some of the Artec 1.1 device aren't equipped with the default tuner
43 * (Thomson Cable), but with a Panasonic ENV77H11D5. This function figures 43 * (Thomson Cable), but with a Panasonic ENV77H11D5. This function figures
44 * this out. */ 44 * this out. */
45static int dibusb_tuner_probe_and_attach(struct dvb_usb_device *d) 45static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
46{ 46{
47 u8 b[2] = { 0,0 }, b2[1]; 47 u8 b[2] = { 0,0 }, b2[1];
48 int ret = 0; 48 int ret = 0;
@@ -54,36 +54,36 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_device *d)
54 /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */ 54 /* the Panasonic sits on I2C addrass 0x60, the Thomson on 0x61 */
55 msg[0].addr = msg[1].addr = 0x60; 55 msg[0].addr = msg[1].addr = 0x60;
56 56
57 if (d->tuner_pass_ctrl) 57 if (adap->tuner_pass_ctrl)
58 d->tuner_pass_ctrl(d->fe,1,msg[0].addr); 58 adap->tuner_pass_ctrl(adap->fe,1,msg[0].addr);
59 59
60 if (i2c_transfer (&d->i2c_adap, msg, 2) != 2) { 60 if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
61 err("tuner i2c write failed."); 61 err("tuner i2c write failed.");
62 ret = -EREMOTEIO; 62 ret = -EREMOTEIO;
63 } 63 }
64 64
65 if (d->tuner_pass_ctrl) 65 if (adap->tuner_pass_ctrl)
66 d->tuner_pass_ctrl(d->fe,0,msg[0].addr); 66 adap->tuner_pass_ctrl(adap->fe,0,msg[0].addr);
67 67
68 if (b2[0] == 0xfe) { 68 if (b2[0] == 0xfe) {
69 info("This device has the Thomson Cable onboard. Which is default."); 69 info("This device has the Thomson Cable onboard. Which is default.");
70 dibusb_thomson_tuner_attach(d); 70 dibusb_thomson_tuner_attach(adap);
71 } else { 71 } else {
72 u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab }; 72 u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab };
73 info("This device has the Panasonic ENV77H11D5 onboard."); 73 info("This device has the Panasonic ENV77H11D5 onboard.");
74 d->pll_addr = 0x60; 74 adap->pll_addr = 0x60;
75 memcpy(d->pll_init,bpll,4); 75 memcpy(adap->pll_init,bpll,4);
76 d->pll_desc = &dvb_pll_tda665x; 76 adap->pll_desc = &dvb_pll_tda665x;
77 } 77 }
78 78
79 return ret; 79 return ret;
80} 80}
81 81
82/* USB Driver stuff */ 82/* USB Driver stuff */
83static struct dvb_usb_properties dibusb1_1_properties; 83static struct dvb_usb_device_properties dibusb1_1_properties;
84static struct dvb_usb_properties dibusb1_1_an2235_properties; 84static struct dvb_usb_device_properties dibusb1_1_an2235_properties;
85static struct dvb_usb_properties dibusb2_0b_properties; 85static struct dvb_usb_device_properties dibusb2_0b_properties;
86static struct dvb_usb_properties artec_t1_usb2_properties; 86static struct dvb_usb_device_properties artec_t1_usb2_properties;
87 87
88static int dibusb_probe(struct usb_interface *intf, 88static int dibusb_probe(struct usb_interface *intf,
89 const struct usb_device_id *id) 89 const struct usb_device_id *id)
@@ -150,34 +150,28 @@ static struct usb_device_id dibusb_dib3000mb_table [] = {
150}; 150};
151MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table); 151MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table);
152 152
153static struct dvb_usb_properties dibusb1_1_properties = { 153static struct dvb_usb_device_properties dibusb1_1_properties = {
154 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, 154 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
155 .pid_filter_count = 16,
156 155
157 .usb_ctrl = CYPRESS_AN2135, 156 .usb_ctrl = CYPRESS_AN2135,
158 157
159 .firmware = "dvb-usb-dibusb-5.0.0.11.fw", 158 .firmware = "dvb-usb-dibusb-5.0.0.11.fw",
160 159
161 .size_of_priv = sizeof(struct dibusb_state), 160 .num_adapters = 1,
161 .adapter = {
162 {
163 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
164 .pid_filter_count = 16,
162 165
163 .streaming_ctrl = dibusb_streaming_ctrl, 166 .streaming_ctrl = dibusb_streaming_ctrl,
164 .pid_filter = dibusb_pid_filter, 167 .pid_filter = dibusb_pid_filter,
165 .pid_filter_ctrl = dibusb_pid_filter_ctrl, 168 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
166 .power_ctrl = dibusb_power_ctrl,
167 .frontend_attach = dibusb_dib3000mb_frontend_attach, 169 .frontend_attach = dibusb_dib3000mb_frontend_attach,
168 .tuner_attach = dibusb_tuner_probe_and_attach, 170 .tuner_attach = dibusb_tuner_probe_and_attach,
169 171
170 .rc_interval = DEFAULT_RC_INTERVAL,
171 .rc_key_map = dibusb_rc_keys,
172 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
173 .rc_query = dibusb_rc_query,
174
175 .i2c_algo = &dibusb_i2c_algo,
176
177 .generic_bulk_ctrl_endpoint = 0x01,
178 /* parameter for the MPEG2-data transfer */ 172 /* parameter for the MPEG2-data transfer */
179 .urb = { 173 .stream = {
180 .type = DVB_USB_BULK, 174 .type = USB_BULK,
181 .count = 7, 175 .count = 7,
182 .endpoint = 0x02, 176 .endpoint = 0x02,
183 .u = { 177 .u = {
@@ -186,6 +180,20 @@ static struct dvb_usb_properties dibusb1_1_properties = {
186 } 180 }
187 } 181 }
188 }, 182 },
183 .size_of_priv = sizeof(struct dibusb_state),
184 }
185 },
186
187 .power_ctrl = dibusb_power_ctrl,
188
189 .rc_interval = DEFAULT_RC_INTERVAL,
190 .rc_key_map = dibusb_rc_keys,
191 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
192 .rc_query = dibusb_rc_query,
193
194 .i2c_algo = &dibusb_i2c_algo,
195
196 .generic_bulk_ctrl_endpoint = 0x01,
189 197
190 .num_device_descs = 9, 198 .num_device_descs = 9,
191 .devices = { 199 .devices = {
@@ -228,34 +236,27 @@ static struct dvb_usb_properties dibusb1_1_properties = {
228 } 236 }
229}; 237};
230 238
231static struct dvb_usb_properties dibusb1_1_an2235_properties = { 239static struct dvb_usb_device_properties dibusb1_1_an2235_properties = {
232 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, 240 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
233 .pid_filter_count = 16,
234
235 .usb_ctrl = CYPRESS_AN2235, 241 .usb_ctrl = CYPRESS_AN2235,
236 242
237 .firmware = "dvb-usb-dibusb-an2235-01.fw", 243 .firmware = "dvb-usb-dibusb-an2235-01.fw",
238 244
239 .size_of_priv = sizeof(struct dibusb_state), 245 .num_adapters = 1,
246 .adapter = {
247 {
248 .caps = DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_ADAP_HAS_PID_FILTER,
249 .pid_filter_count = 16,
240 250
241 .streaming_ctrl = dibusb_streaming_ctrl, 251 .streaming_ctrl = dibusb_streaming_ctrl,
242 .pid_filter = dibusb_pid_filter, 252 .pid_filter = dibusb_pid_filter,
243 .pid_filter_ctrl = dibusb_pid_filter_ctrl, 253 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
244 .power_ctrl = dibusb_power_ctrl,
245 .frontend_attach = dibusb_dib3000mb_frontend_attach, 254 .frontend_attach = dibusb_dib3000mb_frontend_attach,
246 .tuner_attach = dibusb_tuner_probe_and_attach, 255 .tuner_attach = dibusb_tuner_probe_and_attach,
247 256
248 .rc_interval = DEFAULT_RC_INTERVAL,
249 .rc_key_map = dibusb_rc_keys,
250 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
251 .rc_query = dibusb_rc_query,
252
253 .i2c_algo = &dibusb_i2c_algo,
254
255 .generic_bulk_ctrl_endpoint = 0x01,
256 /* parameter for the MPEG2-data transfer */ 257 /* parameter for the MPEG2-data transfer */
257 .urb = { 258 .stream = {
258 .type = DVB_USB_BULK, 259 .type = USB_BULK,
259 .count = 7, 260 .count = 7,
260 .endpoint = 0x02, 261 .endpoint = 0x02,
261 .u = { 262 .u = {
@@ -264,6 +265,19 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = {
264 } 265 }
265 } 266 }
266 }, 267 },
268 .size_of_priv = sizeof(struct dibusb_state),
269 },
270 },
271 .power_ctrl = dibusb_power_ctrl,
272
273 .rc_interval = DEFAULT_RC_INTERVAL,
274 .rc_key_map = dibusb_rc_keys,
275 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
276 .rc_query = dibusb_rc_query,
277
278 .i2c_algo = &dibusb_i2c_algo,
279
280 .generic_bulk_ctrl_endpoint = 0x01,
267 281
268#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY 282#ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY
269 .num_device_descs = 2, 283 .num_device_descs = 2,
@@ -285,34 +299,27 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = {
285 } 299 }
286}; 300};
287 301
288static struct dvb_usb_properties dibusb2_0b_properties = { 302static struct dvb_usb_device_properties dibusb2_0b_properties = {
289 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, 303 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
290 .pid_filter_count = 16,
291 304
292 .usb_ctrl = CYPRESS_FX2, 305 .usb_ctrl = CYPRESS_FX2,
293 306
294 .firmware = "dvb-usb-adstech-usb2-02.fw", 307 .firmware = "dvb-usb-adstech-usb2-02.fw",
295 308
296 .size_of_priv = sizeof(struct dibusb_state), 309 .num_adapters = 1,
310 .adapter = {
311 {
312 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
313 .pid_filter_count = 16,
297 314
298 .streaming_ctrl = dibusb2_0_streaming_ctrl, 315 .streaming_ctrl = dibusb2_0_streaming_ctrl,
299 .pid_filter = dibusb_pid_filter, 316 .pid_filter = dibusb_pid_filter,
300 .pid_filter_ctrl = dibusb_pid_filter_ctrl, 317 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
301 .power_ctrl = dibusb2_0_power_ctrl,
302 .frontend_attach = dibusb_dib3000mb_frontend_attach, 318 .frontend_attach = dibusb_dib3000mb_frontend_attach,
303 .tuner_attach = dibusb_thomson_tuner_attach, 319 .tuner_attach = dibusb_thomson_tuner_attach,
304
305 .rc_interval = DEFAULT_RC_INTERVAL,
306 .rc_key_map = dibusb_rc_keys,
307 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
308 .rc_query = dibusb_rc_query,
309
310 .i2c_algo = &dibusb_i2c_algo,
311
312 .generic_bulk_ctrl_endpoint = 0x01,
313 /* parameter for the MPEG2-data transfer */ 320 /* parameter for the MPEG2-data transfer */
314 .urb = { 321 .stream = {
315 .type = DVB_USB_BULK, 322 .type = USB_BULK,
316 .count = 7, 323 .count = 7,
317 .endpoint = 0x06, 324 .endpoint = 0x06,
318 .u = { 325 .u = {
@@ -321,6 +328,19 @@ static struct dvb_usb_properties dibusb2_0b_properties = {
321 } 328 }
322 } 329 }
323 }, 330 },
331 .size_of_priv = sizeof(struct dibusb_state),
332 }
333 },
334 .power_ctrl = dibusb2_0_power_ctrl,
335
336 .rc_interval = DEFAULT_RC_INTERVAL,
337 .rc_key_map = dibusb_rc_keys,
338 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
339 .rc_query = dibusb_rc_query,
340
341 .i2c_algo = &dibusb_i2c_algo,
342
343 .generic_bulk_ctrl_endpoint = 0x01,
324 344
325 .num_device_descs = 2, 345 .num_device_descs = 2,
326 .devices = { 346 .devices = {
@@ -336,34 +356,27 @@ static struct dvb_usb_properties dibusb2_0b_properties = {
336 } 356 }
337}; 357};
338 358
339static struct dvb_usb_properties artec_t1_usb2_properties = { 359static struct dvb_usb_device_properties artec_t1_usb2_properties = {
340 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, 360 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
341 .pid_filter_count = 16,
342 361
343 .usb_ctrl = CYPRESS_FX2, 362 .usb_ctrl = CYPRESS_FX2,
344 363
345 .firmware = "dvb-usb-dibusb-6.0.0.8.fw", 364 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
346 365
347 .size_of_priv = sizeof(struct dibusb_state), 366 .num_adapters = 1,
367 .adapter = {
368 {
369 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
370 .pid_filter_count = 16,
348 371
349 .streaming_ctrl = dibusb2_0_streaming_ctrl, 372 .streaming_ctrl = dibusb2_0_streaming_ctrl,
350 .pid_filter = dibusb_pid_filter, 373 .pid_filter = dibusb_pid_filter,
351 .pid_filter_ctrl = dibusb_pid_filter_ctrl, 374 .pid_filter_ctrl = dibusb_pid_filter_ctrl,
352 .power_ctrl = dibusb2_0_power_ctrl,
353 .frontend_attach = dibusb_dib3000mb_frontend_attach, 375 .frontend_attach = dibusb_dib3000mb_frontend_attach,
354 .tuner_attach = dibusb_tuner_probe_and_attach, 376 .tuner_attach = dibusb_tuner_probe_and_attach,
355
356 .rc_interval = DEFAULT_RC_INTERVAL,
357 .rc_key_map = dibusb_rc_keys,
358 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
359 .rc_query = dibusb_rc_query,
360
361 .i2c_algo = &dibusb_i2c_algo,
362
363 .generic_bulk_ctrl_endpoint = 0x01,
364 /* parameter for the MPEG2-data transfer */ 377 /* parameter for the MPEG2-data transfer */
365 .urb = { 378 .stream = {
366 .type = DVB_USB_BULK, 379 .type = USB_BULK,
367 .count = 7, 380 .count = 7,
368 .endpoint = 0x06, 381 .endpoint = 0x06,
369 .u = { 382 .u = {
@@ -372,6 +385,19 @@ static struct dvb_usb_properties artec_t1_usb2_properties = {
372 } 385 }
373 } 386 }
374 }, 387 },
388 .size_of_priv = sizeof(struct dibusb_state),
389 }
390 },
391 .power_ctrl = dibusb2_0_power_ctrl,
392
393 .rc_interval = DEFAULT_RC_INTERVAL,
394 .rc_key_map = dibusb_rc_keys,
395 .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */
396 .rc_query = dibusb_rc_query,
397
398 .i2c_algo = &dibusb_i2c_algo,
399
400 .generic_bulk_ctrl_endpoint = 0x01,
375 401
376 .num_device_descs = 1, 402 .num_device_descs = 1,
377 .devices = { 403 .devices = {