1 /* DVB USB compliant linux driver for IT9137
3 * Copyright (C) 2011 Malcolm Priestley (tvboxspy@gmail.com)
4 * IT9137 (C) ITE Tech Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License Version 2, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * see Documentation/dvb/README.dvb-usb for more information
21 * see Documentation/dvb/it9137.txt for firmware information
24 #define DVB_USB_LOG_PREFIX "it913x"
26 #include <linux/usb.h>
27 #include <linux/usb/input.h>
28 #include <media/rc-core.h>
31 #include "it913x-fe.h"
34 static int dvb_usb_it913x_debug;
35 #define l_dprintk(var, level, args...) do { \
37 printk(KERN_DEBUG DVB_USB_LOG_PREFIX ": " args); \
40 #define deb_info(level, args...) l_dprintk(dvb_usb_it913x_debug, level, args)
41 #define debug_data_snipet(level, name, p) \
42 deb_info(level, name" (%02x%02x%02x%02x%02x%02x%02x%02x)", \
43 *p, *(p+1), *(p+2), *(p+3), *(p+4), \
44 *(p+5), *(p+6), *(p+7));
47 module_param_named(debug, dvb_usb_it913x_debug, int, 0644);
48 MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))."
49 DVB_USB_DEBUG_STATUS);
51 static int pid_filter;
52 module_param_named(pid, pid_filter, int, 0644);
53 MODULE_PARM_DESC(pid, "set default 0=on 1=off");
55 static int dvb_usb_it913x_firmware;
56 module_param_named(firmware, dvb_usb_it913x_firmware, int, 0644);
57 MODULE_PARM_DESC(firmware, "set firmware 0=auto 1=IT9137 2=IT9135V1");
62 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
66 struct ite_config it913x_config;
69 struct ite_config it913x_config;
71 #define IT913X_RETRY 10
72 #define IT913X_SND_TIMEOUT 100
73 #define IT913X_RCV_TIMEOUT 200
75 static int it913x_bulk_write(struct usb_device *dev,
76 u8 *snd, int len, u8 pipe)
80 for (i = 0; i < IT913X_RETRY; i++) {
81 ret = usb_bulk_msg(dev, usb_sndbulkpipe(dev, pipe),
82 snd, len , &actual_l, IT913X_SND_TIMEOUT);
83 if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
87 if (len != actual_l && ret == 0)
93 static int it913x_bulk_read(struct usb_device *dev,
94 u8 *rev, int len, u8 pipe)
98 for (i = 0; i < IT913X_RETRY; i++) {
99 ret = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, pipe),
100 rev, len , &actual_l, IT913X_RCV_TIMEOUT);
101 if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
105 if (len != actual_l && ret == 0)
111 static u16 check_sum(u8 *p, u8 len)
116 sum += (i++ & 1) ? (*p++) << 8 : *p++;
120 static int it913x_usb_talk(struct usb_device *udev, u8 mode, u8 pro,
121 u8 cmd, u32 reg, u8 addr, u8 *data, u8 len)
123 int ret = 0, i, buf_size = 1;
128 buff = kzalloc(256, GFP_KERNEL);
130 info("USB Buffer Failed");
134 buff[buf_size++] = pro;
135 buff[buf_size++] = cmd;
136 buff[buf_size++] = cmd_counter;
141 buff[buf_size++] = len;
142 buff[buf_size++] = 2;
143 buff[buf_size++] = (reg >> 24);
144 buff[buf_size++] = (reg >> 16) & 0xff;
145 buff[buf_size++] = (reg >> 8) & 0xff;
146 buff[buf_size++] = reg & 0xff;
149 buff[buf_size++] = addr;
152 buff[buf_size++] = len;
153 buff[buf_size++] = addr;
154 buff[buf_size++] = (reg >> 8) & 0xff;
155 buff[buf_size++] = reg & 0xff;
169 for (i = 0; i < len ; i++)
170 buff[buf_size++] = data[i];
172 chk_sum = check_sum(&buff[1], buf_size);
174 buff[buf_size++] = chk_sum >> 8;
176 buff[buf_size++] = (chk_sum & 0xff);
178 ret = it913x_bulk_write(udev, buff, buf_size , 0x02);
182 ret = it913x_bulk_read(udev, buff, (mode & 1) ?
187 rlen = (mode & 0x1) ? 0x1 : len;
192 memcpy(data, &buff[3], rlen);
201 static int it913x_io(struct usb_device *udev, u8 mode, u8 pro,
202 u8 cmd, u32 reg, u8 addr, u8 *data, u8 len)
206 for (i = 0; i < IT913X_RETRY; i++) {
207 ret = it913x_usb_talk(udev, mode, pro,
208 cmd, reg, addr, data, len);
216 static int it913x_wr_reg(struct usb_device *udev, u8 pro, u32 reg , u8 data)
221 ret = it913x_io(udev, WRITE_LONG, pro,
222 CMD_DEMOD_WRITE, reg, 0, b, sizeof(b));
227 static int it913x_read_reg(struct usb_device *udev, u32 reg)
232 ret = it913x_io(udev, READ_LONG, DEV_0,
233 CMD_DEMOD_READ, reg, 0, &data[0], 1);
235 return (ret < 0) ? ret : data[0];
238 static u32 it913x_query(struct usb_device *udev, u8 pro)
242 ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ,
243 0x1222, 0, &data[0], 3);
245 it913x_config.chip_ver = data[0];
246 it913x_config.chip_type = (u16)(data[2] << 8) + data[1];
248 info("Chip Version=%02x Chip Type=%04x", it913x_config.chip_ver,
249 it913x_config.chip_type);
251 ret |= it913x_io(udev, READ_SHORT, pro,
252 CMD_QUERYINFO, 0, 0x1, &data[0], 4);
254 it913x_config.firmware = (data[0] << 24) + (data[1] << 16) +
255 (data[2] << 8) + data[3];
257 return (ret < 0) ? 0 : it913x_config.firmware;
260 static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
262 struct usb_device *udev = adap->dev->udev;
264 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
266 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
268 deb_info(1, "PID_C (%02x)", onoff);
270 ret = it913x_wr_reg(udev, pro, PID_EN, onoff);
272 mutex_unlock(&adap->dev->i2c_mutex);
276 static int it913x_pid_filter(struct dvb_usb_adapter *adap,
277 int index, u16 pid, int onoff)
279 struct usb_device *udev = adap->dev->udev;
281 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
283 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
285 deb_info(1, "PID_F (%02x)", onoff);
287 ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff));
289 ret |= it913x_wr_reg(udev, pro, PID_MSB, (u8)(pid >> 8));
291 ret |= it913x_wr_reg(udev, pro, PID_INX_EN, (u8)onoff);
293 ret |= it913x_wr_reg(udev, pro, PID_INX, (u8)(index & 0x1f));
295 mutex_unlock(&adap->dev->i2c_mutex);
300 static int it913x_return_status(struct usb_device *udev)
304 firm = it913x_query(udev, DEV_0);
306 info("Firmware Version %d", firm);
308 return (firm > 0) ? firm : 0;
311 static int it913x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
314 struct dvb_usb_device *d = i2c_get_adapdata(adap);
319 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
322 debug_data_snipet(1, "Message out", msg[0].buf);
323 deb_info(2, "num of messages %d address %02x", num, msg[0].addr);
325 pro = (msg[0].addr & 0x2) ? DEV_0_DMOD : 0x0;
326 pro |= (msg[0].addr & 0x20) ? DEV_1 : DEV_0;
327 memcpy(data, msg[0].buf, msg[0].len);
328 reg = (data[0] << 24) + (data[1] << 16) +
329 (data[2] << 8) + data[3];
331 ret = it913x_io(d->udev, READ_LONG, pro,
332 CMD_DEMOD_READ, reg, 0, data, msg[1].len);
333 memcpy(msg[1].buf, data, msg[1].len);
335 ret = it913x_io(d->udev, WRITE_LONG, pro, CMD_DEMOD_WRITE,
336 reg, 0, &data[4], msg[0].len - 4);
338 mutex_unlock(&d->i2c_mutex);
343 static u32 it913x_i2c_func(struct i2c_adapter *adapter)
348 static struct i2c_algorithm it913x_i2c_algo = {
349 .master_xfer = it913x_i2c_xfer,
350 .functionality = it913x_i2c_func,
353 /* Callbacks for DVB USB */
354 #define IT913X_POLL 250
355 static int it913x_rc_query(struct dvb_usb_device *d)
360 /* Avoid conflict with frontends*/
361 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
364 ret = it913x_io(d->udev, READ_LONG, PRO_LINK, CMD_IR_GET,
365 0, 0, &ibuf[0], sizeof(ibuf));
367 if ((ibuf[2] + ibuf[3]) == 0xff) {
369 key += ibuf[0] << 16;
371 deb_info(1, "NEC Extended Key =%08x", key);
372 if (d->rc_dev != NULL)
373 rc_keydown(d->rc_dev, key, 0);
376 mutex_unlock(&d->i2c_mutex);
381 /* Firmware sets raw */
382 const char fw_it9135_v1[] = "dvb-usb-it9135-01.fw";
383 const char fw_it9135_v2[] = "dvb-usb-it9135-02.fw";
384 const char fw_it9137[] = "dvb-usb-it9137-01.fw";
386 static int ite_firmware_select(struct usb_device *udev,
387 struct dvb_usb_device_properties *props)
391 if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_KWORLD_2)
393 else if (it913x_config.chip_ver == 1)
399 if (dvb_usb_it913x_firmware != IT9135_AUTO)
400 sw = dvb_usb_it913x_firmware;
404 it913x_config.firmware_ver = 1;
405 it913x_config.adc_x2 = 1;
406 props->firmware = fw_it9135_v1;
409 it913x_config.firmware_ver = 1;
410 it913x_config.adc_x2 = 1;
411 props->firmware = fw_it9135_v2;
412 switch (it913x_config.tuner_id_0) {
417 info("Unknown tuner ID applying default 0x60");
419 it913x_config.tuner_id_0 = IT9135_60;
424 it913x_config.firmware_ver = 0;
425 it913x_config.adc_x2 = 0;
426 props->firmware = fw_it9137;
432 static void it913x_select_remote(struct usb_device *udev,
433 struct dvb_usb_device_properties *props)
435 switch (le16_to_cpu(udev->descriptor.idProduct)) {
436 case USB_PID_ITETECH_IT9135_9005:
437 props->rc.core.rc_codes = RC_MAP_IT913X_V2;
440 props->rc.core.rc_codes = RC_MAP_IT913X_V1;
445 #define TS_MPEG_PKT_SIZE 188
447 #define TS_BUFFER_SIZE_PID (EP_LOW*TS_MPEG_PKT_SIZE)
449 #define TS_BUFFER_SIZE_MAX (EP_HIGH*TS_MPEG_PKT_SIZE)
451 static int it913x_select_config(struct usb_device *udev,
452 struct dvb_usb_device_properties *props)
455 bool proprietary_ir = false;
457 if (it913x_config.chip_ver == 0x02
458 && it913x_config.chip_type == 0x9135)
459 reg = it913x_read_reg(udev, 0x461d);
461 reg = it913x_read_reg(udev, 0x461b);
467 it913x_config.dual_mode = 0;
468 it913x_config.tuner_id_0 = IT9135_38;
469 proprietary_ir = true;
472 reg = it913x_read_reg(udev, 0x49c5);
475 it913x_config.dual_mode = reg;
478 reg = it913x_read_reg(udev, 0x49ac);
482 info("Remote propriety (raw) mode");
483 proprietary_ir = true;
484 } else if (reg == 1) {
485 info("Remote HID mode NOT SUPPORTED");
486 proprietary_ir = false;
487 props->rc.core.rc_codes = NULL;
489 props->rc.core.rc_codes = NULL;
492 reg = it913x_read_reg(udev, 0x49d0);
495 it913x_config.tuner_id_0 = reg;
499 it913x_select_remote(udev, props);
501 if (udev->speed != USB_SPEED_HIGH) {
502 props->adapter[0].fe[0].pid_filter_count = 5;
503 info("USB 1 low speed mode - connect to USB 2 port");
506 if (it913x_config.dual_mode) {
507 it913x_config.dual_mode = 0;
508 info("Dual mode not supported in USB 1");
510 } else /* For replugging */
511 if(props->adapter[0].fe[0].pid_filter_count == 5)
512 props->adapter[0].fe[0].pid_filter_count = 31;
514 /* Select Stream Buffer Size and pid filter option*/
516 props->adapter[0].fe[0].stream.u.bulk.buffersize =
518 props->adapter[0].fe[0].caps &=
519 ~DVB_USB_ADAP_NEED_PID_FILTERING;
521 props->adapter[0].fe[0].stream.u.bulk.buffersize =
524 if (it913x_config.dual_mode) {
525 props->adapter[1].fe[0].stream.u.bulk.buffersize =
526 props->adapter[0].fe[0].stream.u.bulk.buffersize;
527 props->num_adapters = 2;
529 props->adapter[1].fe[0].caps =
530 props->adapter[0].fe[0].caps;
532 props->num_adapters = 1;
534 info("Dual mode=%x Tuner Type=%x", it913x_config.dual_mode,
535 it913x_config.tuner_id_0);
537 ret = ite_firmware_select(udev, props);
542 static int it913x_identify_state(struct usb_device *udev,
543 struct dvb_usb_device_properties *props,
544 struct dvb_usb_device_description **desc,
547 int ret = 0, firm_no;
550 firm_no = it913x_return_status(udev);
552 /* Read and select config */
553 ret = it913x_select_config(udev, props);
562 if (it913x_config.dual_mode) {
563 it913x_config.tuner_id_1 = it913x_read_reg(udev, 0x49e0);
564 ret = it913x_wr_reg(udev, DEV_0, GPIOH1_EN, 0x1);
565 ret |= it913x_wr_reg(udev, DEV_0, GPIOH1_ON, 0x1);
566 ret |= it913x_wr_reg(udev, DEV_0, GPIOH1_O, 0x1);
568 ret |= it913x_wr_reg(udev, DEV_0, GPIOH1_O, 0x0);
570 reg = it913x_read_reg(udev, GPIOH1_O);
572 ret |= it913x_wr_reg(udev, DEV_0, GPIOH1_O, 0x1);
573 ret |= it913x_return_status(udev);
575 ret = it913x_wr_reg(udev, DEV_0,
580 reg = it913x_read_reg(udev, IO_MUX_POWER_CLK);
582 if (it913x_config.dual_mode) {
583 ret |= it913x_wr_reg(udev, DEV_0, 0x4bfb, CHIP2_I2C_ADDR);
584 if (it913x_config.firmware_ver == 1)
585 ret |= it913x_wr_reg(udev, DEV_0, 0xcfff, 0x1);
587 ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x1);
589 ret |= it913x_wr_reg(udev, DEV_0, 0x4bfb, 0x0);
590 if (it913x_config.firmware_ver == 1)
591 ret |= it913x_wr_reg(udev, DEV_0, 0xcfff, 0x0);
593 ret |= it913x_wr_reg(udev, DEV_0, CLK_O_EN, 0x0);
598 return (ret < 0) ? -ENODEV : 0;
601 static int it913x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
604 u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD;
606 if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0)
608 deb_info(1, "STM (%02x)", onoff);
611 ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1);
614 mutex_unlock(&adap->dev->i2c_mutex);
619 static int it913x_download_firmware(struct usb_device *udev,
620 const struct firmware *fw)
622 int ret = 0, i = 0, pos = 0;
623 u8 packet_size, min_pkt;
626 ret = it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_100);
628 info("FRM Starting Firmware Download");
630 /* Multi firmware loader */
631 /* This uses scatter write firmware headers */
632 /* The firmware must start with 03 XX 00 */
633 /* and be the extact firmware length */
635 if (it913x_config.chip_ver == 2)
640 while (i <= fw->size) {
641 if (((fw->data[i] == 0x3) && (fw->data[i + 2] == 0x0))
642 || (i == fw->size)) {
643 packet_size = i - pos;
644 if ((packet_size > min_pkt) || (i == fw->size)) {
645 fw_data = (u8 *)(fw->data + pos);
648 ret |= it913x_io(udev, WRITE_DATA,
649 DEV_0, CMD_SCATTER_WRITE, 0,
650 0, fw_data, packet_size);
657 ret |= it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0);
662 info("FRM Firmware Download Failed (%04x)" , ret);
664 info("FRM Firmware Download Completed - Resetting Device");
666 ret |= it913x_return_status(udev);
670 ret |= it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400);
673 if (it913x_config.dual_mode)
674 ret |= it913x_wr_reg(udev, DEV_0_DMOD , 0xec4c, 0xa0);
676 ret |= it913x_wr_reg(udev, DEV_0_DMOD , 0xec4c, 0x68);
678 if ((it913x_config.chip_ver == 1) &&
679 (it913x_config.chip_type == 0x9135)) {
680 ret |= it913x_wr_reg(udev, DEV_0, PADODPU, 0x0);
681 ret |= it913x_wr_reg(udev, DEV_0, AGC_O_D, 0x0);
682 if (it913x_config.dual_mode) {
683 ret |= it913x_wr_reg(udev, DEV_1, PADODPU, 0x0);
684 ret |= it913x_wr_reg(udev, DEV_1, AGC_O_D, 0x0);
688 return (ret < 0) ? -ENODEV : 0;
691 static int it913x_name(struct dvb_usb_adapter *adap)
693 const char *desc = adap->dev->desc->name;
694 char *fe_name[] = {"_1", "_2", "_3", "_4"};
695 char *name = adap->fe_adap[0].fe->ops.info.name;
697 strlcpy(name, desc, 128);
698 strlcat(name, fe_name[adap->id], 128);
703 static int it913x_frontend_attach(struct dvb_usb_adapter *adap)
705 struct usb_device *udev = adap->dev->udev;
706 struct it913x_state *st = adap->dev->priv;
708 u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5);
709 u16 ep_size = adap->props.fe[0].stream.u.bulk.buffersize / 4;
712 if (adap->dev->udev->speed != USB_SPEED_HIGH)
715 it913x_config.adf = it913x_read_reg(udev, IO_MUX_POWER_CLK);
718 memcpy(&st->it913x_config, &it913x_config,
719 sizeof(struct ite_config));
721 adap->fe_adap[0].fe = dvb_attach(it913x_fe_attach,
722 &adap->dev->i2c_adap, adap_addr, &st->it913x_config);
724 if (adap->id == 0 && adap->fe_adap[0].fe) {
725 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x1);
726 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_SW_RST, 0x1);
727 ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x0f);
728 ret = it913x_wr_reg(udev, DEV_0, EP0_TX_NAK, 0x1b);
729 ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x2f);
730 ret = it913x_wr_reg(udev, DEV_0, EP4_TX_LEN_LSB,
732 ret = it913x_wr_reg(udev, DEV_0, EP4_TX_LEN_MSB, ep_size >> 8);
733 ret = it913x_wr_reg(udev, DEV_0, EP4_MAX_PKT, pkt_size);
734 } else if (adap->id == 1 && adap->fe_adap[0].fe) {
735 ret = it913x_wr_reg(udev, DEV_0, EP0_TX_EN, 0x6f);
736 ret = it913x_wr_reg(udev, DEV_0, EP5_TX_LEN_LSB,
738 ret = it913x_wr_reg(udev, DEV_0, EP5_TX_LEN_MSB, ep_size >> 8);
739 ret = it913x_wr_reg(udev, DEV_0, EP5_MAX_PKT, pkt_size);
740 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_EN, 0x1);
741 ret = it913x_wr_reg(udev, DEV_1_DMOD, MP2IF_SERIAL, 0x1);
742 ret = it913x_wr_reg(udev, DEV_1, TOP_HOSTB_SER_MODE, 0x1);
743 ret = it913x_wr_reg(udev, DEV_0_DMOD, TSIS_ENABLE, 0x1);
744 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2_SW_RST, 0x0);
745 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_SW_RST, 0x0);
746 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF2_HALF_PSB, 0x0);
747 ret = it913x_wr_reg(udev, DEV_0_DMOD, MP2IF_STOP_EN, 0x1);
748 ret = it913x_wr_reg(udev, DEV_1_DMOD, MPEG_FULL_SPEED, 0x0);
749 ret = it913x_wr_reg(udev, DEV_1_DMOD, MP2IF_STOP_EN, 0x0);
753 ret = it913x_name(adap);
759 static struct dvb_usb_device_properties it913x_properties;
761 static int it913x_probe(struct usb_interface *intf,
762 const struct usb_device_id *id)
765 if (0 == dvb_usb_device_init(intf, &it913x_properties,
766 THIS_MODULE, NULL, adapter_nr)) {
767 info("DEV registering device driver");
771 info("DEV it913x Error");
776 static struct usb_device_id it913x_table[] = {
777 { USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_UB499_2T_T09) },
778 { USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9135) },
779 { USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV22_IT9137) },
780 { USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9135_9005) },
781 { USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9135_9006) },
782 {} /* Terminating entry */
785 MODULE_DEVICE_TABLE(usb, it913x_table);
787 static struct dvb_usb_device_properties it913x_properties = {
788 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
789 .usb_ctrl = DEVICE_SPECIFIC,
790 .download_firmware = it913x_download_firmware,
791 .firmware = "dvb-usb-it9137-01.fw",
793 .size_of_priv = sizeof(struct it913x_state),
799 .caps = DVB_USB_ADAP_HAS_PID_FILTER|
800 DVB_USB_ADAP_NEED_PID_FILTERING|
801 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
802 .streaming_ctrl = it913x_streaming_ctrl,
803 .pid_filter_count = 31,
804 .pid_filter = it913x_pid_filter,
805 .pid_filter_ctrl = it913x_pid_filter_ctrl,
806 .frontend_attach = it913x_frontend_attach,
807 /* parameter for the MPEG2-data transfer */
812 .u = {/* Keep Low if PID filter on */
824 .caps = DVB_USB_ADAP_HAS_PID_FILTER|
825 DVB_USB_ADAP_NEED_PID_FILTERING|
826 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
827 .streaming_ctrl = it913x_streaming_ctrl,
828 .pid_filter_count = 31,
829 .pid_filter = it913x_pid_filter,
830 .pid_filter_ctrl = it913x_pid_filter_ctrl,
831 .frontend_attach = it913x_frontend_attach,
832 /* parameter for the MPEG2-data transfer */
847 .identify_state = it913x_identify_state,
849 .protocol = RC_TYPE_NEC,
850 .module_name = "it913x",
851 .rc_query = it913x_rc_query,
852 .rc_interval = IT913X_POLL,
853 .allowed_protos = RC_TYPE_NEC,
854 .rc_codes = RC_MAP_IT913X_V1,
856 .i2c_algo = &it913x_i2c_algo,
857 .num_device_descs = 5,
859 { "Kworld UB499-2T T09(IT9137)",
860 { &it913x_table[0], NULL },
862 { "ITE 9135 Generic",
863 { &it913x_table[1], NULL },
865 { "Sveon STV22 Dual DVB-T HDTV(IT9137)",
866 { &it913x_table[2], NULL },
868 { "ITE 9135(9005) Generic",
869 { &it913x_table[3], NULL },
871 { "ITE 9135(9006) Generic",
872 { &it913x_table[4], NULL },
877 static struct usb_driver it913x_driver = {
879 .probe = it913x_probe,
880 .disconnect = dvb_usb_device_exit,
881 .id_table = it913x_table,
884 module_usb_driver(it913x_driver);
886 MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
887 MODULE_DESCRIPTION("it913x USB 2 Driver");
888 MODULE_VERSION("1.25");
889 MODULE_LICENSE("GPL");