1 /* DVB USB compliant linux driver for MSI Mega Sky 580 DVB-T USB2.0 receiver
3 * Copyright (C) 2006 Aapo Tahkola (aet@rasterburn.org)
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation, version 2.
9 * see Documentation/dvb/README.dvb-usb for more information
15 #include "mt352_priv.h"
20 #include <media/tuner.h>
21 #include "tuner-simple.h"
22 #include <asm/unaligned.h>
25 static int dvb_usb_m920x_debug
;
26 module_param_named(debug
,dvb_usb_m920x_debug
, int, 0644);
27 MODULE_PARM_DESC(debug
, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS
);
29 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
);
31 static int m920x_set_filter(struct dvb_usb_device
*d
, int type
, int idx
, int pid
);
33 static inline int m920x_read(struct usb_device
*udev
, u8 request
, u16 value
,
34 u16 index
, void *data
, int size
)
38 ret
= usb_control_msg(udev
, usb_rcvctrlpipe(udev
, 0),
39 request
, USB_TYPE_VENDOR
| USB_DIR_IN
,
40 value
, index
, data
, size
, 2000);
42 printk(KERN_INFO
"m920x_read = error: %d\n", ret
);
47 deb("m920x_read = no data\n");
54 static inline int m920x_write(struct usb_device
*udev
, u8 request
,
59 ret
= usb_control_msg(udev
, usb_sndctrlpipe(udev
, 0),
60 request
, USB_TYPE_VENDOR
| USB_DIR_OUT
,
61 value
, index
, NULL
, 0, 2000);
66 static int m920x_init(struct dvb_usb_device
*d
, struct m920x_inits
*rc_seq
)
68 int ret
= 0, i
, epi
, flags
= 0;
69 int adap_enabled
[M9206_MAX_ADAPTERS
] = { 0 };
71 /* Remote controller init. */
72 if (d
->props
.rc
.legacy
.rc_query
) {
73 deb("Initialising remote control\n");
74 while (rc_seq
->address
) {
75 if ((ret
= m920x_write(d
->udev
, M9206_CORE
,
77 rc_seq
->address
)) != 0) {
78 deb("Initialising remote control failed\n");
85 deb("Initialising remote control success\n");
88 for (i
= 0; i
< d
->props
.num_adapters
; i
++)
89 flags
|= d
->adapter
[i
].props
.caps
;
91 /* Some devices(Dposh) might crash if we attempt touch at all. */
92 if (flags
& DVB_USB_ADAP_HAS_PID_FILTER
) {
93 for (i
= 0; i
< d
->props
.num_adapters
; i
++) {
94 epi
= d
->adapter
[i
].props
.stream
.endpoint
- 0x81;
96 if (epi
< 0 || epi
>= M9206_MAX_ADAPTERS
) {
97 printk(KERN_INFO
"m920x: Unexpected adapter endpoint!\n");
101 adap_enabled
[epi
] = 1;
104 for (i
= 0; i
< M9206_MAX_ADAPTERS
; i
++) {
108 if ((ret
= m920x_set_filter(d
, 0x81 + i
, 0, 0x0)) != 0)
111 if ((ret
= m920x_set_filter(d
, 0x81 + i
, 0, 0x02f5)) != 0)
119 static int m920x_init_ep(struct usb_interface
*intf
)
121 struct usb_device
*udev
= interface_to_usbdev(intf
);
122 struct usb_host_interface
*alt
;
124 if ((alt
= usb_altnum_to_altsetting(intf
, 1)) == NULL
) {
125 deb("No alt found!\n");
129 return usb_set_interface(udev
, alt
->desc
.bInterfaceNumber
,
130 alt
->desc
.bAlternateSetting
);
133 static int m920x_rc_query(struct dvb_usb_device
*d
, u32
*event
, int *state
)
135 struct m920x_state
*m
= d
->priv
;
139 if ((ret
= m920x_read(d
->udev
, M9206_CORE
, 0x0, M9206_RC_STATE
, rc_state
, 1)) != 0)
142 if ((ret
= m920x_read(d
->udev
, M9206_CORE
, 0x0, M9206_RC_KEY
, rc_state
+ 1, 1)) != 0)
145 for (i
= 0; i
< d
->props
.rc
.legacy
.rc_map_size
; i
++)
146 if (rc5_data(&d
->props
.rc
.legacy
.rc_map_table
[i
]) == rc_state
[1]) {
147 *event
= d
->props
.rc
.legacy
.rc_map_table
[i
].keycode
;
149 switch(rc_state
[0]) {
151 *state
= REMOTE_NO_KEY_PRESSED
;
154 case 0x88: /* framing error or "invalid code" */
158 *state
= REMOTE_NO_KEY_PRESSED
;
164 case 0x83: /* pinnacle PCTV310e */
167 *state
= REMOTE_KEY_PRESSED
;
171 case 0x81: /* pinnacle PCTV310e */
172 /* prevent immediate auto-repeat */
173 if (++m
->rep_count
> 2)
174 *state
= REMOTE_KEY_REPEAT
;
176 *state
= REMOTE_NO_KEY_PRESSED
;
180 deb("Unexpected rc state %02x\n", rc_state
[0]);
181 *state
= REMOTE_NO_KEY_PRESSED
;
186 if (rc_state
[1] != 0)
187 deb("Unknown rc key %02x\n", rc_state
[1]);
189 *state
= REMOTE_NO_KEY_PRESSED
;
197 static int m920x_i2c_xfer(struct i2c_adapter
*adap
, struct i2c_msg msg
[], int num
)
199 struct dvb_usb_device
*d
= i2c_get_adapdata(adap
);
206 if (mutex_lock_interruptible(&d
->i2c_mutex
) < 0)
209 for (i
= 0; i
< num
; i
++) {
210 if (msg
[i
].flags
& (I2C_M_NO_RD_ACK
| I2C_M_IGNORE_NAK
| I2C_M_TEN
) || msg
[i
].len
== 0) {
211 /* For a 0 byte message, I think sending the address
212 * to index 0x80|0x40 would be the correct thing to
213 * do. However, zero byte messages are only used for
214 * probing, and since we don't know how to get the
215 * slave's ack, we can't probe. */
219 /* Send START & address/RW bit */
220 if (!(msg
[i
].flags
& I2C_M_NOSTART
)) {
221 if ((ret
= m920x_write(d
->udev
, M9206_I2C
,
223 (msg
[i
].flags
& I2C_M_RD
? 0x01 : 0), 0x80)) != 0)
225 /* Should check for ack here, if we knew how. */
227 if (msg
[i
].flags
& I2C_M_RD
) {
228 for (j
= 0; j
< msg
[i
].len
; j
++) {
229 /* Last byte of transaction?
230 * Send STOP, otherwise send ACK. */
231 int stop
= (i
+1 == num
&& j
+1 == msg
[i
].len
) ? 0x40 : 0x01;
233 if ((ret
= m920x_read(d
->udev
, M9206_I2C
, 0x0,
235 &msg
[i
].buf
[j
], 1)) != 0)
239 for (j
= 0; j
< msg
[i
].len
; j
++) {
240 /* Last byte of transaction? Then send STOP. */
241 int stop
= (i
+1 == num
&& j
+1 == msg
[i
].len
) ? 0x40 : 0x00;
243 if ((ret
= m920x_write(d
->udev
, M9206_I2C
, msg
[i
].buf
[j
], stop
)) != 0)
245 /* Should check for ack here too. */
252 mutex_unlock(&d
->i2c_mutex
);
257 static u32
m920x_i2c_func(struct i2c_adapter
*adapter
)
262 static struct i2c_algorithm m920x_i2c_algo
= {
263 .master_xfer
= m920x_i2c_xfer
,
264 .functionality
= m920x_i2c_func
,
268 static int m920x_set_filter(struct dvb_usb_device
*d
, int type
, int idx
, int pid
)
277 if ((ret
= m920x_write(d
->udev
, M9206_FILTER
, pid
, (type
<< 8) | (idx
* 4) )) != 0)
280 if ((ret
= m920x_write(d
->udev
, M9206_FILTER
, 0, (type
<< 8) | (idx
* 4) )) != 0)
286 static int m920x_update_filters(struct dvb_usb_adapter
*adap
)
288 struct m920x_state
*m
= adap
->dev
->priv
;
289 int enabled
= m
->filtering_enabled
[adap
->id
];
290 int i
, ret
= 0, filter
= 0;
291 int ep
= adap
->props
.stream
.endpoint
;
293 for (i
= 0; i
< M9206_MAX_FILTERS
; i
++)
294 if (m
->filters
[adap
->id
][i
] == 8192)
297 /* Disable all filters */
298 if ((ret
= m920x_set_filter(adap
->dev
, ep
, 1, enabled
)) != 0)
301 for (i
= 0; i
< M9206_MAX_FILTERS
; i
++)
302 if ((ret
= m920x_set_filter(adap
->dev
, ep
, i
+ 2, 0)) != 0)
307 for (i
= 0; i
< M9206_MAX_FILTERS
; i
++) {
308 if (m
->filters
[adap
->id
][i
] == 0)
311 if ((ret
= m920x_set_filter(adap
->dev
, ep
, filter
+ 2, m
->filters
[adap
->id
][i
])) != 0)
321 static int m920x_pid_filter_ctrl(struct dvb_usb_adapter
*adap
, int onoff
)
323 struct m920x_state
*m
= adap
->dev
->priv
;
325 m
->filtering_enabled
[adap
->id
] = onoff
? 1 : 0;
327 return m920x_update_filters(adap
);
330 static int m920x_pid_filter(struct dvb_usb_adapter
*adap
, int index
, u16 pid
, int onoff
)
332 struct m920x_state
*m
= adap
->dev
->priv
;
334 m
->filters
[adap
->id
][index
] = onoff
? pid
: 0;
336 return m920x_update_filters(adap
);
339 static int m920x_firmware_download(struct usb_device
*udev
, const struct firmware
*fw
)
341 u16 value
, index
, size
;
343 int i
, pass
, ret
= 0;
345 buff
= kmalloc(65536, GFP_KERNEL
);
349 if ((ret
= m920x_read(udev
, M9206_FILTER
, 0x0, 0x8000, read
, 4)) != 0)
351 deb("%x %x %x %x\n", read
[0], read
[1], read
[2], read
[3]);
353 if ((ret
= m920x_read(udev
, M9206_FW
, 0x0, 0x0, read
, 1)) != 0)
355 deb("%x\n", read
[0]);
357 for (pass
= 0; pass
< 2; pass
++) {
358 for (i
= 0; i
+ (sizeof(u16
) * 3) < fw
->size
;) {
359 value
= get_unaligned_le16(fw
->data
+ i
);
362 index
= get_unaligned_le16(fw
->data
+ i
);
365 size
= get_unaligned_le16(fw
->data
+ i
);
369 /* Will stall if using fw->data ... */
370 memcpy(buff
, fw
->data
+ i
, size
);
372 ret
= usb_control_msg(udev
, usb_sndctrlpipe(udev
,0),
374 USB_TYPE_VENDOR
| USB_DIR_OUT
,
375 value
, index
, buff
, size
, 20);
377 deb("error while uploading fw!\n");
386 deb("bad firmware file!\n");
394 /* m920x will disconnect itself from the bus after this. */
395 (void) m920x_write(udev
, M9206_CORE
, 0x01, M9206_FW_GO
);
396 deb("firmware uploaded!\n");
404 /* Callbacks for DVB USB */
405 static int m920x_identify_state(struct usb_device
*udev
,
406 struct dvb_usb_device_properties
*props
,
407 struct dvb_usb_device_description
**desc
,
410 struct usb_host_interface
*alt
;
412 alt
= usb_altnum_to_altsetting(usb_ifnum_to_if(udev
, 0), 1);
413 *cold
= (alt
== NULL
) ? 1 : 0;
418 /* demod configurations */
419 static int m920x_mt352_demod_init(struct dvb_frontend
*fe
)
422 u8 config
[] = { CONFIG
, 0x3d };
423 u8 clock
[] = { CLOCK_CTL
, 0x30 };
424 u8 reset
[] = { RESET
, 0x80 };
425 u8 adc_ctl
[] = { ADC_CTL_1
, 0x40 };
426 u8 agc
[] = { AGC_TARGET
, 0x1c, 0x20 };
427 u8 sec_agc
[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
428 u8 unk1
[] = { 0x93, 0x1a };
429 u8 unk2
[] = { 0xb5, 0x7a };
431 deb("Demod init!\n");
433 if ((ret
= mt352_write(fe
, config
, ARRAY_SIZE(config
))) != 0)
435 if ((ret
= mt352_write(fe
, clock
, ARRAY_SIZE(clock
))) != 0)
437 if ((ret
= mt352_write(fe
, reset
, ARRAY_SIZE(reset
))) != 0)
439 if ((ret
= mt352_write(fe
, adc_ctl
, ARRAY_SIZE(adc_ctl
))) != 0)
441 if ((ret
= mt352_write(fe
, agc
, ARRAY_SIZE(agc
))) != 0)
443 if ((ret
= mt352_write(fe
, sec_agc
, ARRAY_SIZE(sec_agc
))) != 0)
445 if ((ret
= mt352_write(fe
, unk1
, ARRAY_SIZE(unk1
))) != 0)
447 if ((ret
= mt352_write(fe
, unk2
, ARRAY_SIZE(unk2
))) != 0)
453 static struct mt352_config m920x_mt352_config
= {
454 .demod_address
= 0x0f,
456 .demod_init
= m920x_mt352_demod_init
,
459 static struct tda1004x_config m920x_tda10046_08_config
= {
460 .demod_address
= 0x08,
463 .ts_mode
= TDA10046_TS_SERIAL
,
464 .xtal_freq
= TDA10046_XTAL_16M
,
465 .if_freq
= TDA10046_FREQ_045
,
466 .agc_config
= TDA10046_AGC_TDA827X
,
467 .gpio_config
= TDA10046_GPTRI
,
468 .request_firmware
= NULL
,
471 static struct tda1004x_config m920x_tda10046_0b_config
= {
472 .demod_address
= 0x0b,
475 .ts_mode
= TDA10046_TS_SERIAL
,
476 .xtal_freq
= TDA10046_XTAL_16M
,
477 .if_freq
= TDA10046_FREQ_045
,
478 .agc_config
= TDA10046_AGC_TDA827X
,
479 .gpio_config
= TDA10046_GPTRI
,
480 .request_firmware
= NULL
, /* uses firmware EEPROM */
483 /* tuner configurations */
484 static struct qt1010_config m920x_qt1010_config
= {
488 /* Callbacks for DVB USB */
489 static int m920x_mt352_frontend_attach(struct dvb_usb_adapter
*adap
)
491 deb("%s\n",__func__
);
493 if ((adap
->fe
= dvb_attach(mt352_attach
,
495 &adap
->dev
->i2c_adap
)) == NULL
)
501 static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter
*adap
)
503 deb("%s\n",__func__
);
505 if ((adap
->fe
= dvb_attach(tda10046_attach
,
506 &m920x_tda10046_08_config
,
507 &adap
->dev
->i2c_adap
)) == NULL
)
513 static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter
*adap
)
515 deb("%s\n",__func__
);
517 if ((adap
->fe
= dvb_attach(tda10046_attach
,
518 &m920x_tda10046_0b_config
,
519 &adap
->dev
->i2c_adap
)) == NULL
)
525 static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter
*adap
)
527 deb("%s\n",__func__
);
529 if (dvb_attach(qt1010_attach
, adap
->fe
, &adap
->dev
->i2c_adap
, &m920x_qt1010_config
) == NULL
)
535 static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter
*adap
)
537 deb("%s\n",__func__
);
539 if (dvb_attach(tda827x_attach
, adap
->fe
, 0x60, &adap
->dev
->i2c_adap
, NULL
) == NULL
)
545 static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter
*adap
)
547 deb("%s\n",__func__
);
549 if (dvb_attach(tda827x_attach
, adap
->fe
, 0x61, &adap
->dev
->i2c_adap
, NULL
) == NULL
)
555 static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter
*adap
)
557 dvb_attach(simple_tuner_attach
, adap
->fe
,
558 &adap
->dev
->i2c_adap
, 0x61,
559 TUNER_PHILIPS_FMD1216ME_MK3
);
563 /* device-specific initialization */
564 static struct m920x_inits megasky_rc_init
[] = {
565 { M9206_RC_INIT2
, 0xa8 },
566 { M9206_RC_INIT1
, 0x51 },
567 { } /* terminating entry */
570 static struct m920x_inits tvwalkertwin_rc_init
[] = {
571 { M9206_RC_INIT2
, 0x00 },
572 { M9206_RC_INIT1
, 0xef },
576 { } /* terminating entry */
579 static struct m920x_inits pinnacle310e_init
[] = {
580 /* without these the tuner don't work */
586 { M9206_RC_INIT1
, 0x00 },
587 { M9206_RC_INIT2
, 0xff },
588 { } /* terminating entry */
592 static struct rc_map_table rc_map_megasky_table
[] = {
593 { 0x0012, KEY_POWER
},
594 { 0x001e, KEY_CYCLEWINDOWS
}, /* min/max */
595 { 0x0002, KEY_CHANNELUP
},
596 { 0x0005, KEY_CHANNELDOWN
},
597 { 0x0003, KEY_VOLUMEUP
},
598 { 0x0006, KEY_VOLUMEDOWN
},
599 { 0x0004, KEY_MUTE
},
600 { 0x0007, KEY_OK
}, /* TS */
601 { 0x0008, KEY_STOP
},
602 { 0x0009, KEY_MENU
}, /* swap */
603 { 0x000a, KEY_REWIND
},
604 { 0x001b, KEY_PAUSE
},
605 { 0x001f, KEY_FASTFORWARD
},
606 { 0x000c, KEY_RECORD
},
607 { 0x000d, KEY_CAMERA
}, /* screenshot */
608 { 0x000e, KEY_COFFEE
}, /* "MTS" */
611 static struct rc_map_table rc_map_tvwalkertwin_table
[] = {
612 { 0x0001, KEY_ZOOM
}, /* Full Screen */
613 { 0x0002, KEY_CAMERA
}, /* snapshot */
614 { 0x0003, KEY_MUTE
},
615 { 0x0004, KEY_REWIND
},
616 { 0x0005, KEY_PLAYPAUSE
}, /* Play/Pause */
617 { 0x0006, KEY_FASTFORWARD
},
618 { 0x0007, KEY_RECORD
},
619 { 0x0008, KEY_STOP
},
620 { 0x0009, KEY_TIME
}, /* Timeshift */
621 { 0x000c, KEY_COFFEE
}, /* Recall */
622 { 0x000e, KEY_CHANNELUP
},
623 { 0x0012, KEY_POWER
},
624 { 0x0015, KEY_MENU
}, /* source */
625 { 0x0018, KEY_CYCLEWINDOWS
}, /* TWIN PIP */
626 { 0x001a, KEY_CHANNELDOWN
},
627 { 0x001b, KEY_VOLUMEDOWN
},
628 { 0x001e, KEY_VOLUMEUP
},
631 static struct rc_map_table rc_map_pinnacle310e_table
[] = {
633 { 0x17, KEY_FAVORITES
},
635 { 0x48, KEY_MEDIA
}, /* preview */
637 { 0x04, KEY_LIST
}, /* record list */
648 { 0x0c, KEY_CANCEL
},
656 { 0x4f, KEY_ENTER
}, /* could also be KEY_OK */
657 { 0x1e, KEY_VOLUMEUP
},
658 { 0x0a, KEY_VOLUMEDOWN
},
659 { 0x05, KEY_CHANNELUP
},
660 { 0x02, KEY_CHANNELDOWN
},
661 { 0x11, KEY_RECORD
},
665 { 0x40, KEY_REWIND
},
666 { 0x12, KEY_FASTFORWARD
},
667 { 0x41, KEY_PREVIOUSSONG
}, /* Replay */
668 { 0x42, KEY_NEXTSONG
}, /* Skip */
669 { 0x54, KEY_CAMERA
}, /* Capture */
670 /* { 0x50, KEY_SAP }, */ /* Sap */
671 { 0x47, KEY_CYCLEWINDOWS
}, /* Pip */
672 { 0x4d, KEY_SCREEN
}, /* FullScreen */
673 { 0x08, KEY_SUBTITLE
},
675 /* { 0x49, KEY_LR }, */ /* L/R */
676 { 0x07, KEY_SLEEP
}, /* Hibernate */
677 { 0x08, KEY_MEDIA
}, /* A/V */
678 { 0x0e, KEY_MENU
}, /* Recall */
679 { 0x45, KEY_ZOOMIN
},
680 { 0x46, KEY_ZOOMOUT
},
681 { 0x18, KEY_TV
}, /* Red */
682 { 0x53, KEY_VCR
}, /* Green */
683 { 0x5e, KEY_SAT
}, /* Yellow */
684 { 0x5f, KEY_PLAYER
}, /* Blue */
687 /* DVB USB Driver stuff */
688 static struct dvb_usb_device_properties megasky_properties
;
689 static struct dvb_usb_device_properties digivox_mini_ii_properties
;
690 static struct dvb_usb_device_properties tvwalkertwin_properties
;
691 static struct dvb_usb_device_properties dposh_properties
;
692 static struct dvb_usb_device_properties pinnacle_pctv310e_properties
;
694 static int m920x_probe(struct usb_interface
*intf
,
695 const struct usb_device_id
*id
)
697 struct dvb_usb_device
*d
= NULL
;
699 struct m920x_inits
*rc_init_seq
= NULL
;
700 int bInterfaceNumber
= intf
->cur_altsetting
->desc
.bInterfaceNumber
;
702 deb("Probing for m920x device at interface %d\n", bInterfaceNumber
);
704 if (bInterfaceNumber
== 0) {
705 /* Single-tuner device, or first interface on
709 ret
= dvb_usb_device_init(intf
, &megasky_properties
,
710 THIS_MODULE
, &d
, adapter_nr
);
712 rc_init_seq
= megasky_rc_init
;
716 ret
= dvb_usb_device_init(intf
, &digivox_mini_ii_properties
,
717 THIS_MODULE
, &d
, adapter_nr
);
719 /* No remote control, so no rc_init_seq */
723 /* This configures both tuners on the TV Walker Twin */
724 ret
= dvb_usb_device_init(intf
, &tvwalkertwin_properties
,
725 THIS_MODULE
, &d
, adapter_nr
);
727 rc_init_seq
= tvwalkertwin_rc_init
;
731 ret
= dvb_usb_device_init(intf
, &dposh_properties
,
732 THIS_MODULE
, &d
, adapter_nr
);
734 /* Remote controller not supported yet. */
738 ret
= dvb_usb_device_init(intf
, &pinnacle_pctv310e_properties
,
739 THIS_MODULE
, &d
, adapter_nr
);
741 rc_init_seq
= pinnacle310e_init
;
747 /* Another interface on a multi-tuner device */
749 /* The LifeView TV Walker Twin gets here, but struct
750 * tvwalkertwin_properties already configured both
751 * tuners, so there is nothing for us to do here
756 if ((ret
= m920x_init_ep(intf
)) < 0)
759 if (d
&& (ret
= m920x_init(d
, rc_init_seq
)) != 0)
765 static struct usb_device_id m920x_table
[] = {
766 { USB_DEVICE(USB_VID_MSI
, USB_PID_MSI_MEGASKY580
) },
767 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC
,
768 USB_PID_MSI_DIGI_VOX_MINI_II
) },
769 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC
,
770 USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD
) },
771 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC
,
772 USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM
) },
773 { USB_DEVICE(USB_VID_DPOSH
, USB_PID_DPOSH_M9206_COLD
) },
774 { USB_DEVICE(USB_VID_DPOSH
, USB_PID_DPOSH_M9206_WARM
) },
775 { USB_DEVICE(USB_VID_VISIONPLUS
, USB_PID_PINNACLE_PCTV310E
) },
776 { } /* Terminating entry */
778 MODULE_DEVICE_TABLE (usb
, m920x_table
);
780 static struct dvb_usb_device_properties megasky_properties
= {
781 .caps
= DVB_USB_IS_AN_I2C_ADAPTER
,
783 .usb_ctrl
= DEVICE_SPECIFIC
,
784 .firmware
= "dvb-usb-megasky-02.fw",
785 .download_firmware
= m920x_firmware_download
,
789 .rc_map_table
= rc_map_megasky_table
,
790 .rc_map_size
= ARRAY_SIZE(rc_map_megasky_table
),
791 .rc_query
= m920x_rc_query
,
794 .size_of_priv
= sizeof(struct m920x_state
),
796 .identify_state
= m920x_identify_state
,
799 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
800 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
802 .pid_filter_count
= 8,
803 .pid_filter
= m920x_pid_filter
,
804 .pid_filter_ctrl
= m920x_pid_filter_ctrl
,
806 .frontend_attach
= m920x_mt352_frontend_attach
,
807 .tuner_attach
= m920x_qt1010_tuner_attach
,
820 .i2c_algo
= &m920x_i2c_algo
,
822 .num_device_descs
= 1,
824 { "MSI Mega Sky 580 DVB-T USB2.0",
825 { &m920x_table
[0], NULL
},
831 static struct dvb_usb_device_properties digivox_mini_ii_properties
= {
832 .caps
= DVB_USB_IS_AN_I2C_ADAPTER
,
834 .usb_ctrl
= DEVICE_SPECIFIC
,
835 .firmware
= "dvb-usb-digivox-02.fw",
836 .download_firmware
= m920x_firmware_download
,
838 .size_of_priv
= sizeof(struct m920x_state
),
840 .identify_state
= m920x_identify_state
,
843 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
844 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
846 .pid_filter_count
= 8,
847 .pid_filter
= m920x_pid_filter
,
848 .pid_filter_ctrl
= m920x_pid_filter_ctrl
,
850 .frontend_attach
= m920x_tda10046_08_frontend_attach
,
851 .tuner_attach
= m920x_tda8275_60_tuner_attach
,
859 .buffersize
= 0x4000,
864 .i2c_algo
= &m920x_i2c_algo
,
866 .num_device_descs
= 1,
868 { "MSI DIGI VOX mini II DVB-T USB2.0",
869 { &m920x_table
[1], NULL
},
875 /* LifeView TV Walker Twin support by Nick Andrew <nick@nick-andrew.net>
877 * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
878 * TDA10046 #0 is located at i2c address 0x08
879 * TDA10046 #1 is located at i2c address 0x0b
880 * TDA8275A #0 is located at i2c address 0x60
881 * TDA8275A #1 is located at i2c address 0x61
883 static struct dvb_usb_device_properties tvwalkertwin_properties
= {
884 .caps
= DVB_USB_IS_AN_I2C_ADAPTER
,
886 .usb_ctrl
= DEVICE_SPECIFIC
,
887 .firmware
= "dvb-usb-tvwalkert.fw",
888 .download_firmware
= m920x_firmware_download
,
892 .rc_map_table
= rc_map_tvwalkertwin_table
,
893 .rc_map_size
= ARRAY_SIZE(rc_map_tvwalkertwin_table
),
894 .rc_query
= m920x_rc_query
,
897 .size_of_priv
= sizeof(struct m920x_state
),
899 .identify_state
= m920x_identify_state
,
902 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
903 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
905 .pid_filter_count
= 8,
906 .pid_filter
= m920x_pid_filter
,
907 .pid_filter_ctrl
= m920x_pid_filter_ctrl
,
909 .frontend_attach
= m920x_tda10046_08_frontend_attach
,
910 .tuner_attach
= m920x_tda8275_60_tuner_attach
,
922 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
923 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
925 .pid_filter_count
= 8,
926 .pid_filter
= m920x_pid_filter
,
927 .pid_filter_ctrl
= m920x_pid_filter_ctrl
,
929 .frontend_attach
= m920x_tda10046_0b_frontend_attach
,
930 .tuner_attach
= m920x_tda8275_61_tuner_attach
,
943 .i2c_algo
= &m920x_i2c_algo
,
945 .num_device_descs
= 1,
947 { .name
= "LifeView TV Walker Twin DVB-T USB2.0",
948 .cold_ids
= { &m920x_table
[2], NULL
},
949 .warm_ids
= { &m920x_table
[3], NULL
},
954 static struct dvb_usb_device_properties dposh_properties
= {
955 .caps
= DVB_USB_IS_AN_I2C_ADAPTER
,
957 .usb_ctrl
= DEVICE_SPECIFIC
,
958 .firmware
= "dvb-usb-dposh-01.fw",
959 .download_firmware
= m920x_firmware_download
,
961 .size_of_priv
= sizeof(struct m920x_state
),
963 .identify_state
= m920x_identify_state
,
966 /* Hardware pid filters don't work with this device/firmware */
968 .frontend_attach
= m920x_mt352_frontend_attach
,
969 .tuner_attach
= m920x_qt1010_tuner_attach
,
982 .i2c_algo
= &m920x_i2c_algo
,
984 .num_device_descs
= 1,
986 { .name
= "Dposh DVB-T USB2.0",
987 .cold_ids
= { &m920x_table
[4], NULL
},
988 .warm_ids
= { &m920x_table
[5], NULL
},
993 static struct dvb_usb_device_properties pinnacle_pctv310e_properties
= {
994 .caps
= DVB_USB_IS_AN_I2C_ADAPTER
,
996 .usb_ctrl
= DEVICE_SPECIFIC
,
997 .download_firmware
= NULL
,
1001 .rc_map_table
= rc_map_pinnacle310e_table
,
1002 .rc_map_size
= ARRAY_SIZE(rc_map_pinnacle310e_table
),
1003 .rc_query
= m920x_rc_query
,
1006 .size_of_priv
= sizeof(struct m920x_state
),
1008 .identify_state
= m920x_identify_state
,
1011 .caps
= DVB_USB_ADAP_HAS_PID_FILTER
|
1012 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF
,
1014 .pid_filter_count
= 8,
1015 .pid_filter
= m920x_pid_filter
,
1016 .pid_filter_ctrl
= m920x_pid_filter_ctrl
,
1018 .frontend_attach
= m920x_mt352_frontend_attach
,
1019 .tuner_attach
= m920x_fmd1216me_tuner_attach
,
1027 .framesperurb
= 128,
1034 .i2c_algo
= &m920x_i2c_algo
,
1036 .num_device_descs
= 1,
1038 { "Pinnacle PCTV 310e",
1039 { &m920x_table
[6], NULL
},
1045 static struct usb_driver m920x_driver
= {
1046 .name
= "dvb_usb_m920x",
1047 .probe
= m920x_probe
,
1048 .disconnect
= dvb_usb_device_exit
,
1049 .id_table
= m920x_table
,
1053 static int __init
m920x_module_init(void)
1057 if ((ret
= usb_register(&m920x_driver
))) {
1058 err("usb_register failed. Error number %d", ret
);
1065 static void __exit
m920x_module_exit(void)
1067 /* deregister this driver from the USB subsystem */
1068 usb_deregister(&m920x_driver
);
1071 module_init (m920x_module_init
);
1072 module_exit (m920x_module_exit
);
1074 MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
1075 MODULE_DESCRIPTION("DVB Driver for ULI M920x");
1076 MODULE_VERSION("0.1");
1077 MODULE_LICENSE("GPL");