2 * Copyright (C) 2010 Michael Krufky (mkrufky@kernellabs.com)
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 2.
8 * see Documentation/dvb/README.dvb-usb for more information
11 #include <linux/vmalloc.h>
12 #include <linux/i2c.h>
15 #include "mxl111sf-reg.h"
16 #include "mxl111sf-phy.h"
17 #include "mxl111sf-i2c.h"
18 #include "mxl111sf-gpio.h"
20 #include "mxl111sf-demod.h"
21 #include "mxl111sf-tuner.h"
26 int dvb_usb_mxl111sf_debug;
27 module_param_named(debug, dvb_usb_mxl111sf_debug, int, 0644);
28 MODULE_PARM_DESC(debug, "set debugging level "
29 "(1=info, 2=xfer, 4=i2c, 8=reg, 16=adv (or-able)).");
31 int dvb_usb_mxl111sf_isoc;
32 module_param_named(isoc, dvb_usb_mxl111sf_isoc, int, 0644);
33 MODULE_PARM_DESC(isoc, "enable usb isoc xfer (0=bulk, 1=isoc).");
35 int dvb_usb_mxl111sf_spi;
36 module_param_named(spi, dvb_usb_mxl111sf_spi, int, 0644);
37 MODULE_PARM_DESC(spi, "use spi rather than tp for data xfer (0=tp, 1=spi).");
39 #define ANT_PATH_AUTO 0
40 #define ANT_PATH_EXTERNAL 1
41 #define ANT_PATH_INTERNAL 2
43 int dvb_usb_mxl111sf_rfswitch =
50 module_param_named(rfswitch, dvb_usb_mxl111sf_rfswitch, int, 0644);
51 MODULE_PARM_DESC(rfswitch, "force rf switch position (0=auto, 1=ext, 2=int).");
53 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
55 #define deb_info pr_debug
56 #define deb_reg pr_debug
57 #define deb_adv pr_debug
61 int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
62 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
64 int wo = (rbuf == NULL || rlen == 0); /* write-only */
68 deb_adv("%s(wlen = %d, rlen = %d)\n", __func__, wlen, rlen);
70 memset(sndbuf, 0, 1+wlen);
73 memcpy(&sndbuf[1], wbuf, wlen);
75 ret = (wo) ? dvb_usbv2_generic_write(d, sndbuf, 1+wlen) :
76 dvb_usbv2_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen);
82 /* ------------------------------------------------------------------------ */
84 #define MXL_CMD_REG_READ 0xaa
85 #define MXL_CMD_REG_WRITE 0x55
87 int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
92 ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_READ, &addr, 1, buf, 2);
94 mxl_debug("error reading reg: 0x%02x", addr);
101 err("invalid response reading reg: 0x%02x != 0x%02x, 0x%02x",
102 addr, buf[0], buf[1]);
106 deb_reg("R: (0x%02x, 0x%02x)\n", addr, *data);
111 int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data)
113 u8 buf[] = { addr, data };
116 deb_reg("W: (0x%02x, 0x%02x)\n", addr, data);
118 ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
120 err("error writing reg: 0x%02x, val: 0x%02x", addr, data);
124 /* ------------------------------------------------------------------------ */
126 int mxl111sf_write_reg_mask(struct mxl111sf_state *state,
127 u8 addr, u8 mask, u8 data)
133 ret = mxl111sf_read_reg(state, addr, &val);
135 /* dont know why this usually errors out on the first try */
137 err("error writing addr: 0x%02x, mask: 0x%02x, "
138 "data: 0x%02x, retrying...", addr, mask, data);
140 ret = mxl111sf_read_reg(state, addr, &val);
148 ret = mxl111sf_write_reg(state, addr, val);
154 /* ------------------------------------------------------------------------ */
156 int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state,
157 struct mxl111sf_reg_ctrl_info *ctrl_reg_info)
161 for (i = 0; ctrl_reg_info[i].addr |
162 ctrl_reg_info[i].mask |
163 ctrl_reg_info[i].data; i++) {
165 ret = mxl111sf_write_reg_mask(state,
166 ctrl_reg_info[i].addr,
167 ctrl_reg_info[i].mask,
168 ctrl_reg_info[i].data);
170 err("failed on reg #%d (0x%02x)", i,
171 ctrl_reg_info[i].addr);
178 /* ------------------------------------------------------------------------ */
180 static int mxl1x1sf_get_chip_info(struct mxl111sf_state *state)
184 char *mxl_chip, *mxl_rev;
186 if ((state->chip_id) && (state->chip_ver))
189 ret = mxl111sf_read_reg(state, CHIP_ID_REG, &id);
194 ret = mxl111sf_read_reg(state, TOP_CHIP_REV_ID_REG, &ver);
197 state->chip_ver = ver;
201 mxl_chip = "MxL101SF";
204 mxl_chip = "MxL111SF";
207 mxl_chip = "UNKNOWN MxL1X1";
212 state->chip_rev = MXL111SF_V6;
216 state->chip_rev = MXL111SF_V8_100;
220 state->chip_rev = MXL111SF_V8_200;
225 mxl_rev = "UNKNOWN REVISION";
228 info("%s detected, %s (0x%x)", mxl_chip, mxl_rev, ver);
233 #define get_chip_info(state) \
236 ___ret = mxl1x1sf_get_chip_info(state); \
237 if (mxl_fail(___ret)) { \
238 mxl_debug("failed to get chip info" \
239 " on first probe attempt"); \
240 ___ret = mxl1x1sf_get_chip_info(state); \
241 if (mxl_fail(___ret)) \
242 err("failed to get chip info during probe"); \
244 mxl_debug("probe needed a retry " \
245 "in order to succeed."); \
250 /* ------------------------------------------------------------------------ */
252 static int mxl111sf_power_ctrl(struct dvb_usb_device *d, int onoff)
254 /* power control depends on which adapter is being woken:
255 * save this for init, instead, via mxl111sf_adap_fe_init */
260 static int mxl111sf_adap_fe_init(struct dvb_frontend *fe)
262 struct dvb_usb_device *d = fe_to_d(fe);
263 struct mxl111sf_state *state = fe_to_priv(fe);
264 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
267 /* exit if we didnt initialize the driver yet */
268 if (!state->chip_id) {
269 mxl_debug("driver not yet initialized, exit.");
273 deb_info("%s()\n", __func__);
275 mutex_lock(&state->fe_lock);
277 state->alt_mode = adap_state->alt_mode;
279 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
280 err("set interface failed");
282 err = mxl1x1sf_soft_reset(state);
284 err = mxl111sf_init_tuner_demod(state);
286 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
289 mxl111sf_enable_usb_output(state);
291 mxl1x1sf_top_master_ctrl(state, 1);
294 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&
295 (state->chip_rev > MXL111SF_V6)) {
296 mxl111sf_config_pin_mux_modes(state,
297 PIN_MUX_TS_SPI_IN_MODE_1);
300 err = mxl111sf_init_port_expander(state);
301 if (!mxl_fail(err)) {
302 state->gpio_mode = adap_state->gpio_mode;
303 err = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
306 err = fe->ops.init(fe);
308 msleep(100); /* add short delay after enabling
309 * the demod before touching it */
312 return (adap_state->fe_init) ? adap_state->fe_init(fe) : 0;
317 static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe)
319 struct mxl111sf_state *state = fe_to_priv(fe);
320 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
323 /* exit if we didnt initialize the driver yet */
324 if (!state->chip_id) {
325 mxl_debug("driver not yet initialized, exit.");
329 deb_info("%s()\n", __func__);
331 err = (adap_state->fe_sleep) ? adap_state->fe_sleep(fe) : 0;
333 mutex_unlock(&state->fe_lock);
341 static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
343 struct mxl111sf_state *state = fe_to_priv(fe);
344 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
347 deb_info("%s(%d)\n", __func__, onoff);
350 ret = mxl111sf_enable_usb_output(state);
352 ret = mxl111sf_config_mpeg_in(state, 1, 1,
353 adap_state->ep6_clockphase,
358 ret = mxl111sf_disable_656_port(state);
366 static int mxl111sf_ep5_streaming_ctrl(struct dvb_frontend *fe, int onoff)
368 struct mxl111sf_state *state = fe_to_priv(fe);
371 deb_info("%s(%d)\n", __func__, onoff);
374 ret = mxl111sf_enable_usb_output(state);
377 ret = mxl111sf_init_i2s_port(state, 200);
379 ret = mxl111sf_config_i2s(state, 0, 15);
382 ret = mxl111sf_disable_i2s_port(state);
385 if (state->chip_rev > MXL111SF_V6)
386 ret = mxl111sf_config_spi(state, onoff);
392 static int mxl111sf_ep4_streaming_ctrl(struct dvb_frontend *fe, int onoff)
394 struct mxl111sf_state *state = fe_to_priv(fe);
397 deb_info("%s(%d)\n", __func__, onoff);
400 ret = mxl111sf_enable_usb_output(state);
407 /* ------------------------------------------------------------------------ */
409 static struct lgdt3305_config hauppauge_lgdt3305_config = {
410 .i2c_addr = 0xb2 >> 1,
411 .mpeg_mode = LGDT3305_MPEG_SERIAL,
412 .tpclk_edge = LGDT3305_TPCLK_RISING_EDGE,
413 .tpvalid_polarity = LGDT3305_TP_VALID_HIGH,
415 .spectral_inversion = 0,
420 static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
422 struct dvb_usb_device *d = adap_to_d(adap);
423 struct mxl111sf_state *state = d_to_priv(d);
424 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
427 deb_adv("%s()\n", __func__);
429 /* save a pointer to the dvb_usb_device in device state */
431 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
432 state->alt_mode = adap_state->alt_mode;
434 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
435 err("set interface failed");
437 state->gpio_mode = MXL111SF_GPIO_MOD_ATSC;
438 adap_state->gpio_mode = state->gpio_mode;
439 adap_state->device_mode = MXL_TUNER_MODE;
440 adap_state->ep6_clockphase = 1;
442 ret = mxl1x1sf_soft_reset(state);
445 ret = mxl111sf_init_tuner_demod(state);
449 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
453 ret = mxl111sf_enable_usb_output(state);
456 ret = mxl1x1sf_top_master_ctrl(state, 1);
460 ret = mxl111sf_init_port_expander(state);
463 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
467 adap->fe[fe_id] = dvb_attach(lgdt3305_attach,
468 &hauppauge_lgdt3305_config,
470 if (adap->fe[fe_id]) {
471 state->num_frontends++;
472 adap_state->fe_init = adap->fe[fe_id]->ops.init;
473 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
474 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
475 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
483 static struct lg2160_config hauppauge_lg2160_config = {
485 .i2c_addr = 0x1c >> 1,
487 .spectral_inversion = 0,
491 static int mxl111sf_lg2160_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
493 struct dvb_usb_device *d = adap_to_d(adap);
494 struct mxl111sf_state *state = d_to_priv(d);
495 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
498 deb_adv("%s()\n", __func__);
500 /* save a pointer to the dvb_usb_device in device state */
502 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
503 state->alt_mode = adap_state->alt_mode;
505 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
506 err("set interface failed");
508 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
509 adap_state->gpio_mode = state->gpio_mode;
510 adap_state->device_mode = MXL_TUNER_MODE;
511 adap_state->ep6_clockphase = 1;
513 ret = mxl1x1sf_soft_reset(state);
516 ret = mxl111sf_init_tuner_demod(state);
520 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
524 ret = mxl111sf_enable_usb_output(state);
527 ret = mxl1x1sf_top_master_ctrl(state, 1);
531 ret = mxl111sf_init_port_expander(state);
534 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
538 ret = get_chip_info(state);
542 adap->fe[fe_id] = dvb_attach(lg2160_attach,
543 &hauppauge_lg2160_config,
545 if (adap->fe[fe_id]) {
546 state->num_frontends++;
547 adap_state->fe_init = adap->fe[fe_id]->ops.init;
548 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
549 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
550 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
558 static struct lg2160_config hauppauge_lg2161_1019_config = {
559 .lg_chip = LG2161_1019,
560 .i2c_addr = 0x1c >> 1,
562 .spectral_inversion = 0,
564 .output_if = 2, /* LG2161_OIF_SPI_MAS */
567 static struct lg2160_config hauppauge_lg2161_1040_config = {
568 .lg_chip = LG2161_1040,
569 .i2c_addr = 0x1c >> 1,
571 .spectral_inversion = 0,
573 .output_if = 4, /* LG2161_OIF_SPI_MAS */
576 static int mxl111sf_lg2161_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
578 struct dvb_usb_device *d = adap_to_d(adap);
579 struct mxl111sf_state *state = d_to_priv(d);
580 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
583 deb_adv("%s()\n", __func__);
585 /* save a pointer to the dvb_usb_device in device state */
587 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
588 state->alt_mode = adap_state->alt_mode;
590 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
591 err("set interface failed");
593 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
594 adap_state->gpio_mode = state->gpio_mode;
595 adap_state->device_mode = MXL_TUNER_MODE;
596 adap_state->ep6_clockphase = 1;
598 ret = mxl1x1sf_soft_reset(state);
601 ret = mxl111sf_init_tuner_demod(state);
605 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
609 ret = mxl111sf_enable_usb_output(state);
612 ret = mxl1x1sf_top_master_ctrl(state, 1);
616 ret = mxl111sf_init_port_expander(state);
619 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
623 ret = get_chip_info(state);
627 adap->fe[fe_id] = dvb_attach(lg2160_attach,
628 (MXL111SF_V8_200 == state->chip_rev) ?
629 &hauppauge_lg2161_1040_config :
630 &hauppauge_lg2161_1019_config,
632 if (adap->fe[fe_id]) {
633 state->num_frontends++;
634 adap_state->fe_init = adap->fe[fe_id]->ops.init;
635 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
636 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
637 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
645 static struct lg2160_config hauppauge_lg2161_1019_ep6_config = {
646 .lg_chip = LG2161_1019,
647 .i2c_addr = 0x1c >> 1,
649 .spectral_inversion = 0,
651 .output_if = 1, /* LG2161_OIF_SERIAL_TS */
654 static struct lg2160_config hauppauge_lg2161_1040_ep6_config = {
655 .lg_chip = LG2161_1040,
656 .i2c_addr = 0x1c >> 1,
658 .spectral_inversion = 0,
660 .output_if = 7, /* LG2161_OIF_SERIAL_TS */
663 static int mxl111sf_lg2161_ep6_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
665 struct dvb_usb_device *d = adap_to_d(adap);
666 struct mxl111sf_state *state = d_to_priv(d);
667 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
670 deb_adv("%s()\n", __func__);
672 /* save a pointer to the dvb_usb_device in device state */
674 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
675 state->alt_mode = adap_state->alt_mode;
677 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
678 err("set interface failed");
680 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
681 adap_state->gpio_mode = state->gpio_mode;
682 adap_state->device_mode = MXL_TUNER_MODE;
683 adap_state->ep6_clockphase = 0;
685 ret = mxl1x1sf_soft_reset(state);
688 ret = mxl111sf_init_tuner_demod(state);
692 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
696 ret = mxl111sf_enable_usb_output(state);
699 ret = mxl1x1sf_top_master_ctrl(state, 1);
703 ret = mxl111sf_init_port_expander(state);
706 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
710 ret = get_chip_info(state);
714 adap->fe[fe_id] = dvb_attach(lg2160_attach,
715 (MXL111SF_V8_200 == state->chip_rev) ?
716 &hauppauge_lg2161_1040_ep6_config :
717 &hauppauge_lg2161_1019_ep6_config,
719 if (adap->fe[fe_id]) {
720 state->num_frontends++;
721 adap_state->fe_init = adap->fe[fe_id]->ops.init;
722 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
723 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
724 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
732 static struct mxl111sf_demod_config mxl_demod_config = {
733 .read_reg = mxl111sf_read_reg,
734 .write_reg = mxl111sf_write_reg,
735 .program_regs = mxl111sf_ctrl_program_regs,
738 static int mxl111sf_attach_demod(struct dvb_usb_adapter *adap, u8 fe_id)
740 struct dvb_usb_device *d = adap_to_d(adap);
741 struct mxl111sf_state *state = d_to_priv(d);
742 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
745 deb_adv("%s()\n", __func__);
747 /* save a pointer to the dvb_usb_device in device state */
749 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 1 : 2;
750 state->alt_mode = adap_state->alt_mode;
752 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
753 err("set interface failed");
755 state->gpio_mode = MXL111SF_GPIO_MOD_DVBT;
756 adap_state->gpio_mode = state->gpio_mode;
757 adap_state->device_mode = MXL_SOC_MODE;
758 adap_state->ep6_clockphase = 1;
760 ret = mxl1x1sf_soft_reset(state);
763 ret = mxl111sf_init_tuner_demod(state);
767 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
771 ret = mxl111sf_enable_usb_output(state);
774 ret = mxl1x1sf_top_master_ctrl(state, 1);
778 /* dont care if this fails */
779 mxl111sf_init_port_expander(state);
781 adap->fe[fe_id] = dvb_attach(mxl111sf_demod_attach, state,
783 if (adap->fe[fe_id]) {
784 state->num_frontends++;
785 adap_state->fe_init = adap->fe[fe_id]->ops.init;
786 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
787 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
788 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
796 static inline int mxl111sf_set_ant_path(struct mxl111sf_state *state,
799 return mxl111sf_idac_config(state, 1, 1,
800 (antpath == ANT_PATH_INTERNAL) ?
804 #define DbgAntHunt(x, pwr0, pwr1, pwr2, pwr3) \
805 err("%s(%d) FINAL input set to %s rxPwr:%d|%d|%d|%d\n", \
806 __func__, __LINE__, \
807 (ANT_PATH_EXTERNAL == x) ? "EXTERNAL" : "INTERNAL", \
808 pwr0, pwr1, pwr2, pwr3)
810 #define ANT_HUNT_SLEEP 90
811 #define ANT_EXT_TWEAK 0
813 static int mxl111sf_ant_hunt(struct dvb_frontend *fe)
815 struct mxl111sf_state *state = fe_to_priv(fe);
816 int antctrl = dvb_usb_mxl111sf_rfswitch;
818 u16 rxPwrA, rxPwr0, rxPwr1, rxPwr2;
820 /* FIXME: must force EXTERNAL for QAM - done elsewhere */
821 mxl111sf_set_ant_path(state, antctrl == ANT_PATH_AUTO ?
822 ANT_PATH_EXTERNAL : antctrl);
824 if (antctrl == ANT_PATH_AUTO) {
826 msleep(ANT_HUNT_SLEEP);
828 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwrA);
830 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
831 msleep(ANT_HUNT_SLEEP);
832 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr0);
834 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
835 msleep(ANT_HUNT_SLEEP);
836 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr1);
838 mxl111sf_set_ant_path(state, ANT_PATH_INTERNAL);
839 msleep(ANT_HUNT_SLEEP);
840 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr2);
842 if (rxPwr1+ANT_EXT_TWEAK >= rxPwr2) {
843 /* return with EXTERNAL enabled */
844 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
845 DbgAntHunt(ANT_PATH_EXTERNAL, rxPwrA,
846 rxPwr0, rxPwr1, rxPwr2);
848 /* return with INTERNAL enabled */
849 DbgAntHunt(ANT_PATH_INTERNAL, rxPwrA,
850 rxPwr0, rxPwr1, rxPwr2);
856 static struct mxl111sf_tuner_config mxl_tuner_config = {
857 .if_freq = MXL_IF_6_0, /* applies to external IF output, only */
858 .invert_spectrum = 0,
859 .read_reg = mxl111sf_read_reg,
860 .write_reg = mxl111sf_write_reg,
861 .program_regs = mxl111sf_ctrl_program_regs,
862 .top_master_ctrl = mxl1x1sf_top_master_ctrl,
863 .ant_hunt = mxl111sf_ant_hunt,
866 static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
868 struct mxl111sf_state *state = adap_to_priv(adap);
871 deb_adv("%s()\n", __func__);
873 for (i = 0; i < state->num_frontends; i++) {
874 if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
875 &mxl_tuner_config) == NULL)
877 adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
883 static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
888 struct i2c_algorithm mxl111sf_i2c_algo = {
889 .master_xfer = mxl111sf_i2c_xfer,
890 .functionality = mxl111sf_i2c_func,
891 #ifdef NEED_ALGO_CONTROL
892 .algo_control = dummy_algo_control,
896 static int mxl111sf_init(struct dvb_usb_device *d)
898 struct mxl111sf_state *state = d_to_priv(d);
900 static u8 eeprom[256];
903 ret = get_chip_info(state);
905 err("failed to get chip info during probe");
907 mutex_init(&state->fe_lock);
909 if (state->chip_rev > MXL111SF_V6)
910 mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1);
912 c.adapter = &d->i2c_adap;
915 ret = tveeprom_read(&c, eeprom, sizeof(eeprom));
918 tveeprom_hauppauge_analog(&c, &state->tv, (0x84 == eeprom[0xa0]) ?
919 eeprom + 0xa0 : eeprom + 0x80);
921 switch (state->tv.model) {
927 printk(KERN_WARNING "%s: warning: "
928 "unknown hauppauge model #%d\n",
929 __func__, state->tv.model);
935 static int mxl111sf_frontend_attach_dvbt(struct dvb_usb_adapter *adap)
937 return mxl111sf_attach_demod(adap, 0);
940 static int mxl111sf_frontend_attach_atsc(struct dvb_usb_adapter *adap)
942 return mxl111sf_lgdt3305_frontend_attach(adap, 0);
945 static int mxl111sf_frontend_attach_mh(struct dvb_usb_adapter *adap)
947 return mxl111sf_lg2160_frontend_attach(adap, 0);
950 static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter *adap)
953 deb_info("%s\n", __func__);
955 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
959 ret = mxl111sf_attach_demod(adap, 1);
963 ret = mxl111sf_lg2160_frontend_attach(adap, 2);
970 static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter *adap)
973 deb_info("%s\n", __func__);
975 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
979 ret = mxl111sf_attach_demod(adap, 1);
983 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 2);
990 static int mxl111sf_frontend_attach_mercury_mh(struct dvb_usb_adapter *adap)
993 deb_info("%s\n", __func__);
995 ret = mxl111sf_attach_demod(adap, 0);
999 if (dvb_usb_mxl111sf_spi)
1000 ret = mxl111sf_lg2161_frontend_attach(adap, 1);
1002 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 1);
1007 static void mxl111sf_stream_config_bulk(struct usb_data_stream_properties *stream, u8 endpoint)
1009 deb_info("%s: endpoint=%d size=8192\n", __func__, endpoint);
1010 stream->type = USB_BULK;
1012 stream->endpoint = endpoint;
1013 stream->u.bulk.buffersize = 8192;
1016 static void mxl111sf_stream_config_isoc(struct usb_data_stream_properties *stream,
1017 u8 endpoint, int framesperurb, int framesize)
1019 deb_info("%s: endpoint=%d size=%d\n", __func__, endpoint,
1020 framesperurb * framesize);
1021 stream->type = USB_ISOC;
1023 stream->endpoint = endpoint;
1024 stream->u.isoc.framesperurb = framesperurb;
1025 stream->u.isoc.framesize = framesize;
1026 stream->u.isoc.interval = 1;
1029 /* DVB USB Driver stuff */
1032 * bulk EP4/BULK/5/8192
1033 * isoc EP4/ISOC/5/96/564
1035 static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe,
1036 u8 *ts_type, struct usb_data_stream_properties *stream)
1038 deb_info("%s: fe=%d\n", __func__, fe->id);
1040 *ts_type = DVB_USB_FE_TS_TYPE_188;
1041 if (dvb_usb_mxl111sf_isoc)
1042 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1044 mxl111sf_stream_config_bulk(stream, 4);
1048 static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
1049 .driver_name = KBUILD_MODNAME,
1050 .owner = THIS_MODULE,
1051 .adapter_nr = adapter_nr,
1052 .size_of_priv = sizeof(struct mxl111sf_state),
1054 .generic_bulk_ctrl_endpoint = 0x02,
1055 .generic_bulk_ctrl_endpoint_response = 0x81,
1057 .i2c_algo = &mxl111sf_i2c_algo,
1058 .frontend_attach = mxl111sf_frontend_attach_dvbt,
1059 .tuner_attach = mxl111sf_attach_tuner,
1060 .init = mxl111sf_init,
1061 .streaming_ctrl = mxl111sf_ep4_streaming_ctrl,
1062 .get_stream_config = mxl111sf_get_stream_config_dvbt,
1067 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1073 * bulk EP6/BULK/5/8192
1074 * isoc EP6/ISOC/5/24/3072
1076 static int mxl111sf_get_stream_config_atsc(struct dvb_frontend *fe,
1077 u8 *ts_type, struct usb_data_stream_properties *stream)
1079 deb_info("%s: fe=%d\n", __func__, fe->id);
1081 *ts_type = DVB_USB_FE_TS_TYPE_188;
1082 if (dvb_usb_mxl111sf_isoc)
1083 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1085 mxl111sf_stream_config_bulk(stream, 6);
1089 static struct dvb_usb_device_properties mxl111sf_props_atsc = {
1090 .driver_name = KBUILD_MODNAME,
1091 .owner = THIS_MODULE,
1092 .adapter_nr = adapter_nr,
1093 .size_of_priv = sizeof(struct mxl111sf_state),
1095 .generic_bulk_ctrl_endpoint = 0x02,
1096 .generic_bulk_ctrl_endpoint_response = 0x81,
1098 .i2c_algo = &mxl111sf_i2c_algo,
1099 .frontend_attach = mxl111sf_frontend_attach_atsc,
1100 .tuner_attach = mxl111sf_attach_tuner,
1101 .init = mxl111sf_init,
1102 .streaming_ctrl = mxl111sf_ep6_streaming_ctrl,
1103 .get_stream_config = mxl111sf_get_stream_config_atsc,
1108 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1114 * bulk EP5/BULK/5/8192/RAW
1115 * isoc EP5/ISOC/5/96/200/RAW
1117 static int mxl111sf_get_stream_config_mh(struct dvb_frontend *fe,
1118 u8 *ts_type, struct usb_data_stream_properties *stream)
1120 deb_info("%s: fe=%d\n", __func__, fe->id);
1122 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1123 if (dvb_usb_mxl111sf_isoc)
1124 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1126 mxl111sf_stream_config_bulk(stream, 5);
1130 static struct dvb_usb_device_properties mxl111sf_props_mh = {
1131 .driver_name = KBUILD_MODNAME,
1132 .owner = THIS_MODULE,
1133 .adapter_nr = adapter_nr,
1134 .size_of_priv = sizeof(struct mxl111sf_state),
1136 .generic_bulk_ctrl_endpoint = 0x02,
1137 .generic_bulk_ctrl_endpoint_response = 0x81,
1139 .i2c_algo = &mxl111sf_i2c_algo,
1140 .frontend_attach = mxl111sf_frontend_attach_mh,
1141 .tuner_attach = mxl111sf_attach_tuner,
1142 .init = mxl111sf_init,
1143 .streaming_ctrl = mxl111sf_ep5_streaming_ctrl,
1144 .get_stream_config = mxl111sf_get_stream_config_mh,
1149 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1154 /* atsc mh lgdt3305 mxl111sf lg2160
1155 * bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1156 * isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1158 static int mxl111sf_get_stream_config_atsc_mh(struct dvb_frontend *fe,
1159 u8 *ts_type, struct usb_data_stream_properties *stream)
1161 deb_info("%s: fe=%d\n", __func__, fe->id);
1164 *ts_type = DVB_USB_FE_TS_TYPE_188;
1165 if (dvb_usb_mxl111sf_isoc)
1166 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1168 mxl111sf_stream_config_bulk(stream, 6);
1169 } else if (fe->id == 1) {
1170 *ts_type = DVB_USB_FE_TS_TYPE_188;
1171 if (dvb_usb_mxl111sf_isoc)
1172 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1174 mxl111sf_stream_config_bulk(stream, 4);
1175 } else if (fe->id == 2) {
1176 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1177 if (dvb_usb_mxl111sf_isoc)
1178 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1180 mxl111sf_stream_config_bulk(stream, 5);
1185 static int mxl111sf_streaming_ctrl_atsc_mh(struct dvb_frontend *fe, int onoff)
1187 deb_info("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1190 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1191 else if (fe->id == 1)
1192 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1193 else if (fe->id == 2)
1194 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1198 static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
1199 .driver_name = KBUILD_MODNAME,
1200 .owner = THIS_MODULE,
1201 .adapter_nr = adapter_nr,
1202 .size_of_priv = sizeof(struct mxl111sf_state),
1204 .generic_bulk_ctrl_endpoint = 0x02,
1205 .generic_bulk_ctrl_endpoint_response = 0x81,
1207 .i2c_algo = &mxl111sf_i2c_algo,
1208 .frontend_attach = mxl111sf_frontend_attach_atsc_mh,
1209 .tuner_attach = mxl111sf_attach_tuner,
1210 .init = mxl111sf_init,
1211 .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh,
1212 .get_stream_config = mxl111sf_get_stream_config_atsc_mh,
1217 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1222 /* mercury lgdt3305 mxl111sf lg2161
1223 * tp bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1224 * tp isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1225 * spi bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1226 * spi isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1228 static int mxl111sf_get_stream_config_mercury(struct dvb_frontend *fe,
1229 u8 *ts_type, struct usb_data_stream_properties *stream)
1231 deb_info("%s: fe=%d\n", __func__, fe->id);
1234 *ts_type = DVB_USB_FE_TS_TYPE_188;
1235 if (dvb_usb_mxl111sf_isoc)
1236 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1238 mxl111sf_stream_config_bulk(stream, 6);
1239 } else if (fe->id == 1) {
1240 *ts_type = DVB_USB_FE_TS_TYPE_188;
1241 if (dvb_usb_mxl111sf_isoc)
1242 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1244 mxl111sf_stream_config_bulk(stream, 4);
1245 } else if (fe->id == 2 && dvb_usb_mxl111sf_spi) {
1246 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1247 if (dvb_usb_mxl111sf_isoc)
1248 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1250 mxl111sf_stream_config_bulk(stream, 5);
1251 } else if (fe->id == 2 && !dvb_usb_mxl111sf_spi) {
1252 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1253 if (dvb_usb_mxl111sf_isoc)
1254 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1256 mxl111sf_stream_config_bulk(stream, 6);
1261 static int mxl111sf_streaming_ctrl_mercury(struct dvb_frontend *fe, int onoff)
1263 deb_info("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1266 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1267 else if (fe->id == 1)
1268 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1269 else if (fe->id == 2 && dvb_usb_mxl111sf_spi)
1270 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1271 else if (fe->id == 2 && !dvb_usb_mxl111sf_spi)
1272 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1276 static struct dvb_usb_device_properties mxl111sf_props_mercury = {
1277 .driver_name = KBUILD_MODNAME,
1278 .owner = THIS_MODULE,
1279 .adapter_nr = adapter_nr,
1280 .size_of_priv = sizeof(struct mxl111sf_state),
1282 .generic_bulk_ctrl_endpoint = 0x02,
1283 .generic_bulk_ctrl_endpoint_response = 0x81,
1285 .i2c_algo = &mxl111sf_i2c_algo,
1286 .frontend_attach = mxl111sf_frontend_attach_mercury,
1287 .tuner_attach = mxl111sf_attach_tuner,
1288 .init = mxl111sf_init,
1289 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury,
1290 .get_stream_config = mxl111sf_get_stream_config_mercury,
1295 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1300 /* mercury mh mxl111sf lg2161
1301 * tp bulk EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1302 * tp isoc EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1303 * spi bulk EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1304 * spi isoc EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1306 static int mxl111sf_get_stream_config_mercury_mh(struct dvb_frontend *fe,
1307 u8 *ts_type, struct usb_data_stream_properties *stream)
1309 deb_info("%s: fe=%d\n", __func__, fe->id);
1312 *ts_type = DVB_USB_FE_TS_TYPE_188;
1313 if (dvb_usb_mxl111sf_isoc)
1314 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1316 mxl111sf_stream_config_bulk(stream, 4);
1317 } else if (fe->id == 1 && dvb_usb_mxl111sf_spi) {
1318 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1319 if (dvb_usb_mxl111sf_isoc)
1320 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1322 mxl111sf_stream_config_bulk(stream, 5);
1323 } else if (fe->id == 1 && !dvb_usb_mxl111sf_spi) {
1324 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1325 if (dvb_usb_mxl111sf_isoc)
1326 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1328 mxl111sf_stream_config_bulk(stream, 6);
1333 static int mxl111sf_streaming_ctrl_mercury_mh(struct dvb_frontend *fe, int onoff)
1335 deb_info("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1338 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1339 else if (fe->id == 1 && dvb_usb_mxl111sf_spi)
1340 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1341 else if (fe->id == 1 && !dvb_usb_mxl111sf_spi)
1342 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1346 static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
1347 .driver_name = KBUILD_MODNAME,
1348 .owner = THIS_MODULE,
1349 .adapter_nr = adapter_nr,
1350 .size_of_priv = sizeof(struct mxl111sf_state),
1352 .generic_bulk_ctrl_endpoint = 0x02,
1353 .generic_bulk_ctrl_endpoint_response = 0x81,
1355 .i2c_algo = &mxl111sf_i2c_algo,
1356 .frontend_attach = mxl111sf_frontend_attach_mercury_mh,
1357 .tuner_attach = mxl111sf_attach_tuner,
1358 .init = mxl111sf_init,
1359 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh,
1360 .get_stream_config = mxl111sf_get_stream_config_mercury_mh,
1365 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1370 static const struct usb_device_id mxl111sf_id_table[] = {
1371 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc600, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1372 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc601, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1373 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc602, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1374 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc603, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1375 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc604, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1376 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc609, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1377 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60a, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1378 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1379 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60c, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1380 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc653, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1381 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc65b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1382 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb700, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1383 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb701, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1384 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb702, &mxl111sf_props_mh, "HCW 117xxx", NULL) },
1385 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb703, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1386 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb704, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1387 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb753, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1388 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb763, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1389 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb764, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1390 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd853, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1391 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd854, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1392 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd863, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1393 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd864, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1394 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1395 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1396 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1397 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1398 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8ff, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1399 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc612, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1400 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc613, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1401 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61a, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1402 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61b, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1403 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb757, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1404 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb767, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1407 MODULE_DEVICE_TABLE(usb, mxl111sf_id_table);
1409 static struct usb_driver mxl111sf_usb_driver = {
1410 .name = KBUILD_MODNAME,
1411 .id_table = mxl111sf_id_table,
1412 .probe = dvb_usbv2_probe,
1413 .disconnect = dvb_usbv2_disconnect,
1414 .suspend = dvb_usbv2_suspend,
1415 .resume = dvb_usbv2_resume,
1420 module_usb_driver(mxl111sf_usb_driver);
1422 MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>");
1423 MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF");
1424 MODULE_VERSION("1.0");
1425 MODULE_LICENSE("GPL");