2 * Copyright (C) 2010-2014 Michael Krufky (mkrufky@linuxtv.org)
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>
13 #include <media/tuner.h>
16 #include "mxl111sf-reg.h"
17 #include "mxl111sf-phy.h"
18 #include "mxl111sf-i2c.h"
19 #include "mxl111sf-gpio.h"
21 #include "mxl111sf-demod.h"
22 #include "mxl111sf-tuner.h"
27 int dvb_usb_mxl111sf_debug;
28 module_param_named(debug, dvb_usb_mxl111sf_debug, int, 0644);
29 MODULE_PARM_DESC(debug, "set debugging level "
30 "(1=info, 2=xfer, 4=i2c, 8=reg, 16=adv (or-able)).");
32 static int dvb_usb_mxl111sf_isoc;
33 module_param_named(isoc, dvb_usb_mxl111sf_isoc, int, 0644);
34 MODULE_PARM_DESC(isoc, "enable usb isoc xfer (0=bulk, 1=isoc).");
36 static int dvb_usb_mxl111sf_spi;
37 module_param_named(spi, dvb_usb_mxl111sf_spi, int, 0644);
38 MODULE_PARM_DESC(spi, "use spi rather than tp for data xfer (0=tp, 1=spi).");
40 #define ANT_PATH_AUTO 0
41 #define ANT_PATH_EXTERNAL 1
42 #define ANT_PATH_INTERNAL 2
44 static int dvb_usb_mxl111sf_rfswitch =
51 module_param_named(rfswitch, dvb_usb_mxl111sf_rfswitch, int, 0644);
52 MODULE_PARM_DESC(rfswitch, "force rf switch position (0=auto, 1=ext, 2=int).");
54 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
56 int mxl111sf_ctrl_msg(struct mxl111sf_state *state,
57 u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
59 struct dvb_usb_device *d = state->d;
60 int wo = (rbuf == NULL || rlen == 0); /* write-only */
63 if (1 + wlen > MXL_MAX_XFER_SIZE) {
64 pr_warn("%s: len=%d is too big!\n", __func__, wlen);
68 pr_debug("%s(wlen = %d, rlen = %d)\n", __func__, wlen, rlen);
70 mutex_lock(&state->msg_lock);
71 memset(state->sndbuf, 0, 1+wlen);
72 memset(state->rcvbuf, 0, rlen);
74 state->sndbuf[0] = cmd;
75 memcpy(&state->sndbuf[1], wbuf, wlen);
77 ret = (wo) ? dvb_usbv2_generic_write(d, state->sndbuf, 1+wlen) :
78 dvb_usbv2_generic_rw(d, state->sndbuf, 1+wlen, state->rcvbuf,
81 memcpy(rbuf, state->rcvbuf, rlen);
82 mutex_unlock(&state->msg_lock);
89 /* ------------------------------------------------------------------------ */
91 #define MXL_CMD_REG_READ 0xaa
92 #define MXL_CMD_REG_WRITE 0x55
94 int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data)
99 ret = mxl111sf_ctrl_msg(state, MXL_CMD_REG_READ, &addr, 1, buf, 2);
101 mxl_debug("error reading reg: 0x%02x", addr);
108 pr_err("invalid response reading reg: 0x%02x != 0x%02x, 0x%02x",
109 addr, buf[0], buf[1]);
113 pr_debug("R: (0x%02x, 0x%02x)\n", addr, buf[1]);
118 int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data)
120 u8 buf[] = { addr, data };
123 pr_debug("W: (0x%02x, 0x%02x)\n", addr, data);
125 ret = mxl111sf_ctrl_msg(state, MXL_CMD_REG_WRITE, buf, 2, NULL, 0);
127 pr_err("error writing reg: 0x%02x, val: 0x%02x", addr, data);
131 /* ------------------------------------------------------------------------ */
133 int mxl111sf_write_reg_mask(struct mxl111sf_state *state,
134 u8 addr, u8 mask, u8 data)
140 ret = mxl111sf_read_reg(state, addr, &val);
142 /* dont know why this usually errors out on the first try */
144 pr_err("error writing addr: 0x%02x, mask: 0x%02x, "
145 "data: 0x%02x, retrying...", addr, mask, data);
147 ret = mxl111sf_read_reg(state, addr, &val);
155 ret = mxl111sf_write_reg(state, addr, val);
161 /* ------------------------------------------------------------------------ */
163 int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state,
164 struct mxl111sf_reg_ctrl_info *ctrl_reg_info)
168 for (i = 0; ctrl_reg_info[i].addr |
169 ctrl_reg_info[i].mask |
170 ctrl_reg_info[i].data; i++) {
172 ret = mxl111sf_write_reg_mask(state,
173 ctrl_reg_info[i].addr,
174 ctrl_reg_info[i].mask,
175 ctrl_reg_info[i].data);
177 pr_err("failed on reg #%d (0x%02x)", i,
178 ctrl_reg_info[i].addr);
185 /* ------------------------------------------------------------------------ */
187 static int mxl1x1sf_get_chip_info(struct mxl111sf_state *state)
191 char *mxl_chip, *mxl_rev;
193 if ((state->chip_id) && (state->chip_ver))
196 ret = mxl111sf_read_reg(state, CHIP_ID_REG, &id);
201 ret = mxl111sf_read_reg(state, TOP_CHIP_REV_ID_REG, &ver);
204 state->chip_ver = ver;
208 mxl_chip = "MxL101SF";
211 mxl_chip = "MxL111SF";
214 mxl_chip = "UNKNOWN MxL1X1";
219 state->chip_rev = MXL111SF_V6;
223 state->chip_rev = MXL111SF_V8_100;
227 state->chip_rev = MXL111SF_V8_200;
232 mxl_rev = "UNKNOWN REVISION";
235 pr_info("%s detected, %s (0x%x)", mxl_chip, mxl_rev, ver);
240 #define get_chip_info(state) \
243 ___ret = mxl1x1sf_get_chip_info(state); \
244 if (mxl_fail(___ret)) { \
245 mxl_debug("failed to get chip info" \
246 " on first probe attempt"); \
247 ___ret = mxl1x1sf_get_chip_info(state); \
248 if (mxl_fail(___ret)) \
249 pr_err("failed to get chip info during probe"); \
251 mxl_debug("probe needed a retry " \
252 "in order to succeed."); \
257 /* ------------------------------------------------------------------------ */
259 static int mxl111sf_power_ctrl(struct dvb_usb_device *d, int onoff)
261 /* power control depends on which adapter is being woken:
262 * save this for init, instead, via mxl111sf_adap_fe_init */
267 static int mxl111sf_adap_fe_init(struct dvb_frontend *fe)
269 struct dvb_usb_device *d = fe_to_d(fe);
270 struct mxl111sf_state *state = fe_to_priv(fe);
271 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
274 /* exit if we didn't initialize the driver yet */
275 if (!state->chip_id) {
276 mxl_debug("driver not yet initialized, exit.");
280 pr_debug("%s()\n", __func__);
282 mutex_lock(&state->fe_lock);
284 state->alt_mode = adap_state->alt_mode;
286 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
287 pr_err("set interface failed");
289 err = mxl1x1sf_soft_reset(state);
291 err = mxl111sf_init_tuner_demod(state);
293 err = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
296 err = mxl111sf_enable_usb_output(state);
298 err = mxl1x1sf_top_master_ctrl(state, 1);
301 if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) &&
302 (state->chip_rev > MXL111SF_V6)) {
303 mxl111sf_config_pin_mux_modes(state,
304 PIN_MUX_TS_SPI_IN_MODE_1);
307 err = mxl111sf_init_port_expander(state);
308 if (!mxl_fail(err)) {
309 state->gpio_mode = adap_state->gpio_mode;
310 err = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
313 err = fe->ops.init(fe);
315 msleep(100); /* add short delay after enabling
316 * the demod before touching it */
319 return (adap_state->fe_init) ? adap_state->fe_init(fe) : 0;
324 static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe)
326 struct mxl111sf_state *state = fe_to_priv(fe);
327 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
330 /* exit if we didn't initialize the driver yet */
331 if (!state->chip_id) {
332 mxl_debug("driver not yet initialized, exit.");
336 pr_debug("%s()\n", __func__);
338 err = (adap_state->fe_sleep) ? adap_state->fe_sleep(fe) : 0;
340 mutex_unlock(&state->fe_lock);
348 static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
350 struct mxl111sf_state *state = fe_to_priv(fe);
351 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
354 pr_debug("%s(%d)\n", __func__, onoff);
357 ret = mxl111sf_enable_usb_output(state);
359 ret = mxl111sf_config_mpeg_in(state, 1, 1,
360 adap_state->ep6_clockphase,
365 ret = mxl111sf_disable_656_port(state);
373 static int mxl111sf_ep5_streaming_ctrl(struct dvb_frontend *fe, int onoff)
375 struct mxl111sf_state *state = fe_to_priv(fe);
378 pr_debug("%s(%d)\n", __func__, onoff);
381 ret = mxl111sf_enable_usb_output(state);
384 ret = mxl111sf_init_i2s_port(state, 200);
386 ret = mxl111sf_config_i2s(state, 0, 15);
389 ret = mxl111sf_disable_i2s_port(state);
392 if (state->chip_rev > MXL111SF_V6)
393 ret = mxl111sf_config_spi(state, onoff);
399 static int mxl111sf_ep4_streaming_ctrl(struct dvb_frontend *fe, int onoff)
401 struct mxl111sf_state *state = fe_to_priv(fe);
404 pr_debug("%s(%d)\n", __func__, onoff);
407 ret = mxl111sf_enable_usb_output(state);
414 /* ------------------------------------------------------------------------ */
416 static struct lgdt3305_config hauppauge_lgdt3305_config = {
417 .i2c_addr = 0xb2 >> 1,
418 .mpeg_mode = LGDT3305_MPEG_SERIAL,
419 .tpclk_edge = LGDT3305_TPCLK_RISING_EDGE,
420 .tpvalid_polarity = LGDT3305_TP_VALID_HIGH,
422 .spectral_inversion = 0,
427 static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
429 struct dvb_usb_device *d = adap_to_d(adap);
430 struct mxl111sf_state *state = d_to_priv(d);
431 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
434 pr_debug("%s()\n", __func__);
436 /* save a pointer to the dvb_usb_device in device state */
438 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
439 state->alt_mode = adap_state->alt_mode;
441 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
442 pr_err("set interface failed");
444 state->gpio_mode = MXL111SF_GPIO_MOD_ATSC;
445 adap_state->gpio_mode = state->gpio_mode;
446 adap_state->device_mode = MXL_TUNER_MODE;
447 adap_state->ep6_clockphase = 1;
449 ret = mxl1x1sf_soft_reset(state);
452 ret = mxl111sf_init_tuner_demod(state);
456 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
460 ret = mxl111sf_enable_usb_output(state);
463 ret = mxl1x1sf_top_master_ctrl(state, 1);
467 ret = mxl111sf_init_port_expander(state);
470 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
474 adap->fe[fe_id] = dvb_attach(lgdt3305_attach,
475 &hauppauge_lgdt3305_config,
477 if (adap->fe[fe_id]) {
478 state->num_frontends++;
479 adap_state->fe_init = adap->fe[fe_id]->ops.init;
480 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
481 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
482 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
490 static struct lg2160_config hauppauge_lg2160_config = {
492 .i2c_addr = 0x1c >> 1,
494 .spectral_inversion = 0,
498 static int mxl111sf_lg2160_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
500 struct dvb_usb_device *d = adap_to_d(adap);
501 struct mxl111sf_state *state = d_to_priv(d);
502 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
505 pr_debug("%s()\n", __func__);
507 /* save a pointer to the dvb_usb_device in device state */
509 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
510 state->alt_mode = adap_state->alt_mode;
512 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
513 pr_err("set interface failed");
515 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
516 adap_state->gpio_mode = state->gpio_mode;
517 adap_state->device_mode = MXL_TUNER_MODE;
518 adap_state->ep6_clockphase = 1;
520 ret = mxl1x1sf_soft_reset(state);
523 ret = mxl111sf_init_tuner_demod(state);
527 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
531 ret = mxl111sf_enable_usb_output(state);
534 ret = mxl1x1sf_top_master_ctrl(state, 1);
538 ret = mxl111sf_init_port_expander(state);
541 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
545 ret = get_chip_info(state);
549 adap->fe[fe_id] = dvb_attach(lg2160_attach,
550 &hauppauge_lg2160_config,
552 if (adap->fe[fe_id]) {
553 state->num_frontends++;
554 adap_state->fe_init = adap->fe[fe_id]->ops.init;
555 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
556 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
557 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
565 static struct lg2160_config hauppauge_lg2161_1019_config = {
566 .lg_chip = LG2161_1019,
567 .i2c_addr = 0x1c >> 1,
569 .spectral_inversion = 0,
571 .output_if = 2, /* LG2161_OIF_SPI_MAS */
574 static struct lg2160_config hauppauge_lg2161_1040_config = {
575 .lg_chip = LG2161_1040,
576 .i2c_addr = 0x1c >> 1,
578 .spectral_inversion = 0,
580 .output_if = 4, /* LG2161_OIF_SPI_MAS */
583 static int mxl111sf_lg2161_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
585 struct dvb_usb_device *d = adap_to_d(adap);
586 struct mxl111sf_state *state = d_to_priv(d);
587 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
590 pr_debug("%s()\n", __func__);
592 /* save a pointer to the dvb_usb_device in device state */
594 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
595 state->alt_mode = adap_state->alt_mode;
597 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
598 pr_err("set interface failed");
600 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
601 adap_state->gpio_mode = state->gpio_mode;
602 adap_state->device_mode = MXL_TUNER_MODE;
603 adap_state->ep6_clockphase = 1;
605 ret = mxl1x1sf_soft_reset(state);
608 ret = mxl111sf_init_tuner_demod(state);
612 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
616 ret = mxl111sf_enable_usb_output(state);
619 ret = mxl1x1sf_top_master_ctrl(state, 1);
623 ret = mxl111sf_init_port_expander(state);
626 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
630 ret = get_chip_info(state);
634 adap->fe[fe_id] = dvb_attach(lg2160_attach,
635 (MXL111SF_V8_200 == state->chip_rev) ?
636 &hauppauge_lg2161_1040_config :
637 &hauppauge_lg2161_1019_config,
639 if (adap->fe[fe_id]) {
640 state->num_frontends++;
641 adap_state->fe_init = adap->fe[fe_id]->ops.init;
642 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
643 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
644 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
652 static struct lg2160_config hauppauge_lg2161_1019_ep6_config = {
653 .lg_chip = LG2161_1019,
654 .i2c_addr = 0x1c >> 1,
656 .spectral_inversion = 0,
658 .output_if = 1, /* LG2161_OIF_SERIAL_TS */
661 static struct lg2160_config hauppauge_lg2161_1040_ep6_config = {
662 .lg_chip = LG2161_1040,
663 .i2c_addr = 0x1c >> 1,
665 .spectral_inversion = 0,
667 .output_if = 7, /* LG2161_OIF_SERIAL_TS */
670 static int mxl111sf_lg2161_ep6_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id)
672 struct dvb_usb_device *d = adap_to_d(adap);
673 struct mxl111sf_state *state = d_to_priv(d);
674 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
677 pr_debug("%s()\n", __func__);
679 /* save a pointer to the dvb_usb_device in device state */
681 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1;
682 state->alt_mode = adap_state->alt_mode;
684 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
685 pr_err("set interface failed");
687 state->gpio_mode = MXL111SF_GPIO_MOD_MH;
688 adap_state->gpio_mode = state->gpio_mode;
689 adap_state->device_mode = MXL_TUNER_MODE;
690 adap_state->ep6_clockphase = 0;
692 ret = mxl1x1sf_soft_reset(state);
695 ret = mxl111sf_init_tuner_demod(state);
699 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
703 ret = mxl111sf_enable_usb_output(state);
706 ret = mxl1x1sf_top_master_ctrl(state, 1);
710 ret = mxl111sf_init_port_expander(state);
713 ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode);
717 ret = get_chip_info(state);
721 adap->fe[fe_id] = dvb_attach(lg2160_attach,
722 (MXL111SF_V8_200 == state->chip_rev) ?
723 &hauppauge_lg2161_1040_ep6_config :
724 &hauppauge_lg2161_1019_ep6_config,
726 if (adap->fe[fe_id]) {
727 state->num_frontends++;
728 adap_state->fe_init = adap->fe[fe_id]->ops.init;
729 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
730 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
731 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
739 static const struct mxl111sf_demod_config mxl_demod_config = {
740 .read_reg = mxl111sf_read_reg,
741 .write_reg = mxl111sf_write_reg,
742 .program_regs = mxl111sf_ctrl_program_regs,
745 static int mxl111sf_attach_demod(struct dvb_usb_adapter *adap, u8 fe_id)
747 struct dvb_usb_device *d = adap_to_d(adap);
748 struct mxl111sf_state *state = d_to_priv(d);
749 struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id];
752 pr_debug("%s()\n", __func__);
754 /* save a pointer to the dvb_usb_device in device state */
756 adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 1 : 2;
757 state->alt_mode = adap_state->alt_mode;
759 if (usb_set_interface(d->udev, 0, state->alt_mode) < 0)
760 pr_err("set interface failed");
762 state->gpio_mode = MXL111SF_GPIO_MOD_DVBT;
763 adap_state->gpio_mode = state->gpio_mode;
764 adap_state->device_mode = MXL_SOC_MODE;
765 adap_state->ep6_clockphase = 1;
767 ret = mxl1x1sf_soft_reset(state);
770 ret = mxl111sf_init_tuner_demod(state);
774 ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode);
778 ret = mxl111sf_enable_usb_output(state);
781 ret = mxl1x1sf_top_master_ctrl(state, 1);
785 /* dont care if this fails */
786 mxl111sf_init_port_expander(state);
788 adap->fe[fe_id] = dvb_attach(mxl111sf_demod_attach, state,
790 if (adap->fe[fe_id]) {
791 state->num_frontends++;
792 adap_state->fe_init = adap->fe[fe_id]->ops.init;
793 adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init;
794 adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep;
795 adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep;
803 static inline int mxl111sf_set_ant_path(struct mxl111sf_state *state,
806 return mxl111sf_idac_config(state, 1, 1,
807 (antpath == ANT_PATH_INTERNAL) ?
811 #define DbgAntHunt(x, pwr0, pwr1, pwr2, pwr3) \
812 pr_err("%s(%d) FINAL input set to %s rxPwr:%d|%d|%d|%d\n", \
813 __func__, __LINE__, \
814 (ANT_PATH_EXTERNAL == x) ? "EXTERNAL" : "INTERNAL", \
815 pwr0, pwr1, pwr2, pwr3)
817 #define ANT_HUNT_SLEEP 90
818 #define ANT_EXT_TWEAK 0
820 static int mxl111sf_ant_hunt(struct dvb_frontend *fe)
822 struct mxl111sf_state *state = fe_to_priv(fe);
823 int antctrl = dvb_usb_mxl111sf_rfswitch;
825 u16 rxPwrA, rxPwr0, rxPwr1, rxPwr2;
827 /* FIXME: must force EXTERNAL for QAM - done elsewhere */
828 mxl111sf_set_ant_path(state, antctrl == ANT_PATH_AUTO ?
829 ANT_PATH_EXTERNAL : antctrl);
831 if (antctrl == ANT_PATH_AUTO) {
833 msleep(ANT_HUNT_SLEEP);
835 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwrA);
837 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
838 msleep(ANT_HUNT_SLEEP);
839 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr0);
841 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
842 msleep(ANT_HUNT_SLEEP);
843 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr1);
845 mxl111sf_set_ant_path(state, ANT_PATH_INTERNAL);
846 msleep(ANT_HUNT_SLEEP);
847 fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr2);
849 if (rxPwr1+ANT_EXT_TWEAK >= rxPwr2) {
850 /* return with EXTERNAL enabled */
851 mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL);
852 DbgAntHunt(ANT_PATH_EXTERNAL, rxPwrA,
853 rxPwr0, rxPwr1, rxPwr2);
855 /* return with INTERNAL enabled */
856 DbgAntHunt(ANT_PATH_INTERNAL, rxPwrA,
857 rxPwr0, rxPwr1, rxPwr2);
863 static const struct mxl111sf_tuner_config mxl_tuner_config = {
864 .if_freq = MXL_IF_6_0, /* applies to external IF output, only */
865 .invert_spectrum = 0,
866 .read_reg = mxl111sf_read_reg,
867 .write_reg = mxl111sf_write_reg,
868 .program_regs = mxl111sf_ctrl_program_regs,
869 .top_master_ctrl = mxl1x1sf_top_master_ctrl,
870 .ant_hunt = mxl111sf_ant_hunt,
873 static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
875 struct mxl111sf_state *state = adap_to_priv(adap);
876 #ifdef CONFIG_MEDIA_CONTROLLER_DVB
877 struct media_device *mdev = dvb_get_media_controller(&adap->dvb_adap);
882 pr_debug("%s()\n", __func__);
884 for (i = 0; i < state->num_frontends; i++) {
885 if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
886 &mxl_tuner_config) == NULL)
888 adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
891 #ifdef CONFIG_MEDIA_CONTROLLER_DVB
892 state->tuner.function = MEDIA_ENT_F_TUNER;
893 state->tuner.name = "mxl111sf tuner";
894 state->tuner_pads[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK;
895 state->tuner_pads[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE;
897 ret = media_entity_pads_init(&state->tuner,
898 TUNER_NUM_PADS, state->tuner_pads);
902 ret = media_device_register_entity(mdev, &state->tuner);
909 static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
914 static struct i2c_algorithm mxl111sf_i2c_algo = {
915 .master_xfer = mxl111sf_i2c_xfer,
916 .functionality = mxl111sf_i2c_func,
917 #ifdef NEED_ALGO_CONTROL
918 .algo_control = dummy_algo_control,
922 static int mxl111sf_init(struct dvb_usb_device *d)
924 struct mxl111sf_state *state = d_to_priv(d);
926 static u8 eeprom[256];
929 mutex_init(&state->msg_lock);
931 ret = get_chip_info(state);
933 pr_err("failed to get chip info during probe");
935 mutex_init(&state->fe_lock);
937 if (state->chip_rev > MXL111SF_V6)
938 mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1);
940 c.adapter = &d->i2c_adap;
943 ret = tveeprom_read(&c, eeprom, sizeof(eeprom));
946 tveeprom_hauppauge_analog(&c, &state->tv, (0x84 == eeprom[0xa0]) ?
947 eeprom + 0xa0 : eeprom + 0x80);
949 switch (state->tv.model) {
955 printk(KERN_WARNING "%s: warning: "
956 "unknown hauppauge model #%d\n",
957 __func__, state->tv.model);
963 static int mxl111sf_frontend_attach_dvbt(struct dvb_usb_adapter *adap)
965 return mxl111sf_attach_demod(adap, 0);
968 static int mxl111sf_frontend_attach_atsc(struct dvb_usb_adapter *adap)
970 return mxl111sf_lgdt3305_frontend_attach(adap, 0);
973 static int mxl111sf_frontend_attach_mh(struct dvb_usb_adapter *adap)
975 return mxl111sf_lg2160_frontend_attach(adap, 0);
978 static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter *adap)
981 pr_debug("%s\n", __func__);
983 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
987 ret = mxl111sf_attach_demod(adap, 1);
991 ret = mxl111sf_lg2160_frontend_attach(adap, 2);
998 static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter *adap)
1001 pr_debug("%s\n", __func__);
1003 ret = mxl111sf_lgdt3305_frontend_attach(adap, 0);
1007 ret = mxl111sf_attach_demod(adap, 1);
1011 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 2);
1018 static int mxl111sf_frontend_attach_mercury_mh(struct dvb_usb_adapter *adap)
1021 pr_debug("%s\n", __func__);
1023 ret = mxl111sf_attach_demod(adap, 0);
1027 if (dvb_usb_mxl111sf_spi)
1028 ret = mxl111sf_lg2161_frontend_attach(adap, 1);
1030 ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 1);
1035 static void mxl111sf_stream_config_bulk(struct usb_data_stream_properties *stream, u8 endpoint)
1037 pr_debug("%s: endpoint=%d size=8192\n", __func__, endpoint);
1038 stream->type = USB_BULK;
1040 stream->endpoint = endpoint;
1041 stream->u.bulk.buffersize = 8192;
1044 static void mxl111sf_stream_config_isoc(struct usb_data_stream_properties *stream,
1045 u8 endpoint, int framesperurb, int framesize)
1047 pr_debug("%s: endpoint=%d size=%d\n", __func__, endpoint,
1048 framesperurb * framesize);
1049 stream->type = USB_ISOC;
1051 stream->endpoint = endpoint;
1052 stream->u.isoc.framesperurb = framesperurb;
1053 stream->u.isoc.framesize = framesize;
1054 stream->u.isoc.interval = 1;
1057 /* DVB USB Driver stuff */
1060 * bulk EP4/BULK/5/8192
1061 * isoc EP4/ISOC/5/96/564
1063 static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe,
1064 u8 *ts_type, struct usb_data_stream_properties *stream)
1066 pr_debug("%s: fe=%d\n", __func__, fe->id);
1068 *ts_type = DVB_USB_FE_TS_TYPE_188;
1069 if (dvb_usb_mxl111sf_isoc)
1070 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1072 mxl111sf_stream_config_bulk(stream, 4);
1076 static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
1077 .driver_name = KBUILD_MODNAME,
1078 .owner = THIS_MODULE,
1079 .adapter_nr = adapter_nr,
1080 .size_of_priv = sizeof(struct mxl111sf_state),
1082 .generic_bulk_ctrl_endpoint = 0x02,
1083 .generic_bulk_ctrl_endpoint_response = 0x81,
1085 .i2c_algo = &mxl111sf_i2c_algo,
1086 .frontend_attach = mxl111sf_frontend_attach_dvbt,
1087 .tuner_attach = mxl111sf_attach_tuner,
1088 .init = mxl111sf_init,
1089 .streaming_ctrl = mxl111sf_ep4_streaming_ctrl,
1090 .get_stream_config = mxl111sf_get_stream_config_dvbt,
1095 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1101 * bulk EP6/BULK/5/8192
1102 * isoc EP6/ISOC/5/24/3072
1104 static int mxl111sf_get_stream_config_atsc(struct dvb_frontend *fe,
1105 u8 *ts_type, struct usb_data_stream_properties *stream)
1107 pr_debug("%s: fe=%d\n", __func__, fe->id);
1109 *ts_type = DVB_USB_FE_TS_TYPE_188;
1110 if (dvb_usb_mxl111sf_isoc)
1111 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1113 mxl111sf_stream_config_bulk(stream, 6);
1117 static struct dvb_usb_device_properties mxl111sf_props_atsc = {
1118 .driver_name = KBUILD_MODNAME,
1119 .owner = THIS_MODULE,
1120 .adapter_nr = adapter_nr,
1121 .size_of_priv = sizeof(struct mxl111sf_state),
1123 .generic_bulk_ctrl_endpoint = 0x02,
1124 .generic_bulk_ctrl_endpoint_response = 0x81,
1126 .i2c_algo = &mxl111sf_i2c_algo,
1127 .frontend_attach = mxl111sf_frontend_attach_atsc,
1128 .tuner_attach = mxl111sf_attach_tuner,
1129 .init = mxl111sf_init,
1130 .streaming_ctrl = mxl111sf_ep6_streaming_ctrl,
1131 .get_stream_config = mxl111sf_get_stream_config_atsc,
1136 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1142 * bulk EP5/BULK/5/8192/RAW
1143 * isoc EP5/ISOC/5/96/200/RAW
1145 static int mxl111sf_get_stream_config_mh(struct dvb_frontend *fe,
1146 u8 *ts_type, struct usb_data_stream_properties *stream)
1148 pr_debug("%s: fe=%d\n", __func__, fe->id);
1150 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1151 if (dvb_usb_mxl111sf_isoc)
1152 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1154 mxl111sf_stream_config_bulk(stream, 5);
1158 static struct dvb_usb_device_properties mxl111sf_props_mh = {
1159 .driver_name = KBUILD_MODNAME,
1160 .owner = THIS_MODULE,
1161 .adapter_nr = adapter_nr,
1162 .size_of_priv = sizeof(struct mxl111sf_state),
1164 .generic_bulk_ctrl_endpoint = 0x02,
1165 .generic_bulk_ctrl_endpoint_response = 0x81,
1167 .i2c_algo = &mxl111sf_i2c_algo,
1168 .frontend_attach = mxl111sf_frontend_attach_mh,
1169 .tuner_attach = mxl111sf_attach_tuner,
1170 .init = mxl111sf_init,
1171 .streaming_ctrl = mxl111sf_ep5_streaming_ctrl,
1172 .get_stream_config = mxl111sf_get_stream_config_mh,
1177 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1182 /* atsc mh lgdt3305 mxl111sf lg2160
1183 * bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1184 * isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1186 static int mxl111sf_get_stream_config_atsc_mh(struct dvb_frontend *fe,
1187 u8 *ts_type, struct usb_data_stream_properties *stream)
1189 pr_debug("%s: fe=%d\n", __func__, fe->id);
1192 *ts_type = DVB_USB_FE_TS_TYPE_188;
1193 if (dvb_usb_mxl111sf_isoc)
1194 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1196 mxl111sf_stream_config_bulk(stream, 6);
1197 } else if (fe->id == 1) {
1198 *ts_type = DVB_USB_FE_TS_TYPE_188;
1199 if (dvb_usb_mxl111sf_isoc)
1200 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1202 mxl111sf_stream_config_bulk(stream, 4);
1203 } else if (fe->id == 2) {
1204 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1205 if (dvb_usb_mxl111sf_isoc)
1206 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1208 mxl111sf_stream_config_bulk(stream, 5);
1213 static int mxl111sf_streaming_ctrl_atsc_mh(struct dvb_frontend *fe, int onoff)
1215 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1218 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1219 else if (fe->id == 1)
1220 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1221 else if (fe->id == 2)
1222 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1226 static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
1227 .driver_name = KBUILD_MODNAME,
1228 .owner = THIS_MODULE,
1229 .adapter_nr = adapter_nr,
1230 .size_of_priv = sizeof(struct mxl111sf_state),
1232 .generic_bulk_ctrl_endpoint = 0x02,
1233 .generic_bulk_ctrl_endpoint_response = 0x81,
1235 .i2c_algo = &mxl111sf_i2c_algo,
1236 .frontend_attach = mxl111sf_frontend_attach_atsc_mh,
1237 .tuner_attach = mxl111sf_attach_tuner,
1238 .init = mxl111sf_init,
1239 .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh,
1240 .get_stream_config = mxl111sf_get_stream_config_atsc_mh,
1245 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1250 /* mercury lgdt3305 mxl111sf lg2161
1251 * tp bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1252 * tp isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1253 * spi bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1254 * spi isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1256 static int mxl111sf_get_stream_config_mercury(struct dvb_frontend *fe,
1257 u8 *ts_type, struct usb_data_stream_properties *stream)
1259 pr_debug("%s: fe=%d\n", __func__, fe->id);
1262 *ts_type = DVB_USB_FE_TS_TYPE_188;
1263 if (dvb_usb_mxl111sf_isoc)
1264 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1266 mxl111sf_stream_config_bulk(stream, 6);
1267 } else if (fe->id == 1) {
1268 *ts_type = DVB_USB_FE_TS_TYPE_188;
1269 if (dvb_usb_mxl111sf_isoc)
1270 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1272 mxl111sf_stream_config_bulk(stream, 4);
1273 } else if (fe->id == 2 && dvb_usb_mxl111sf_spi) {
1274 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1275 if (dvb_usb_mxl111sf_isoc)
1276 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1278 mxl111sf_stream_config_bulk(stream, 5);
1279 } else if (fe->id == 2 && !dvb_usb_mxl111sf_spi) {
1280 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1281 if (dvb_usb_mxl111sf_isoc)
1282 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1284 mxl111sf_stream_config_bulk(stream, 6);
1289 static int mxl111sf_streaming_ctrl_mercury(struct dvb_frontend *fe, int onoff)
1291 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1294 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1295 else if (fe->id == 1)
1296 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1297 else if (fe->id == 2 && dvb_usb_mxl111sf_spi)
1298 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1299 else if (fe->id == 2 && !dvb_usb_mxl111sf_spi)
1300 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1304 static struct dvb_usb_device_properties mxl111sf_props_mercury = {
1305 .driver_name = KBUILD_MODNAME,
1306 .owner = THIS_MODULE,
1307 .adapter_nr = adapter_nr,
1308 .size_of_priv = sizeof(struct mxl111sf_state),
1310 .generic_bulk_ctrl_endpoint = 0x02,
1311 .generic_bulk_ctrl_endpoint_response = 0x81,
1313 .i2c_algo = &mxl111sf_i2c_algo,
1314 .frontend_attach = mxl111sf_frontend_attach_mercury,
1315 .tuner_attach = mxl111sf_attach_tuner,
1316 .init = mxl111sf_init,
1317 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury,
1318 .get_stream_config = mxl111sf_get_stream_config_mercury,
1323 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1328 /* mercury mh mxl111sf lg2161
1329 * tp bulk EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1330 * tp isoc EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1331 * spi bulk EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1332 * spi isoc EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1334 static int mxl111sf_get_stream_config_mercury_mh(struct dvb_frontend *fe,
1335 u8 *ts_type, struct usb_data_stream_properties *stream)
1337 pr_debug("%s: fe=%d\n", __func__, fe->id);
1340 *ts_type = DVB_USB_FE_TS_TYPE_188;
1341 if (dvb_usb_mxl111sf_isoc)
1342 mxl111sf_stream_config_isoc(stream, 4, 96, 564);
1344 mxl111sf_stream_config_bulk(stream, 4);
1345 } else if (fe->id == 1 && dvb_usb_mxl111sf_spi) {
1346 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1347 if (dvb_usb_mxl111sf_isoc)
1348 mxl111sf_stream_config_isoc(stream, 5, 96, 200);
1350 mxl111sf_stream_config_bulk(stream, 5);
1351 } else if (fe->id == 1 && !dvb_usb_mxl111sf_spi) {
1352 *ts_type = DVB_USB_FE_TS_TYPE_RAW;
1353 if (dvb_usb_mxl111sf_isoc)
1354 mxl111sf_stream_config_isoc(stream, 6, 24, 3072);
1356 mxl111sf_stream_config_bulk(stream, 6);
1361 static int mxl111sf_streaming_ctrl_mercury_mh(struct dvb_frontend *fe, int onoff)
1363 pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
1366 return mxl111sf_ep4_streaming_ctrl(fe, onoff);
1367 else if (fe->id == 1 && dvb_usb_mxl111sf_spi)
1368 return mxl111sf_ep5_streaming_ctrl(fe, onoff);
1369 else if (fe->id == 1 && !dvb_usb_mxl111sf_spi)
1370 return mxl111sf_ep6_streaming_ctrl(fe, onoff);
1374 static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
1375 .driver_name = KBUILD_MODNAME,
1376 .owner = THIS_MODULE,
1377 .adapter_nr = adapter_nr,
1378 .size_of_priv = sizeof(struct mxl111sf_state),
1380 .generic_bulk_ctrl_endpoint = 0x02,
1381 .generic_bulk_ctrl_endpoint_response = 0x81,
1383 .i2c_algo = &mxl111sf_i2c_algo,
1384 .frontend_attach = mxl111sf_frontend_attach_mercury_mh,
1385 .tuner_attach = mxl111sf_attach_tuner,
1386 .init = mxl111sf_init,
1387 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh,
1388 .get_stream_config = mxl111sf_get_stream_config_mercury_mh,
1393 .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1398 static const struct usb_device_id mxl111sf_id_table[] = {
1399 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc600, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1400 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc601, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1401 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc602, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1402 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc603, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1403 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc604, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1404 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc609, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1405 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60a, &mxl111sf_props_mh, "HCW 126xxx", NULL) },
1406 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1407 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60c, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) },
1408 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc653, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1409 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc65b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) },
1410 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb700, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1411 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb701, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) },
1412 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb702, &mxl111sf_props_mh, "HCW 117xxx", NULL) },
1413 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb703, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1414 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb704, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1415 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb753, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1416 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb763, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1417 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb764, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) },
1418 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd853, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1419 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd854, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1420 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd863, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1421 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd864, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1422 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1423 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1424 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1425 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) },
1426 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8ff, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) },
1427 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc612, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1428 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc613, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1429 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61a, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) },
1430 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61b, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) },
1431 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb757, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1432 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb767, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) },
1435 MODULE_DEVICE_TABLE(usb, mxl111sf_id_table);
1437 static struct usb_driver mxl111sf_usb_driver = {
1438 .name = KBUILD_MODNAME,
1439 .id_table = mxl111sf_id_table,
1440 .probe = dvb_usbv2_probe,
1441 .disconnect = dvb_usbv2_disconnect,
1442 .suspend = dvb_usbv2_suspend,
1443 .resume = dvb_usbv2_resume,
1448 module_usb_driver(mxl111sf_usb_driver);
1450 MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
1451 MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF");
1452 MODULE_VERSION("1.0");
1453 MODULE_LICENSE("GPL");