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 rc_state = kmalloc(2, GFP_KERNEL);
143 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, rc_state, 1)) != 0)
146 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0)
149 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++)
150 if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) {
151 *event = d->props.rc.legacy.rc_map_table[i].keycode;
153 switch(rc_state[0]) {
155 *state = REMOTE_NO_KEY_PRESSED;
158 case 0x88: /* framing error or "invalid code" */
162 *state = REMOTE_NO_KEY_PRESSED;
168 case 0x83: /* pinnacle PCTV310e */
171 *state = REMOTE_KEY_PRESSED;
175 case 0x81: /* pinnacle PCTV310e */
176 /* prevent immediate auto-repeat */
177 if (++m->rep_count > 2)
178 *state = REMOTE_KEY_REPEAT;
180 *state = REMOTE_NO_KEY_PRESSED;
184 deb("Unexpected rc state %02x\n", rc_state[0]);
185 *state = REMOTE_NO_KEY_PRESSED;
190 if (rc_state[1] != 0)
191 deb("Unknown rc key %02x\n", rc_state[1]);
193 *state = REMOTE_NO_KEY_PRESSED;
201 static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
203 struct dvb_usb_device *d = i2c_get_adapdata(adap);
210 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
213 for (i = 0; i < num; i++) {
214 if (msg[i].flags & (I2C_M_NO_RD_ACK | I2C_M_IGNORE_NAK | I2C_M_TEN) || msg[i].len == 0) {
215 /* For a 0 byte message, I think sending the address
216 * to index 0x80|0x40 would be the correct thing to
217 * do. However, zero byte messages are only used for
218 * probing, and since we don't know how to get the
219 * slave's ack, we can't probe. */
223 /* Send START & address/RW bit */
224 if (!(msg[i].flags & I2C_M_NOSTART)) {
225 if ((ret = m920x_write(d->udev, M9206_I2C,
227 (msg[i].flags & I2C_M_RD ? 0x01 : 0), 0x80)) != 0)
229 /* Should check for ack here, if we knew how. */
231 if (msg[i].flags & I2C_M_RD) {
232 for (j = 0; j < msg[i].len; j++) {
233 /* Last byte of transaction?
234 * Send STOP, otherwise send ACK. */
235 int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x01;
237 if ((ret = m920x_read(d->udev, M9206_I2C, 0x0,
239 &msg[i].buf[j], 1)) != 0)
243 for (j = 0; j < msg[i].len; j++) {
244 /* Last byte of transaction? Then send STOP. */
245 int stop = (i+1 == num && j+1 == msg[i].len) ? 0x40 : 0x00;
247 if ((ret = m920x_write(d->udev, M9206_I2C, msg[i].buf[j], stop)) != 0)
249 /* Should check for ack here too. */
256 mutex_unlock(&d->i2c_mutex);
261 static u32 m920x_i2c_func(struct i2c_adapter *adapter)
266 static struct i2c_algorithm m920x_i2c_algo = {
267 .master_xfer = m920x_i2c_xfer,
268 .functionality = m920x_i2c_func,
272 static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid)
281 if ((ret = m920x_write(d->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0)
284 if ((ret = m920x_write(d->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0)
290 static int m920x_update_filters(struct dvb_usb_adapter *adap)
292 struct m920x_state *m = adap->dev->priv;
293 int enabled = m->filtering_enabled[adap->id];
294 int i, ret = 0, filter = 0;
295 int ep = adap->props.stream.endpoint;
297 for (i = 0; i < M9206_MAX_FILTERS; i++)
298 if (m->filters[adap->id][i] == 8192)
301 /* Disable all filters */
302 if ((ret = m920x_set_filter(adap->dev, ep, 1, enabled)) != 0)
305 for (i = 0; i < M9206_MAX_FILTERS; i++)
306 if ((ret = m920x_set_filter(adap->dev, ep, i + 2, 0)) != 0)
311 for (i = 0; i < M9206_MAX_FILTERS; i++) {
312 if (m->filters[adap->id][i] == 0)
315 if ((ret = m920x_set_filter(adap->dev, ep, filter + 2, m->filters[adap->id][i])) != 0)
325 static int m920x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
327 struct m920x_state *m = adap->dev->priv;
329 m->filtering_enabled[adap->id] = onoff ? 1 : 0;
331 return m920x_update_filters(adap);
334 static int m920x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
336 struct m920x_state *m = adap->dev->priv;
338 m->filters[adap->id][index] = onoff ? pid : 0;
340 return m920x_update_filters(adap);
343 static int m920x_firmware_download(struct usb_device *udev, const struct firmware *fw)
345 u16 value, index, size;
347 int i, pass, ret = 0;
349 buff = kmalloc(65536, GFP_KERNEL);
353 read = kmalloc(4, GFP_KERNEL);
359 if ((ret = m920x_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0)
361 deb("%x %x %x %x\n", read[0], read[1], read[2], read[3]);
363 if ((ret = m920x_read(udev, M9206_FW, 0x0, 0x0, read, 1)) != 0)
365 deb("%x\n", read[0]);
367 for (pass = 0; pass < 2; pass++) {
368 for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
369 value = get_unaligned_le16(fw->data + i);
372 index = get_unaligned_le16(fw->data + i);
375 size = get_unaligned_le16(fw->data + i);
379 /* Will stall if using fw->data ... */
380 memcpy(buff, fw->data + i, size);
382 ret = usb_control_msg(udev, usb_sndctrlpipe(udev,0),
384 USB_TYPE_VENDOR | USB_DIR_OUT,
385 value, index, buff, size, 20);
387 deb("error while uploading fw!\n");
396 deb("bad firmware file!\n");
404 /* m920x will disconnect itself from the bus after this. */
405 (void) m920x_write(udev, M9206_CORE, 0x01, M9206_FW_GO);
406 deb("firmware uploaded!\n");
415 /* Callbacks for DVB USB */
416 static int m920x_identify_state(struct usb_device *udev,
417 struct dvb_usb_device_properties *props,
418 struct dvb_usb_device_description **desc,
421 struct usb_host_interface *alt;
423 alt = usb_altnum_to_altsetting(usb_ifnum_to_if(udev, 0), 1);
424 *cold = (alt == NULL) ? 1 : 0;
429 /* demod configurations */
430 static int m920x_mt352_demod_init(struct dvb_frontend *fe)
433 u8 config[] = { CONFIG, 0x3d };
434 u8 clock[] = { CLOCK_CTL, 0x30 };
435 u8 reset[] = { RESET, 0x80 };
436 u8 adc_ctl[] = { ADC_CTL_1, 0x40 };
437 u8 agc[] = { AGC_TARGET, 0x1c, 0x20 };
438 u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
439 u8 unk1[] = { 0x93, 0x1a };
440 u8 unk2[] = { 0xb5, 0x7a };
442 deb("Demod init!\n");
444 if ((ret = mt352_write(fe, config, ARRAY_SIZE(config))) != 0)
446 if ((ret = mt352_write(fe, clock, ARRAY_SIZE(clock))) != 0)
448 if ((ret = mt352_write(fe, reset, ARRAY_SIZE(reset))) != 0)
450 if ((ret = mt352_write(fe, adc_ctl, ARRAY_SIZE(adc_ctl))) != 0)
452 if ((ret = mt352_write(fe, agc, ARRAY_SIZE(agc))) != 0)
454 if ((ret = mt352_write(fe, sec_agc, ARRAY_SIZE(sec_agc))) != 0)
456 if ((ret = mt352_write(fe, unk1, ARRAY_SIZE(unk1))) != 0)
458 if ((ret = mt352_write(fe, unk2, ARRAY_SIZE(unk2))) != 0)
464 static struct mt352_config m920x_mt352_config = {
465 .demod_address = 0x0f,
467 .demod_init = m920x_mt352_demod_init,
470 static struct tda1004x_config m920x_tda10046_08_config = {
471 .demod_address = 0x08,
474 .ts_mode = TDA10046_TS_SERIAL,
475 .xtal_freq = TDA10046_XTAL_16M,
476 .if_freq = TDA10046_FREQ_045,
477 .agc_config = TDA10046_AGC_TDA827X,
478 .gpio_config = TDA10046_GPTRI,
479 .request_firmware = NULL,
482 static struct tda1004x_config m920x_tda10046_0b_config = {
483 .demod_address = 0x0b,
486 .ts_mode = TDA10046_TS_SERIAL,
487 .xtal_freq = TDA10046_XTAL_16M,
488 .if_freq = TDA10046_FREQ_045,
489 .agc_config = TDA10046_AGC_TDA827X,
490 .gpio_config = TDA10046_GPTRI,
491 .request_firmware = NULL, /* uses firmware EEPROM */
494 /* tuner configurations */
495 static struct qt1010_config m920x_qt1010_config = {
499 /* Callbacks for DVB USB */
500 static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap)
502 deb("%s\n",__func__);
504 if ((adap->fe = dvb_attach(mt352_attach,
506 &adap->dev->i2c_adap)) == NULL)
512 static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap)
514 deb("%s\n",__func__);
516 if ((adap->fe = dvb_attach(tda10046_attach,
517 &m920x_tda10046_08_config,
518 &adap->dev->i2c_adap)) == NULL)
524 static int m920x_tda10046_0b_frontend_attach(struct dvb_usb_adapter *adap)
526 deb("%s\n",__func__);
528 if ((adap->fe = dvb_attach(tda10046_attach,
529 &m920x_tda10046_0b_config,
530 &adap->dev->i2c_adap)) == NULL)
536 static int m920x_qt1010_tuner_attach(struct dvb_usb_adapter *adap)
538 deb("%s\n",__func__);
540 if (dvb_attach(qt1010_attach, adap->fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == NULL)
546 static int m920x_tda8275_60_tuner_attach(struct dvb_usb_adapter *adap)
548 deb("%s\n",__func__);
550 if (dvb_attach(tda827x_attach, adap->fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL)
556 static int m920x_tda8275_61_tuner_attach(struct dvb_usb_adapter *adap)
558 deb("%s\n",__func__);
560 if (dvb_attach(tda827x_attach, adap->fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL)
566 static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
568 dvb_attach(simple_tuner_attach, adap->fe,
569 &adap->dev->i2c_adap, 0x61,
570 TUNER_PHILIPS_FMD1216ME_MK3);
574 /* device-specific initialization */
575 static struct m920x_inits megasky_rc_init [] = {
576 { M9206_RC_INIT2, 0xa8 },
577 { M9206_RC_INIT1, 0x51 },
578 { } /* terminating entry */
581 static struct m920x_inits tvwalkertwin_rc_init [] = {
582 { M9206_RC_INIT2, 0x00 },
583 { M9206_RC_INIT1, 0xef },
587 { } /* terminating entry */
590 static struct m920x_inits pinnacle310e_init[] = {
591 /* without these the tuner don't work */
597 { M9206_RC_INIT1, 0x00 },
598 { M9206_RC_INIT2, 0xff },
599 { } /* terminating entry */
603 static struct rc_map_table rc_map_megasky_table[] = {
604 { 0x0012, KEY_POWER },
605 { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */
606 { 0x0002, KEY_CHANNELUP },
607 { 0x0005, KEY_CHANNELDOWN },
608 { 0x0003, KEY_VOLUMEUP },
609 { 0x0006, KEY_VOLUMEDOWN },
610 { 0x0004, KEY_MUTE },
611 { 0x0007, KEY_OK }, /* TS */
612 { 0x0008, KEY_STOP },
613 { 0x0009, KEY_MENU }, /* swap */
614 { 0x000a, KEY_REWIND },
615 { 0x001b, KEY_PAUSE },
616 { 0x001f, KEY_FASTFORWARD },
617 { 0x000c, KEY_RECORD },
618 { 0x000d, KEY_CAMERA }, /* screenshot */
619 { 0x000e, KEY_COFFEE }, /* "MTS" */
622 static struct rc_map_table rc_map_tvwalkertwin_table[] = {
623 { 0x0001, KEY_ZOOM }, /* Full Screen */
624 { 0x0002, KEY_CAMERA }, /* snapshot */
625 { 0x0003, KEY_MUTE },
626 { 0x0004, KEY_REWIND },
627 { 0x0005, KEY_PLAYPAUSE }, /* Play/Pause */
628 { 0x0006, KEY_FASTFORWARD },
629 { 0x0007, KEY_RECORD },
630 { 0x0008, KEY_STOP },
631 { 0x0009, KEY_TIME }, /* Timeshift */
632 { 0x000c, KEY_COFFEE }, /* Recall */
633 { 0x000e, KEY_CHANNELUP },
634 { 0x0012, KEY_POWER },
635 { 0x0015, KEY_MENU }, /* source */
636 { 0x0018, KEY_CYCLEWINDOWS }, /* TWIN PIP */
637 { 0x001a, KEY_CHANNELDOWN },
638 { 0x001b, KEY_VOLUMEDOWN },
639 { 0x001e, KEY_VOLUMEUP },
642 static struct rc_map_table rc_map_pinnacle310e_table[] = {
644 { 0x17, KEY_FAVORITES },
646 { 0x48, KEY_PROGRAM }, /* preview */
648 { 0x04, KEY_LIST }, /* record list */
659 { 0x0c, KEY_CANCEL },
667 { 0x4f, KEY_ENTER }, /* could also be KEY_OK */
668 { 0x1e, KEY_VOLUMEUP },
669 { 0x0a, KEY_VOLUMEDOWN },
670 { 0x05, KEY_CHANNELUP },
671 { 0x02, KEY_CHANNELDOWN },
672 { 0x11, KEY_RECORD },
676 { 0x40, KEY_REWIND },
677 { 0x12, KEY_FASTFORWARD },
678 { 0x41, KEY_PREVIOUSSONG }, /* Replay */
679 { 0x42, KEY_NEXTSONG }, /* Skip */
680 { 0x54, KEY_CAMERA }, /* Capture */
681 /* { 0x50, KEY_SAP }, */ /* Sap */
682 { 0x47, KEY_CYCLEWINDOWS }, /* Pip */
683 { 0x4d, KEY_SCREEN }, /* FullScreen */
684 { 0x08, KEY_SUBTITLE },
686 /* { 0x49, KEY_LR }, */ /* L/R */
687 { 0x07, KEY_SLEEP }, /* Hibernate */
688 { 0x08, KEY_VIDEO }, /* A/V */
689 { 0x0e, KEY_MENU }, /* Recall */
690 { 0x45, KEY_ZOOMIN },
691 { 0x46, KEY_ZOOMOUT },
692 { 0x18, KEY_RED }, /* Red */
693 { 0x53, KEY_GREEN }, /* Green */
694 { 0x5e, KEY_YELLOW }, /* Yellow */
695 { 0x5f, KEY_BLUE }, /* Blue */
698 /* DVB USB Driver stuff */
699 static struct dvb_usb_device_properties megasky_properties;
700 static struct dvb_usb_device_properties digivox_mini_ii_properties;
701 static struct dvb_usb_device_properties tvwalkertwin_properties;
702 static struct dvb_usb_device_properties dposh_properties;
703 static struct dvb_usb_device_properties pinnacle_pctv310e_properties;
705 static int m920x_probe(struct usb_interface *intf,
706 const struct usb_device_id *id)
708 struct dvb_usb_device *d = NULL;
710 struct m920x_inits *rc_init_seq = NULL;
711 int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber;
713 deb("Probing for m920x device at interface %d\n", bInterfaceNumber);
715 if (bInterfaceNumber == 0) {
716 /* Single-tuner device, or first interface on
720 ret = dvb_usb_device_init(intf, &megasky_properties,
721 THIS_MODULE, &d, adapter_nr);
723 rc_init_seq = megasky_rc_init;
727 ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
728 THIS_MODULE, &d, adapter_nr);
730 /* No remote control, so no rc_init_seq */
734 /* This configures both tuners on the TV Walker Twin */
735 ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
736 THIS_MODULE, &d, adapter_nr);
738 rc_init_seq = tvwalkertwin_rc_init;
742 ret = dvb_usb_device_init(intf, &dposh_properties,
743 THIS_MODULE, &d, adapter_nr);
745 /* Remote controller not supported yet. */
749 ret = dvb_usb_device_init(intf, &pinnacle_pctv310e_properties,
750 THIS_MODULE, &d, adapter_nr);
752 rc_init_seq = pinnacle310e_init;
758 /* Another interface on a multi-tuner device */
760 /* The LifeView TV Walker Twin gets here, but struct
761 * tvwalkertwin_properties already configured both
762 * tuners, so there is nothing for us to do here
767 if ((ret = m920x_init_ep(intf)) < 0)
770 if (d && (ret = m920x_init(d, rc_init_seq)) != 0)
776 static struct usb_device_id m920x_table [] = {
777 { USB_DEVICE(USB_VID_MSI, USB_PID_MSI_MEGASKY580) },
778 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
779 USB_PID_MSI_DIGI_VOX_MINI_II) },
780 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
781 USB_PID_LIFEVIEW_TV_WALKER_TWIN_COLD) },
782 { USB_DEVICE(USB_VID_ANUBIS_ELECTRONIC,
783 USB_PID_LIFEVIEW_TV_WALKER_TWIN_WARM) },
784 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) },
785 { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) },
786 { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) },
787 { } /* Terminating entry */
789 MODULE_DEVICE_TABLE (usb, m920x_table);
791 static struct dvb_usb_device_properties megasky_properties = {
792 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
794 .usb_ctrl = DEVICE_SPECIFIC,
795 .firmware = "dvb-usb-megasky-02.fw",
796 .download_firmware = m920x_firmware_download,
800 .rc_map_table = rc_map_megasky_table,
801 .rc_map_size = ARRAY_SIZE(rc_map_megasky_table),
802 .rc_query = m920x_rc_query,
805 .size_of_priv = sizeof(struct m920x_state),
807 .identify_state = m920x_identify_state,
810 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
811 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
813 .pid_filter_count = 8,
814 .pid_filter = m920x_pid_filter,
815 .pid_filter_ctrl = m920x_pid_filter_ctrl,
817 .frontend_attach = m920x_mt352_frontend_attach,
818 .tuner_attach = m920x_qt1010_tuner_attach,
831 .i2c_algo = &m920x_i2c_algo,
833 .num_device_descs = 1,
835 { "MSI Mega Sky 580 DVB-T USB2.0",
836 { &m920x_table[0], NULL },
842 static struct dvb_usb_device_properties digivox_mini_ii_properties = {
843 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
845 .usb_ctrl = DEVICE_SPECIFIC,
846 .firmware = "dvb-usb-digivox-02.fw",
847 .download_firmware = m920x_firmware_download,
849 .size_of_priv = sizeof(struct m920x_state),
851 .identify_state = m920x_identify_state,
854 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
855 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
857 .pid_filter_count = 8,
858 .pid_filter = m920x_pid_filter,
859 .pid_filter_ctrl = m920x_pid_filter_ctrl,
861 .frontend_attach = m920x_tda10046_08_frontend_attach,
862 .tuner_attach = m920x_tda8275_60_tuner_attach,
870 .buffersize = 0x4000,
875 .i2c_algo = &m920x_i2c_algo,
877 .num_device_descs = 1,
879 { "MSI DIGI VOX mini II DVB-T USB2.0",
880 { &m920x_table[1], NULL },
886 /* LifeView TV Walker Twin support by Nick Andrew <nick@nick-andrew.net>
888 * LifeView TV Walker Twin has 1 x M9206, 2 x TDA10046, 2 x TDA8275A
889 * TDA10046 #0 is located at i2c address 0x08
890 * TDA10046 #1 is located at i2c address 0x0b
891 * TDA8275A #0 is located at i2c address 0x60
892 * TDA8275A #1 is located at i2c address 0x61
894 static struct dvb_usb_device_properties tvwalkertwin_properties = {
895 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
897 .usb_ctrl = DEVICE_SPECIFIC,
898 .firmware = "dvb-usb-tvwalkert.fw",
899 .download_firmware = m920x_firmware_download,
903 .rc_map_table = rc_map_tvwalkertwin_table,
904 .rc_map_size = ARRAY_SIZE(rc_map_tvwalkertwin_table),
905 .rc_query = m920x_rc_query,
908 .size_of_priv = sizeof(struct m920x_state),
910 .identify_state = m920x_identify_state,
913 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
914 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
916 .pid_filter_count = 8,
917 .pid_filter = m920x_pid_filter,
918 .pid_filter_ctrl = m920x_pid_filter_ctrl,
920 .frontend_attach = m920x_tda10046_08_frontend_attach,
921 .tuner_attach = m920x_tda8275_60_tuner_attach,
933 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
934 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
936 .pid_filter_count = 8,
937 .pid_filter = m920x_pid_filter,
938 .pid_filter_ctrl = m920x_pid_filter_ctrl,
940 .frontend_attach = m920x_tda10046_0b_frontend_attach,
941 .tuner_attach = m920x_tda8275_61_tuner_attach,
954 .i2c_algo = &m920x_i2c_algo,
956 .num_device_descs = 1,
958 { .name = "LifeView TV Walker Twin DVB-T USB2.0",
959 .cold_ids = { &m920x_table[2], NULL },
960 .warm_ids = { &m920x_table[3], NULL },
965 static struct dvb_usb_device_properties dposh_properties = {
966 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
968 .usb_ctrl = DEVICE_SPECIFIC,
969 .firmware = "dvb-usb-dposh-01.fw",
970 .download_firmware = m920x_firmware_download,
972 .size_of_priv = sizeof(struct m920x_state),
974 .identify_state = m920x_identify_state,
977 /* Hardware pid filters don't work with this device/firmware */
979 .frontend_attach = m920x_mt352_frontend_attach,
980 .tuner_attach = m920x_qt1010_tuner_attach,
993 .i2c_algo = &m920x_i2c_algo,
995 .num_device_descs = 1,
997 { .name = "Dposh DVB-T USB2.0",
998 .cold_ids = { &m920x_table[4], NULL },
999 .warm_ids = { &m920x_table[5], NULL },
1004 static struct dvb_usb_device_properties pinnacle_pctv310e_properties = {
1005 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1007 .usb_ctrl = DEVICE_SPECIFIC,
1008 .download_firmware = NULL,
1012 .rc_map_table = rc_map_pinnacle310e_table,
1013 .rc_map_size = ARRAY_SIZE(rc_map_pinnacle310e_table),
1014 .rc_query = m920x_rc_query,
1017 .size_of_priv = sizeof(struct m920x_state),
1019 .identify_state = m920x_identify_state,
1022 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
1023 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1025 .pid_filter_count = 8,
1026 .pid_filter = m920x_pid_filter,
1027 .pid_filter_ctrl = m920x_pid_filter_ctrl,
1029 .frontend_attach = m920x_mt352_frontend_attach,
1030 .tuner_attach = m920x_fmd1216me_tuner_attach,
1038 .framesperurb = 128,
1045 .i2c_algo = &m920x_i2c_algo,
1047 .num_device_descs = 1,
1049 { "Pinnacle PCTV 310e",
1050 { &m920x_table[6], NULL },
1056 static struct usb_driver m920x_driver = {
1057 .name = "dvb_usb_m920x",
1058 .probe = m920x_probe,
1059 .disconnect = dvb_usb_device_exit,
1060 .id_table = m920x_table,
1064 static int __init m920x_module_init(void)
1068 if ((ret = usb_register(&m920x_driver))) {
1069 err("usb_register failed. Error number %d", ret);
1076 static void __exit m920x_module_exit(void)
1078 /* deregister this driver from the USB subsystem */
1079 usb_deregister(&m920x_driver);
1082 module_init (m920x_module_init);
1083 module_exit (m920x_module_exit);
1085 MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>");
1086 MODULE_DESCRIPTION("DVB Driver for ULI M920x");
1087 MODULE_VERSION("0.1");
1088 MODULE_LICENSE("GPL");