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
)
882 static int mxl111sf_fe_ioctl_override(struct dvb_frontend
*fe
,
883 unsigned int cmd
, void *parg
,
889 case DVB_FE_IOCTL_PRE
:
892 case FE_READ_SIGNAL_STRENGTH
:
893 err
= fe
->ops
.tuner_ops
.get_rf_strength(fe
, parg
);
894 /* If no error occurs, prevent dvb-core from handling
895 * this IOCTL, otherwise return the error */
902 case DVB_FE_IOCTL_POST
:
903 /* no post-ioctl handling required */
909 static u32
mxl111sf_i2c_func(struct i2c_adapter
*adapter
)
914 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 ret
= get_chip_info(state
);
931 err("failed to get chip info during probe");
933 mutex_init(&state
->fe_lock
);
935 if (state
->chip_rev
> MXL111SF_V6
)
936 mxl111sf_config_pin_mux_modes(state
, PIN_MUX_TS_SPI_IN_MODE_1
);
938 c
.adapter
= &d
->i2c_adap
;
941 ret
= tveeprom_read(&c
, eeprom
, sizeof(eeprom
));
944 tveeprom_hauppauge_analog(&c
, &state
->tv
, (0x84 == eeprom
[0xa0]) ?
945 eeprom
+ 0xa0 : eeprom
+ 0x80);
947 switch (state
->tv
.model
) {
953 printk(KERN_WARNING
"%s: warning: "
954 "unknown hauppauge model #%d\n",
955 __func__
, state
->tv
.model
);
961 static int mxl111sf_frontend_attach_dvbt(struct dvb_usb_adapter
*adap
)
963 return mxl111sf_attach_demod(adap
, 0);
966 static int mxl111sf_frontend_attach_atsc(struct dvb_usb_adapter
*adap
)
968 return mxl111sf_lgdt3305_frontend_attach(adap
, 0);
971 static int mxl111sf_frontend_attach_mh(struct dvb_usb_adapter
*adap
)
973 return mxl111sf_lg2160_frontend_attach(adap
, 0);
976 static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter
*adap
)
979 deb_info("%s\n", __func__
);
981 ret
= mxl111sf_lgdt3305_frontend_attach(adap
, 0);
985 ret
= mxl111sf_attach_demod(adap
, 1);
989 ret
= mxl111sf_lg2160_frontend_attach(adap
, 2);
996 static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter
*adap
)
999 deb_info("%s\n", __func__
);
1001 ret
= mxl111sf_lgdt3305_frontend_attach(adap
, 0);
1005 ret
= mxl111sf_attach_demod(adap
, 1);
1009 ret
= mxl111sf_lg2161_ep6_frontend_attach(adap
, 2);
1016 static int mxl111sf_frontend_attach_mercury_mh(struct dvb_usb_adapter
*adap
)
1019 deb_info("%s\n", __func__
);
1021 ret
= mxl111sf_attach_demod(adap
, 0);
1025 if (dvb_usb_mxl111sf_spi
)
1026 ret
= mxl111sf_lg2161_frontend_attach(adap
, 1);
1028 ret
= mxl111sf_lg2161_ep6_frontend_attach(adap
, 1);
1033 static void mxl111sf_stream_config_bulk(struct usb_data_stream_properties
*stream
, u8 endpoint
)
1035 deb_info("%s: endpoint=%d size=8192\n", __func__
, endpoint
);
1036 stream
->type
= USB_BULK
;
1038 stream
->endpoint
= endpoint
;
1039 stream
->u
.bulk
.buffersize
= 8192;
1042 static void mxl111sf_stream_config_isoc(struct usb_data_stream_properties
*stream
,
1043 u8 endpoint
, int framesperurb
, int framesize
)
1045 deb_info("%s: endpoint=%d size=%d\n", __func__
, endpoint
,
1046 framesperurb
* framesize
);
1047 stream
->type
= USB_ISOC
;
1049 stream
->endpoint
= endpoint
;
1050 stream
->u
.isoc
.framesperurb
= framesperurb
;
1051 stream
->u
.isoc
.framesize
= framesize
;
1052 stream
->u
.isoc
.interval
= 1;
1055 /* DVB USB Driver stuff */
1058 * bulk EP4/BULK/5/8192
1059 * isoc EP4/ISOC/5/96/564
1061 static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend
*fe
,
1062 u8
*ts_type
, struct usb_data_stream_properties
*stream
)
1064 deb_info("%s: fe=%d\n", __func__
, fe
->id
);
1066 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1067 if (dvb_usb_mxl111sf_isoc
)
1068 mxl111sf_stream_config_isoc(stream
, 4, 96, 564);
1070 mxl111sf_stream_config_bulk(stream
, 4);
1074 static struct dvb_usb_device_properties mxl111sf_props_dvbt
= {
1075 .driver_name
= KBUILD_MODNAME
,
1076 .owner
= THIS_MODULE
,
1077 .adapter_nr
= adapter_nr
,
1078 .size_of_priv
= sizeof(struct mxl111sf_state
),
1080 .generic_bulk_ctrl_endpoint
= 0x02,
1081 .generic_bulk_ctrl_endpoint_response
= 0x81,
1083 .i2c_algo
= &mxl111sf_i2c_algo
,
1084 .frontend_attach
= mxl111sf_frontend_attach_dvbt
,
1085 .tuner_attach
= mxl111sf_attach_tuner
,
1086 .init
= mxl111sf_init
,
1087 .streaming_ctrl
= mxl111sf_ep4_streaming_ctrl
,
1088 .get_stream_config
= mxl111sf_get_stream_config_dvbt
,
1089 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
1094 .stream
= DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1100 * bulk EP6/BULK/5/8192
1101 * isoc EP6/ISOC/5/24/3072
1103 static int mxl111sf_get_stream_config_atsc(struct dvb_frontend
*fe
,
1104 u8
*ts_type
, struct usb_data_stream_properties
*stream
)
1106 deb_info("%s: fe=%d\n", __func__
, fe
->id
);
1108 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1109 if (dvb_usb_mxl111sf_isoc
)
1110 mxl111sf_stream_config_isoc(stream
, 6, 24, 3072);
1112 mxl111sf_stream_config_bulk(stream
, 6);
1116 static struct dvb_usb_device_properties mxl111sf_props_atsc
= {
1117 .driver_name
= KBUILD_MODNAME
,
1118 .owner
= THIS_MODULE
,
1119 .adapter_nr
= adapter_nr
,
1120 .size_of_priv
= sizeof(struct mxl111sf_state
),
1122 .generic_bulk_ctrl_endpoint
= 0x02,
1123 .generic_bulk_ctrl_endpoint_response
= 0x81,
1125 .i2c_algo
= &mxl111sf_i2c_algo
,
1126 .frontend_attach
= mxl111sf_frontend_attach_atsc
,
1127 .tuner_attach
= mxl111sf_attach_tuner
,
1128 .init
= mxl111sf_init
,
1129 .streaming_ctrl
= mxl111sf_ep6_streaming_ctrl
,
1130 .get_stream_config
= mxl111sf_get_stream_config_atsc
,
1131 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
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 deb_info("%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
,
1173 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
1178 .stream
= DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1183 /* atsc mh lgdt3305 mxl111sf lg2160
1184 * bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1185 * isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1187 static int mxl111sf_get_stream_config_atsc_mh(struct dvb_frontend
*fe
,
1188 u8
*ts_type
, struct usb_data_stream_properties
*stream
)
1190 deb_info("%s: fe=%d\n", __func__
, fe
->id
);
1193 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1194 if (dvb_usb_mxl111sf_isoc
)
1195 mxl111sf_stream_config_isoc(stream
, 6, 24, 3072);
1197 mxl111sf_stream_config_bulk(stream
, 6);
1198 } else if (fe
->id
== 1) {
1199 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1200 if (dvb_usb_mxl111sf_isoc
)
1201 mxl111sf_stream_config_isoc(stream
, 4, 96, 564);
1203 mxl111sf_stream_config_bulk(stream
, 4);
1204 } else if (fe
->id
== 2) {
1205 *ts_type
= DVB_USB_FE_TS_TYPE_RAW
;
1206 if (dvb_usb_mxl111sf_isoc
)
1207 mxl111sf_stream_config_isoc(stream
, 5, 96, 200);
1209 mxl111sf_stream_config_bulk(stream
, 5);
1214 static int mxl111sf_streaming_ctrl_atsc_mh(struct dvb_frontend
*fe
, int onoff
)
1216 deb_info("%s: fe=%d onoff=%d\n", __func__
, fe
->id
, onoff
);
1219 return mxl111sf_ep6_streaming_ctrl(fe
, onoff
);
1220 else if (fe
->id
== 1)
1221 return mxl111sf_ep4_streaming_ctrl(fe
, onoff
);
1222 else if (fe
->id
== 2)
1223 return mxl111sf_ep5_streaming_ctrl(fe
, onoff
);
1227 static struct dvb_usb_device_properties mxl111sf_props_atsc_mh
= {
1228 .driver_name
= KBUILD_MODNAME
,
1229 .owner
= THIS_MODULE
,
1230 .adapter_nr
= adapter_nr
,
1231 .size_of_priv
= sizeof(struct mxl111sf_state
),
1233 .generic_bulk_ctrl_endpoint
= 0x02,
1234 .generic_bulk_ctrl_endpoint_response
= 0x81,
1236 .i2c_algo
= &mxl111sf_i2c_algo
,
1237 .frontend_attach
= mxl111sf_frontend_attach_atsc_mh
,
1238 .tuner_attach
= mxl111sf_attach_tuner
,
1239 .init
= mxl111sf_init
,
1240 .streaming_ctrl
= mxl111sf_streaming_ctrl_atsc_mh
,
1241 .get_stream_config
= mxl111sf_get_stream_config_atsc_mh
,
1242 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
1247 .stream
= DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1252 /* mercury lgdt3305 mxl111sf lg2161
1253 * tp bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1254 * tp isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1255 * spi bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1256 * spi isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1258 static int mxl111sf_get_stream_config_mercury(struct dvb_frontend
*fe
,
1259 u8
*ts_type
, struct usb_data_stream_properties
*stream
)
1261 deb_info("%s: fe=%d\n", __func__
, fe
->id
);
1264 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1265 if (dvb_usb_mxl111sf_isoc
)
1266 mxl111sf_stream_config_isoc(stream
, 6, 24, 3072);
1268 mxl111sf_stream_config_bulk(stream
, 6);
1269 } else if (fe
->id
== 1) {
1270 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1271 if (dvb_usb_mxl111sf_isoc
)
1272 mxl111sf_stream_config_isoc(stream
, 4, 96, 564);
1274 mxl111sf_stream_config_bulk(stream
, 4);
1275 } else if (fe
->id
== 2 && dvb_usb_mxl111sf_spi
) {
1276 *ts_type
= DVB_USB_FE_TS_TYPE_RAW
;
1277 if (dvb_usb_mxl111sf_isoc
)
1278 mxl111sf_stream_config_isoc(stream
, 5, 96, 200);
1280 mxl111sf_stream_config_bulk(stream
, 5);
1281 } else if (fe
->id
== 2 && !dvb_usb_mxl111sf_spi
) {
1282 *ts_type
= DVB_USB_FE_TS_TYPE_RAW
;
1283 if (dvb_usb_mxl111sf_isoc
)
1284 mxl111sf_stream_config_isoc(stream
, 6, 24, 3072);
1286 mxl111sf_stream_config_bulk(stream
, 6);
1291 static int mxl111sf_streaming_ctrl_mercury(struct dvb_frontend
*fe
, int onoff
)
1293 deb_info("%s: fe=%d onoff=%d\n", __func__
, fe
->id
, onoff
);
1296 return mxl111sf_ep6_streaming_ctrl(fe
, onoff
);
1297 else if (fe
->id
== 1)
1298 return mxl111sf_ep4_streaming_ctrl(fe
, onoff
);
1299 else if (fe
->id
== 2 && dvb_usb_mxl111sf_spi
)
1300 return mxl111sf_ep5_streaming_ctrl(fe
, onoff
);
1301 else if (fe
->id
== 2 && !dvb_usb_mxl111sf_spi
)
1302 return mxl111sf_ep6_streaming_ctrl(fe
, onoff
);
1306 static struct dvb_usb_device_properties mxl111sf_props_mercury
= {
1307 .driver_name
= KBUILD_MODNAME
,
1308 .owner
= THIS_MODULE
,
1309 .adapter_nr
= adapter_nr
,
1310 .size_of_priv
= sizeof(struct mxl111sf_state
),
1312 .generic_bulk_ctrl_endpoint
= 0x02,
1313 .generic_bulk_ctrl_endpoint_response
= 0x81,
1315 .i2c_algo
= &mxl111sf_i2c_algo
,
1316 .frontend_attach
= mxl111sf_frontend_attach_mercury
,
1317 .tuner_attach
= mxl111sf_attach_tuner
,
1318 .init
= mxl111sf_init
,
1319 .streaming_ctrl
= mxl111sf_streaming_ctrl_mercury
,
1320 .get_stream_config
= mxl111sf_get_stream_config_mercury
,
1321 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
1326 .stream
= DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1331 /* mercury mh mxl111sf lg2161
1332 * tp bulk EP4/BULK/5/8192 EP6/BULK/5/8192/RAW
1333 * tp isoc EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW
1334 * spi bulk EP4/BULK/5/8192 EP5/BULK/5/8192/RAW
1335 * spi isoc EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW
1337 static int mxl111sf_get_stream_config_mercury_mh(struct dvb_frontend
*fe
,
1338 u8
*ts_type
, struct usb_data_stream_properties
*stream
)
1340 deb_info("%s: fe=%d\n", __func__
, fe
->id
);
1343 *ts_type
= DVB_USB_FE_TS_TYPE_188
;
1344 if (dvb_usb_mxl111sf_isoc
)
1345 mxl111sf_stream_config_isoc(stream
, 4, 96, 564);
1347 mxl111sf_stream_config_bulk(stream
, 4);
1348 } else if (fe
->id
== 1 && dvb_usb_mxl111sf_spi
) {
1349 *ts_type
= DVB_USB_FE_TS_TYPE_RAW
;
1350 if (dvb_usb_mxl111sf_isoc
)
1351 mxl111sf_stream_config_isoc(stream
, 5, 96, 200);
1353 mxl111sf_stream_config_bulk(stream
, 5);
1354 } else if (fe
->id
== 1 && !dvb_usb_mxl111sf_spi
) {
1355 *ts_type
= DVB_USB_FE_TS_TYPE_RAW
;
1356 if (dvb_usb_mxl111sf_isoc
)
1357 mxl111sf_stream_config_isoc(stream
, 6, 24, 3072);
1359 mxl111sf_stream_config_bulk(stream
, 6);
1364 static int mxl111sf_streaming_ctrl_mercury_mh(struct dvb_frontend
*fe
, int onoff
)
1366 deb_info("%s: fe=%d onoff=%d\n", __func__
, fe
->id
, onoff
);
1369 return mxl111sf_ep4_streaming_ctrl(fe
, onoff
);
1370 else if (fe
->id
== 1 && dvb_usb_mxl111sf_spi
)
1371 return mxl111sf_ep5_streaming_ctrl(fe
, onoff
);
1372 else if (fe
->id
== 1 && !dvb_usb_mxl111sf_spi
)
1373 return mxl111sf_ep6_streaming_ctrl(fe
, onoff
);
1377 static struct dvb_usb_device_properties mxl111sf_props_mercury_mh
= {
1378 .driver_name
= KBUILD_MODNAME
,
1379 .owner
= THIS_MODULE
,
1380 .adapter_nr
= adapter_nr
,
1381 .size_of_priv
= sizeof(struct mxl111sf_state
),
1383 .generic_bulk_ctrl_endpoint
= 0x02,
1384 .generic_bulk_ctrl_endpoint_response
= 0x81,
1386 .i2c_algo
= &mxl111sf_i2c_algo
,
1387 .frontend_attach
= mxl111sf_frontend_attach_mercury_mh
,
1388 .tuner_attach
= mxl111sf_attach_tuner
,
1389 .init
= mxl111sf_init
,
1390 .streaming_ctrl
= mxl111sf_streaming_ctrl_mercury_mh
,
1391 .get_stream_config
= mxl111sf_get_stream_config_mercury_mh
,
1392 .fe_ioctl_override
= mxl111sf_fe_ioctl_override
,
1397 .stream
= DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1),
1402 static const struct usb_device_id mxl111sf_id_table
[] = {
1403 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc600, &mxl111sf_props_atsc_mh
, "Hauppauge 126xxx ATSC+", NULL
) },
1404 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc601, &mxl111sf_props_atsc
, "Hauppauge 126xxx ATSC", NULL
) },
1405 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc602, &mxl111sf_props_mh
, "HCW 126xxx", NULL
) },
1406 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc603, &mxl111sf_props_atsc_mh
, "Hauppauge 126xxx ATSC+", NULL
) },
1407 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc604, &mxl111sf_props_dvbt
, "Hauppauge 126xxx DVBT", NULL
) },
1408 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc609, &mxl111sf_props_atsc
, "Hauppauge 126xxx ATSC", NULL
) },
1409 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc60a, &mxl111sf_props_mh
, "HCW 126xxx", NULL
) },
1410 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc60b, &mxl111sf_props_atsc_mh
, "Hauppauge 126xxx ATSC+", NULL
) },
1411 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc60c, &mxl111sf_props_dvbt
, "Hauppauge 126xxx DVBT", NULL
) },
1412 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc653, &mxl111sf_props_atsc_mh
, "Hauppauge 126xxx ATSC+", NULL
) },
1413 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc65b, &mxl111sf_props_atsc_mh
, "Hauppauge 126xxx ATSC+", NULL
) },
1414 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb700, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1415 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb701, &mxl111sf_props_atsc
, "Hauppauge 126xxx ATSC", NULL
) },
1416 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb702, &mxl111sf_props_mh
, "HCW 117xxx", NULL
) },
1417 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb703, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1418 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb704, &mxl111sf_props_dvbt
, "Hauppauge 117xxx DVBT", NULL
) },
1419 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb753, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1420 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb763, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1421 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb764, &mxl111sf_props_dvbt
, "Hauppauge 117xxx DVBT", NULL
) },
1422 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd853, &mxl111sf_props_mercury
, "Hauppauge Mercury", NULL
) },
1423 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd854, &mxl111sf_props_dvbt
, "Hauppauge 138xxx DVBT", NULL
) },
1424 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd863, &mxl111sf_props_mercury
, "Hauppauge Mercury", NULL
) },
1425 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd864, &mxl111sf_props_dvbt
, "Hauppauge 138xxx DVBT", NULL
) },
1426 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd8d3, &mxl111sf_props_mercury
, "Hauppauge Mercury", NULL
) },
1427 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd8d4, &mxl111sf_props_dvbt
, "Hauppauge 138xxx DVBT", NULL
) },
1428 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd8e3, &mxl111sf_props_mercury
, "Hauppauge Mercury", NULL
) },
1429 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd8e4, &mxl111sf_props_dvbt
, "Hauppauge 138xxx DVBT", NULL
) },
1430 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xd8ff, &mxl111sf_props_mercury
, "Hauppauge Mercury", NULL
) },
1431 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc612, &mxl111sf_props_mercury_mh
, "Hauppauge 126xxx", NULL
) },
1432 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc613, &mxl111sf_props_mercury
, "Hauppauge WinTV-Aero-M", NULL
) },
1433 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc61a, &mxl111sf_props_mercury_mh
, "Hauppauge 126xxx", NULL
) },
1434 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xc61b, &mxl111sf_props_mercury
, "Hauppauge WinTV-Aero-M", NULL
) },
1435 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb757, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1436 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE
, 0xb767, &mxl111sf_props_atsc_mh
, "Hauppauge 117xxx ATSC+", NULL
) },
1439 MODULE_DEVICE_TABLE(usb
, mxl111sf_id_table
);
1441 static struct usb_driver mxl111sf_usb_driver
= {
1442 .name
= KBUILD_MODNAME
,
1443 .id_table
= mxl111sf_id_table
,
1444 .probe
= dvb_usbv2_probe
,
1445 .disconnect
= dvb_usbv2_disconnect
,
1446 .suspend
= dvb_usbv2_suspend
,
1447 .resume
= dvb_usbv2_resume
,
1452 module_usb_driver(mxl111sf_usb_driver
);
1454 MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>");
1455 MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF");
1456 MODULE_VERSION("1.0");
1457 MODULE_LICENSE("GPL");