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 int mxl111sf_ctrl_msg(struct dvb_usb_device *d,
56 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
58 int wo = (rbuf == NULL || rlen == 0); /* write-only */
62 pr_debug("%s(wlen = %d, rlen = %d)\n", __func__, wlen, rlen);
64 memset(sndbuf, 0, 1+wlen);
67 memcpy(&sndbuf[1], wbuf, wlen);
69 ret = (wo) ? dvb_usbv2_generic_write(d, sndbuf, 1+wlen) :
70 dvb_usbv2_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen);
76 /* ------------------------------------------------------------------------ */
78 #define MXL_CMD_REG_READ 0xaa
79 #define MXL_CMD_REG_WRITE 0x55
81 int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
86 ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_READ, &addr, 1, buf, 2);
88 mxl_debug("error reading reg: 0x%02x", addr);
95 pr_err("invalid response reading reg: 0x%02x != 0x%02x, 0x%02x",
96 addr, buf[0], buf[1]);
100 pr_debug("R: (0x%02x, 0x%02x)\n", addr, *data);
105 int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data)
107 u8 buf[] = { addr, data };
110 pr_debug("W: (0x%02x, 0x%02x)\n", addr, data);
112 ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
114 pr_err("error writing reg: 0x%02x, val: 0x%02x", addr, data);
118 /* ------------------------------------------------------------------------ */
120 int mxl111sf_write_reg_mask(struct mxl111sf_state *state,
121 u8 addr, u8 mask, u8 data)
127 ret = mxl111sf_read_reg(state, addr, &val);
129 /* dont know why this usually errors out on the first try */
131 pr_err("error writing addr: 0x%02x, mask: 0x%02x, "
132 "data: 0x%02x, retrying...", addr, mask, data);
134 ret = mxl111sf_read_reg(state, addr, &val);
142 ret = mxl111sf_write_reg(state, addr, val);
148 /* ------------------------------------------------------------------------ */
150 int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state,
151 struct mxl111sf_reg_ctrl_info *ctrl_reg_info)
155 for (i = 0; ctrl_reg_info[i].addr |
156 ctrl_reg_info[i].mask |
157 ctrl_reg_info[i].data; i++) {
159 ret = mxl111sf_write_reg_mask(state,
160 ctrl_reg_info[i].addr,
161 ctrl_reg_info[i].mask,
162 ctrl_reg_info[i].data);
164 pr_err("failed on reg #%d (0x%02x)", i,
165 ctrl_reg_info[i].addr);
172 /* ------------------------------------------------------------------------ */
174 static int mxl1x1sf_get_chip_info(struct mxl111sf_state *state)
178 char *mxl_chip, *mxl_rev;
180 if ((state->chip_id) && (state->chip_ver))
183 ret = mxl111sf_read_reg(state, CHIP_ID_REG, &id);
188 ret = mxl111sf_read_reg(state, TOP_CHIP_REV_ID_REG, &ver);
191 state->chip_ver = ver;
195 mxl_chip = "MxL101SF";
198 mxl_chip = "MxL111SF";
201 mxl_chip = "UNKNOWN MxL1X1";
206 state->chip_rev = MXL111SF_V6;
210 state->chip_rev = MXL111SF_V8_100;
214 state->chip_rev = MXL111SF_V8_200;
219 mxl_rev = "UNKNOWN REVISION";
222 pr_info("%s detected, %s (0x%x)", mxl_chip, mxl_rev, ver);
227 #define get_chip_info(state) \
230 ___ret = mxl1x1sf_get_chip_info(state); \
231 if (mxl_fail(___ret)) { \
232 mxl_debug("failed to get chip info" \
233 " on first probe attempt"); \
234 ___ret = mxl1x1sf_get_chip_info(state); \
235 if (mxl_fail(___ret)) \
236 pr_err("failed to get chip info during probe"); \
238 mxl_debug("probe needed a retry " \
239 "in order to succeed."); \
244 /* ------------------------------------------------------------------------ */
246 static int mxl111sf_power_ctrl(struct dvb_usb_device *d, int onoff)
248 /* power control depends on which adapter is being woken:
249 * save this for init, instead, via mxl111sf_adap_fe_init */
254 static int mxl111sf_adap_fe_init(struct dvb_frontend *fe)
256 struct dvb_usb_device *d = fe_to_d(fe);
257 struct mxl111sf_state *state = fe_to_priv(fe);
258 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
261 /* exit if we didnt initialize the driver yet */
262 if (!state->chip_id) {
263 mxl_debug("driver not yet initialized, exit.");
267 pr_debug("%s()\n", __func__);
269 mutex_lock(&state->fe_lock);
271 state->alt_mode = adap_state->alt_mode;
273 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
274 pr_err("set interface failed");
276 err = mxl1x1sf_soft_reset(state);
278 err = mxl111sf_init_tuner_demod(state);
280 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
283 mxl111sf_enable_usb_output(state);
285 mxl1x1sf_top_master_ctrl(state, 1);
288 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&
289 (state->chip_rev > MXL111SF_V6)) {
290 mxl111sf_config_pin_mux_modes(state,
291 PIN_MUX_TS_SPI_IN_MODE_1);
294 err = mxl111sf_init_port_expander(state);
295 if (!mxl_fail(err)) {
296 state->gpio_mode = adap_state->gpio_mode;
297 err = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
300 err = fe->ops.init(fe);
302 msleep(100); /* add short delay after enabling
303 * the demod before touching it */
306 return (adap_state->fe_init) ? adap_state->fe_init(fe) : 0;
311 static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe)
313 struct mxl111sf_state *state = fe_to_priv(fe);
314 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
317 /* exit if we didnt initialize the driver yet */
318 if (!state->chip_id) {
319 mxl_debug("driver not yet initialized, exit.");
323 pr_debug("%s()\n", __func__);
325 err = (adap_state->fe_sleep) ? adap_state->fe_sleep(fe) : 0;
327 mutex_unlock(&state->fe_lock);
335 static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
337 struct mxl111sf_state *state = fe_to_priv(fe);
338 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
341 pr_debug("%s(%d)\n", __func__, onoff);
344 ret = mxl111sf_enable_usb_output(state);
346 ret = mxl111sf_config_mpeg_in(state, 1, 1,
347 adap_state->ep6_clockphase,
352 ret = mxl111sf_disable_656_port(state);
360 static int mxl111sf_ep5_streaming_ctrl(struct dvb_frontend *fe, int onoff)
362 struct mxl111sf_state *state = fe_to_priv(fe);
365 pr_debug("%s(%d)\n", __func__, onoff);
368 ret = mxl111sf_enable_usb_output(state);
371 ret = mxl111sf_init_i2s_port(state, 200);
373 ret = mxl111sf_config_i2s(state, 0, 15);
376 ret = mxl111sf_disable_i2s_port(state);
379 if (state->chip_rev > MXL111SF_V6)
380 ret = mxl111sf_config_spi(state, onoff);
386 static int mxl111sf_ep4_streaming_ctrl(struct dvb_frontend *fe, int onoff)
388 struct mxl111sf_state *state = fe_to_priv(fe);
391 pr_debug("%s(%d)\n", __func__, onoff);
394 ret = mxl111sf_enable_usb_output(state);
401 /* ------------------------------------------------------------------------ */
403 static struct lgdt3305_config hauppauge_lgdt3305_config = {
404 .i2c_addr = 0xb2 >> 1,
405 .mpeg_mode = LGDT3305_MPEG_SERIAL,
406 .tpclk_edge = LGDT3305_TPCLK_RISING_EDGE,
407 .tpvalid_polarity = LGDT3305_TP_VALID_HIGH,
409 .spectral_inversion = 0,
414 static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
416 struct dvb_usb_device *d = adap_to_d(adap);
417 struct mxl111sf_state *state = d_to_priv(d);
418 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
421 pr_debug("%s()\n", __func__);
423 /* save a pointer to the dvb_usb_device in device state */
425 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
426 state->alt_mode = adap_state->alt_mode;
428 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
429 pr_err("set interface failed");
431 state->gpio_mode = MXL111SF_GPIO_MOD_ATSC;
432 adap_state->gpio_mode = state->gpio_mode;
433 adap_state->device_mode = MXL_TUNER_MODE;
434 adap_state->ep6_clockphase = 1;
436 ret = mxl1x1sf_soft_reset(state);
439 ret = mxl111sf_init_tuner_demod(state);
443 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
447 ret = mxl111sf_enable_usb_output(state);
450 ret = mxl1x1sf_top_master_ctrl(state, 1);
454 ret = mxl111sf_init_port_expander(state);
457 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
461 adap->fe[fe_id] = dvb_attach(lgdt3305_attach,
462 &hauppauge_lgdt3305_config,
464 if (adap->fe[fe_id]) {
465 state->num_frontends++;
466 adap_state->fe_init = adap->fe[fe_id]->ops.init;
467 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
468 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
469 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
477 static struct lg2160_config hauppauge_lg2160_config = {
479 .i2c_addr = 0x1c >> 1,
481 .spectral_inversion = 0,
485 static int mxl111sf_lg2160_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
487 struct dvb_usb_device *d = adap_to_d(adap);
488 struct mxl111sf_state *state = d_to_priv(d);
489 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
492 pr_debug("%s()\n", __func__);
494 /* save a pointer to the dvb_usb_device in device state */
496 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
497 state->alt_mode = adap_state->alt_mode;
499 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
500 pr_err("set interface failed");
502 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
503 adap_state->gpio_mode = state->gpio_mode;
504 adap_state->device_mode = MXL_TUNER_MODE;
505 adap_state->ep6_clockphase = 1;
507 ret = mxl1x1sf_soft_reset(state);
510 ret = mxl111sf_init_tuner_demod(state);
514 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
518 ret = mxl111sf_enable_usb_output(state);
521 ret = mxl1x1sf_top_master_ctrl(state, 1);
525 ret = mxl111sf_init_port_expander(state);
528 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
532 ret = get_chip_info(state);
536 adap->fe[fe_id] = dvb_attach(lg2160_attach,
537 &hauppauge_lg2160_config,
539 if (adap->fe[fe_id]) {
540 state->num_frontends++;
541 adap_state->fe_init = adap->fe[fe_id]->ops.init;
542 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
543 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
544 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
552 static struct lg2160_config hauppauge_lg2161_1019_config = {
553 .lg_chip = LG2161_1019,
554 .i2c_addr = 0x1c >> 1,
556 .spectral_inversion = 0,
558 .output_if = 2, /* LG2161_OIF_SPI_MAS */
561 static struct lg2160_config hauppauge_lg2161_1040_config = {
562 .lg_chip = LG2161_1040,
563 .i2c_addr = 0x1c >> 1,
565 .spectral_inversion = 0,
567 .output_if = 4, /* LG2161_OIF_SPI_MAS */
570 static int mxl111sf_lg2161_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
572 struct dvb_usb_device *d = adap_to_d(adap);
573 struct mxl111sf_state *state = d_to_priv(d);
574 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
577 pr_debug("%s()\n", __func__);
579 /* save a pointer to the dvb_usb_device in device state */
581 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
582 state->alt_mode = adap_state->alt_mode;
584 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
585 pr_err("set interface failed");
587 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
588 adap_state->gpio_mode = state->gpio_mode;
589 adap_state->device_mode = MXL_TUNER_MODE;
590 adap_state->ep6_clockphase = 1;
592 ret = mxl1x1sf_soft_reset(state);
595 ret = mxl111sf_init_tuner_demod(state);
599 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
603 ret = mxl111sf_enable_usb_output(state);
606 ret = mxl1x1sf_top_master_ctrl(state, 1);
610 ret = mxl111sf_init_port_expander(state);
613 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
617 ret = get_chip_info(state);
621 adap->fe[fe_id] = dvb_attach(lg2160_attach,
622 (MXL111SF_V8_200 == state->chip_rev) ?
623 &hauppauge_lg2161_1040_config :
624 &hauppauge_lg2161_1019_config,
626 if (adap->fe[fe_id]) {
627 state->num_frontends++;
628 adap_state->fe_init = adap->fe[fe_id]->ops.init;
629 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
630 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
631 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
639 static struct lg2160_config hauppauge_lg2161_1019_ep6_config = {
640 .lg_chip = LG2161_1019,
641 .i2c_addr = 0x1c >> 1,
643 .spectral_inversion = 0,
645 .output_if = 1, /* LG2161_OIF_SERIAL_TS */
648 static struct lg2160_config hauppauge_lg2161_1040_ep6_config = {
649 .lg_chip = LG2161_1040,
650 .i2c_addr = 0x1c >> 1,
652 .spectral_inversion = 0,
654 .output_if = 7, /* LG2161_OIF_SERIAL_TS */
657 static int mxl111sf_lg2161_ep6_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
659 struct dvb_usb_device *d = adap_to_d(adap);
660 struct mxl111sf_state *state = d_to_priv(d);
661 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
664 pr_debug("%s()\n", __func__);
666 /* save a pointer to the dvb_usb_device in device state */
668 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
669 state->alt_mode = adap_state->alt_mode;
671 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
672 pr_err("set interface failed");
674 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
675 adap_state->gpio_mode = state->gpio_mode;
676 adap_state->device_mode = MXL_TUNER_MODE;
677 adap_state->ep6_clockphase = 0;
679 ret = mxl1x1sf_soft_reset(state);
682 ret = mxl111sf_init_tuner_demod(state);
686 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
690 ret = mxl111sf_enable_usb_output(state);
693 ret = mxl1x1sf_top_master_ctrl(state, 1);
697 ret = mxl111sf_init_port_expander(state);
700 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
704 ret = get_chip_info(state);
708 adap->fe[fe_id] = dvb_attach(lg2160_attach,
709 (MXL111SF_V8_200 == state->chip_rev) ?
710 &hauppauge_lg2161_1040_ep6_config :
711 &hauppauge_lg2161_1019_ep6_config,
713 if (adap->fe[fe_id]) {
714 state->num_frontends++;
715 adap_state->fe_init = adap->fe[fe_id]->ops.init;
716 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
717 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
718 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
726 static struct mxl111sf_demod_config mxl_demod_config = {
727 .read_reg = mxl111sf_read_reg,
728 .write_reg = mxl111sf_write_reg,
729 .program_regs = mxl111sf_ctrl_program_regs,
732 static int mxl111sf_attach_demod(struct dvb_usb_adapter *adap, u8 fe_id)
734 struct dvb_usb_device *d = adap_to_d(adap);
735 struct mxl111sf_state *state = d_to_priv(d);
736 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
739 pr_debug("%s()\n", __func__);
741 /* save a pointer to the dvb_usb_device in device state */
743 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 1 : 2;
744 state->alt_mode = adap_state->alt_mode;
746 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
747 pr_err("set interface failed");
749 state->gpio_mode = MXL111SF_GPIO_MOD_DVBT;
750 adap_state->gpio_mode = state->gpio_mode;
751 adap_state->device_mode = MXL_SOC_MODE;
752 adap_state->ep6_clockphase = 1;
754 ret = mxl1x1sf_soft_reset(state);
757 ret = mxl111sf_init_tuner_demod(state);
761 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
765 ret = mxl111sf_enable_usb_output(state);
768 ret = mxl1x1sf_top_master_ctrl(state, 1);
772 /* dont care if this fails */
773 mxl111sf_init_port_expander(state);
775 adap->fe[fe_id] = dvb_attach(mxl111sf_demod_attach, state,
777 if (adap->fe[fe_id]) {
778 state->num_frontends++;
779 adap_state->fe_init = adap->fe[fe_id]->ops.init;
780 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
781 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
782 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
790 static inline int mxl111sf_set_ant_path(struct mxl111sf_state *state,
793 return mxl111sf_idac_config(state, 1, 1,
794 (antpath == ANT_PATH_INTERNAL) ?
798 #define DbgAntHunt(x, pwr0, pwr1, pwr2, pwr3) \
799 pr_err("%s(%d) FINAL input set to %s rxPwr:%d|%d|%d|%d\n", \
800 __func__, __LINE__, \
801 (ANT_PATH_EXTERNAL == x) ? "EXTERNAL" : "INTERNAL", \
802 pwr0, pwr1, pwr2, pwr3)
804 #define ANT_HUNT_SLEEP 90
805 #define ANT_EXT_TWEAK 0
807 static int mxl111sf_ant_hunt(struct dvb_frontend *fe)
809 struct mxl111sf_state *state = fe_to_priv(fe);
810 int antctrl = dvb_usb_mxl111sf_rfswitch;
812 u16 rxPwrA, rxPwr0, rxPwr1, rxPwr2;
814 /* FIXME: must force EXTERNAL for QAM - done elsewhere */
815 mxl111sf_set_ant_path(state, antctrl == ANT_PATH_AUTO ?
816 ANT_PATH_EXTERNAL : antctrl);
818 if (antctrl == ANT_PATH_AUTO) {
820 msleep(ANT_HUNT_SLEEP);
822 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwrA);
824 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
825 msleep(ANT_HUNT_SLEEP);
826 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr0);
828 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
829 msleep(ANT_HUNT_SLEEP);
830 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr1);
832 mxl111sf_set_ant_path(state, ANT_PATH_INTERNAL);
833 msleep(ANT_HUNT_SLEEP);
834 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr2);
836 if (rxPwr1+ANT_EXT_TWEAK >= rxPwr2) {
837 /* return with EXTERNAL enabled */
838 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
839 DbgAntHunt(ANT_PATH_EXTERNAL, rxPwrA,
840 rxPwr0, rxPwr1, rxPwr2);
842 /* return with INTERNAL enabled */
843 DbgAntHunt(ANT_PATH_INTERNAL, rxPwrA,
844 rxPwr0, rxPwr1, rxPwr2);
850 static struct mxl111sf_tuner_config mxl_tuner_config = {
851 .if_freq = MXL_IF_6_0, /* applies to external IF output, only */
852 .invert_spectrum = 0,
853 .read_reg = mxl111sf_read_reg,
854 .write_reg = mxl111sf_write_reg,
855 .program_regs = mxl111sf_ctrl_program_regs,
856 .top_master_ctrl = mxl1x1sf_top_master_ctrl,
857 .ant_hunt = mxl111sf_ant_hunt,
860 static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
862 struct mxl111sf_state *state = adap_to_priv(adap);
865 pr_debug("%s()\n", __func__);
867 for (i = 0; i < state->num_frontends; i++) {
868 if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
869 &mxl_tuner_config) == NULL)
871 adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
877 static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
882 struct i2c_algorithm mxl111sf_i2c_algo = {
883 .master_xfer = mxl111sf_i2c_xfer,
884 .functionality = mxl111sf_i2c_func,
885 #ifdef NEED_ALGO_CONTROL
886 .algo_control = dummy_algo_control,
890 static int mxl111sf_init(struct dvb_usb_device *d)
892 struct mxl111sf_state *state = d_to_priv(d);
894 static u8 eeprom[256];
897 ret = get_chip_info(state);
899 pr_err("failed to get chip info during probe");
901 mutex_init(&state->fe_lock);
903 if (state->chip_rev > MXL111SF_V6)
904 mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1);
906 c.adapter = &d->i2c_adap;
909 ret = tveeprom_read(&c, eeprom, sizeof(eeprom));
912 tveeprom_hauppauge_analog(&c, &state->tv, (0x84 == eeprom[0xa0]) ?
913 eeprom + 0xa0 : eeprom + 0x80);
915 switch (state->tv.model) {
921 printk(KERN_WARNING "%s: warning: "
922 "unknown hauppauge model #%d\n",
923 __func__, state->tv.model);
929 static int mxl111sf_frontend_attach_dvbt(struct dvb_usb_adapter *adap)
931 return mxl111sf_attach_demod(adap, 0);
934 static int mxl111sf_frontend_attach_atsc(struct dvb_usb_adapter *adap)
936 return mxl111sf_lgdt3305_frontend_attach(adap, 0);
939 static int mxl111sf_frontend_attach_mh(struct dvb_usb_adapter *adap)
941 return mxl111sf_lg2160_frontend_attach(adap, 0);
944 static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter *adap)
947 pr_debug("%s\n", __func__);
949 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
953 ret = mxl111sf_attach_demod(adap, 1);
957 ret = mxl111sf_lg2160_frontend_attach(adap, 2);
964 static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter *adap)
967 pr_debug("%s\n", __func__);
969 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
973 ret = mxl111sf_attach_demod(adap, 1);
977 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 2);
984 static int mxl111sf_frontend_attach_mercury_mh(struct dvb_usb_adapter *adap)
987 pr_debug("%s\n", __func__);
989 ret = mxl111sf_attach_demod(adap, 0);
993 if (dvb_usb_mxl111sf_spi)
994 ret = mxl111sf_lg2161_frontend_attach(adap, 1);
996 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 1);
1001 static void mxl111sf_stream_config_bulk(struct usb_data_stream_properties *stream, u8 endpoint)
1003 pr_debug("%s: endpoint=%d size=8192\n", __func__, endpoint);
1004 stream->type = USB_BULK;
1006 stream->endpoint = endpoint;
1007 stream->u.bulk.buffersize = 8192;
1010 static void mxl111sf_stream_config_isoc(struct usb_data_stream_properties *stream,
1011 u8 endpoint, int framesperurb, int framesize)
1013 pr_debug("%s: endpoint=%d size=%d\n", __func__, endpoint,
1014 framesperurb * framesize);
1015 stream->type = USB_ISOC;
1017 stream->endpoint = endpoint;
1018 stream->u.isoc.framesperurb = framesperurb;
1019 stream->u.isoc.framesize = framesize;
1020 stream->u.isoc.interval = 1;
1023 /* DVB USB Driver stuff */
1026 * bulk EP4/BULK/5/8192
1027 * isoc EP4/ISOC/5/96/564
1029 static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe,
1030 u8 *ts_type, struct usb_data_stream_properties *stream)
1032 pr_debug("%s: fe=%d\n", __func__, fe->id);
1034 *ts_type = DVB_USB_FE_TS_TYPE_188;
1035 if (dvb_usb_mxl111sf_isoc)
1036 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1038 mxl111sf_stream_config_bulk(stream, 4);
1042 static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
1043 .driver_name = KBUILD_MODNAME,
1044 .owner = THIS_MODULE,
1045 .adapter_nr = adapter_nr,
1046 .size_of_priv = sizeof(struct mxl111sf_state),
1048 .generic_bulk_ctrl_endpoint = 0x02,
1049 .generic_bulk_ctrl_endpoint_response = 0x81,
1051 .i2c_algo = &mxl111sf_i2c_algo,
1052 .frontend_attach = mxl111sf_frontend_attach_dvbt,
1053 .tuner_attach = mxl111sf_attach_tuner,
1054 .init = mxl111sf_init,
1055 .streaming_ctrl = mxl111sf_ep4_streaming_ctrl,
1056 .get_stream_config = mxl111sf_get_stream_config_dvbt,
1061 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1067 * bulk EP6/BULK/5/8192
1068 * isoc EP6/ISOC/5/24/3072
1070 static int mxl111sf_get_stream_config_atsc(struct dvb_frontend *fe,
1071 u8 *ts_type, struct usb_data_stream_properties *stream)
1073 pr_debug("%s: fe=%d\n", __func__, fe->id);
1075 *ts_type = DVB_USB_FE_TS_TYPE_188;
1076 if (dvb_usb_mxl111sf_isoc)
1077 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1079 mxl111sf_stream_config_bulk(stream, 6);
1083 static struct dvb_usb_device_properties mxl111sf_props_atsc = {
1084 .driver_name = KBUILD_MODNAME,
1085 .owner = THIS_MODULE,
1086 .adapter_nr = adapter_nr,
1087 .size_of_priv = sizeof(struct mxl111sf_state),
1089 .generic_bulk_ctrl_endpoint = 0x02,
1090 .generic_bulk_ctrl_endpoint_response = 0x81,
1092 .i2c_algo = &mxl111sf_i2c_algo,
1093 .frontend_attach = mxl111sf_frontend_attach_atsc,
1094 .tuner_attach = mxl111sf_attach_tuner,
1095 .init = mxl111sf_init,
1096 .streaming_ctrl = mxl111sf_ep6_streaming_ctrl,
1097 .get_stream_config = mxl111sf_get_stream_config_atsc,
1102 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1108 * bulk EP5/BULK/5/8192/RAW
1109 * isoc EP5/ISOC/5/96/200/RAW
1111 static int mxl111sf_get_stream_config_mh(struct dvb_frontend *fe,
1112 u8 *ts_type, struct usb_data_stream_properties *stream)
1114 pr_debug("%s: fe=%d\n", __func__, fe->id);
1116 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1117 if (dvb_usb_mxl111sf_isoc)
1118 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1120 mxl111sf_stream_config_bulk(stream, 5);
1124 static struct dvb_usb_device_properties mxl111sf_props_mh = {
1125 .driver_name = KBUILD_MODNAME,
1126 .owner = THIS_MODULE,
1127 .adapter_nr = adapter_nr,
1128 .size_of_priv = sizeof(struct mxl111sf_state),
1130 .generic_bulk_ctrl_endpoint = 0x02,
1131 .generic_bulk_ctrl_endpoint_response = 0x81,
1133 .i2c_algo = &mxl111sf_i2c_algo,
1134 .frontend_attach = mxl111sf_frontend_attach_mh,
1135 .tuner_attach = mxl111sf_attach_tuner,
1136 .init = mxl111sf_init,
1137 .streaming_ctrl = mxl111sf_ep5_streaming_ctrl,
1138 .get_stream_config = mxl111sf_get_stream_config_mh,
1143 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1148 /* atsc mh lgdt3305 mxl111sf lg2160
1149 * bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1150 * isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1152 static int mxl111sf_get_stream_config_atsc_mh(struct dvb_frontend *fe,
1153 u8 *ts_type, struct usb_data_stream_properties *stream)
1155 pr_debug("%s: fe=%d\n", __func__, fe->id);
1158 *ts_type = DVB_USB_FE_TS_TYPE_188;
1159 if (dvb_usb_mxl111sf_isoc)
1160 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1162 mxl111sf_stream_config_bulk(stream, 6);
1163 } else if (fe->id == 1) {
1164 *ts_type = DVB_USB_FE_TS_TYPE_188;
1165 if (dvb_usb_mxl111sf_isoc)
1166 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1168 mxl111sf_stream_config_bulk(stream, 4);
1169 } else if (fe->id == 2) {
1170 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1171 if (dvb_usb_mxl111sf_isoc)
1172 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1174 mxl111sf_stream_config_bulk(stream, 5);
1179 static int mxl111sf_streaming_ctrl_atsc_mh(struct dvb_frontend *fe, int onoff)
1181 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1184 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1185 else if (fe->id == 1)
1186 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1187 else if (fe->id == 2)
1188 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1192 static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
1193 .driver_name = KBUILD_MODNAME,
1194 .owner = THIS_MODULE,
1195 .adapter_nr = adapter_nr,
1196 .size_of_priv = sizeof(struct mxl111sf_state),
1198 .generic_bulk_ctrl_endpoint = 0x02,
1199 .generic_bulk_ctrl_endpoint_response = 0x81,
1201 .i2c_algo = &mxl111sf_i2c_algo,
1202 .frontend_attach = mxl111sf_frontend_attach_atsc_mh,
1203 .tuner_attach = mxl111sf_attach_tuner,
1204 .init = mxl111sf_init,
1205 .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh,
1206 .get_stream_config = mxl111sf_get_stream_config_atsc_mh,
1211 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1216 /* mercury lgdt3305 mxl111sf lg2161
1217 * tp bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1218 * tp isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1219 * spi bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1220 * spi isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1222 static int mxl111sf_get_stream_config_mercury(struct dvb_frontend *fe,
1223 u8 *ts_type, struct usb_data_stream_properties *stream)
1225 pr_debug("%s: fe=%d\n", __func__, fe->id);
1228 *ts_type = DVB_USB_FE_TS_TYPE_188;
1229 if (dvb_usb_mxl111sf_isoc)
1230 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1232 mxl111sf_stream_config_bulk(stream, 6);
1233 } else if (fe->id == 1) {
1234 *ts_type = DVB_USB_FE_TS_TYPE_188;
1235 if (dvb_usb_mxl111sf_isoc)
1236 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1238 mxl111sf_stream_config_bulk(stream, 4);
1239 } else if (fe->id == 2 && dvb_usb_mxl111sf_spi) {
1240 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1241 if (dvb_usb_mxl111sf_isoc)
1242 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1244 mxl111sf_stream_config_bulk(stream, 5);
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, 6, 24, 3072);
1250 mxl111sf_stream_config_bulk(stream, 6);
1255 static int mxl111sf_streaming_ctrl_mercury(struct dvb_frontend *fe, int onoff)
1257 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1260 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1261 else if (fe->id == 1)
1262 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1263 else if (fe->id == 2 && dvb_usb_mxl111sf_spi)
1264 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1265 else if (fe->id == 2 && !dvb_usb_mxl111sf_spi)
1266 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1270 static struct dvb_usb_device_properties mxl111sf_props_mercury = {
1271 .driver_name = KBUILD_MODNAME,
1272 .owner = THIS_MODULE,
1273 .adapter_nr = adapter_nr,
1274 .size_of_priv = sizeof(struct mxl111sf_state),
1276 .generic_bulk_ctrl_endpoint = 0x02,
1277 .generic_bulk_ctrl_endpoint_response = 0x81,
1279 .i2c_algo = &mxl111sf_i2c_algo,
1280 .frontend_attach = mxl111sf_frontend_attach_mercury,
1281 .tuner_attach = mxl111sf_attach_tuner,
1282 .init = mxl111sf_init,
1283 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury,
1284 .get_stream_config = mxl111sf_get_stream_config_mercury,
1289 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1294 /* mercury mh mxl111sf lg2161
1295 * tp bulk EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1296 * tp isoc EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1297 * spi bulk EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1298 * spi isoc EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1300 static int mxl111sf_get_stream_config_mercury_mh(struct dvb_frontend *fe,
1301 u8 *ts_type, struct usb_data_stream_properties *stream)
1303 pr_debug("%s: fe=%d\n", __func__, fe->id);
1306 *ts_type = DVB_USB_FE_TS_TYPE_188;
1307 if (dvb_usb_mxl111sf_isoc)
1308 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1310 mxl111sf_stream_config_bulk(stream, 4);
1311 } else if (fe->id == 1 && dvb_usb_mxl111sf_spi) {
1312 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1313 if (dvb_usb_mxl111sf_isoc)
1314 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1316 mxl111sf_stream_config_bulk(stream, 5);
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, 6, 24, 3072);
1322 mxl111sf_stream_config_bulk(stream, 6);
1327 static int mxl111sf_streaming_ctrl_mercury_mh(struct dvb_frontend *fe, int onoff)
1329 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1332 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1333 else if (fe->id == 1 && dvb_usb_mxl111sf_spi)
1334 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1335 else if (fe->id == 1 && !dvb_usb_mxl111sf_spi)
1336 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1340 static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
1341 .driver_name = KBUILD_MODNAME,
1342 .owner = THIS_MODULE,
1343 .adapter_nr = adapter_nr,
1344 .size_of_priv = sizeof(struct mxl111sf_state),
1346 .generic_bulk_ctrl_endpoint = 0x02,
1347 .generic_bulk_ctrl_endpoint_response = 0x81,
1349 .i2c_algo = &mxl111sf_i2c_algo,
1350 .frontend_attach = mxl111sf_frontend_attach_mercury_mh,
1351 .tuner_attach = mxl111sf_attach_tuner,
1352 .init = mxl111sf_init,
1353 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh,
1354 .get_stream_config = mxl111sf_get_stream_config_mercury_mh,
1359 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1364 static const struct usb_device_id mxl111sf_id_table[] = {
1365 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc600, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1366 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc601, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1367 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc602, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1368 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc603, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1369 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc604, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1370 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc609, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1371 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60a, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1372 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1373 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60c, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1374 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc653, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1375 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc65b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1376 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb700, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1377 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb701, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1378 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb702, &mxl111sf_props_mh, "HCW 117xxx", NULL) },
1379 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb703, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1380 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb704, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1381 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb753, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1382 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb763, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1383 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb764, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1384 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd853, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1385 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd854, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1386 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd863, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1387 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd864, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1388 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1389 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1390 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1391 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1392 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8ff, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1393 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc612, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1394 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc613, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1395 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61a, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1396 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61b, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1397 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb757, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1398 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb767, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1401 MODULE_DEVICE_TABLE(usb, mxl111sf_id_table);
1403 static struct usb_driver mxl111sf_usb_driver = {
1404 .name = KBUILD_MODNAME,
1405 .id_table = mxl111sf_id_table,
1406 .probe = dvb_usbv2_probe,
1407 .disconnect = dvb_usbv2_disconnect,
1408 .suspend = dvb_usbv2_suspend,
1409 .resume = dvb_usbv2_resume,
1414 module_usb_driver(mxl111sf_usb_driver);
1416 MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>");
1417 MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF");
1418 MODULE_VERSION("1.0");
1419 MODULE_LICENSE("GPL");