Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1 | /* DVB USB compliant linux driver for Conexant USB reference design. |
| 2 | * |
| 3 | * The Conexant reference design I saw on their website was only for analogue |
| 4 | * capturing (using the cx25842). The box I took to write this driver (reverse |
| 5 | * engineered) is the one labeled Medion MD95700. In addition to the cx25842 |
| 6 | * for analogue capturing it also has a cx22702 DVB-T demodulator on the main |
| 7 | * board. Besides it has a atiremote (X10) and a USB2.0 hub onboard. |
| 8 | * |
| 9 | * Maybe it is a little bit premature to call this driver cxusb, but I assume |
| 10 | * the USB protocol is identical or at least inherited from the reference |
| 11 | * design, so it can be reused for the "analogue-only" device (if it will |
| 12 | * appear at all). |
| 13 | * |
Michael Krufky | 81481e9 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 14 | * TODO: Use the cx25840-driver for the analogue part |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 15 | * |
Patrick Boettcher | 99e44da | 2016-01-24 12:56:58 -0200 | [diff] [blame] | 16 | * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@posteo.de) |
Michael Krufky | 5b9ed28 | 2006-10-15 14:51:08 -0300 | [diff] [blame] | 17 | * Copyright (C) 2006 Michael Krufky (mkrufky@linuxtv.org) |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 18 | * Copyright (C) 2006, 2007 Chris Pascoe (c.pascoe@itee.uq.edu.au) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 19 | * |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 20 | * This program is free software; you can redistribute it and/or modify it |
| 21 | * under the terms of the GNU General Public License as published by the Free |
| 22 | * Software Foundation, version 2. |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 23 | * |
Mauro Carvalho Chehab | 670d7adb | 2018-05-08 18:29:30 -0300 | [diff] [blame] | 24 | * see Documentation/media/dvb-drivers/dvb-usb.rst for more information |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 25 | */ |
Michael Krufky | 827855d | 2008-04-22 14:46:16 -0300 | [diff] [blame] | 26 | #include <media/tuner.h> |
David Woodhouse | e62f89f | 2008-05-24 00:12:42 +0100 | [diff] [blame] | 27 | #include <linux/vmalloc.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 28 | #include <linux/slab.h> |
Jérémy Lefaure | e40d14a | 2017-10-01 15:30:41 -0400 | [diff] [blame] | 29 | #include <linux/kernel.h> |
Michael Krufky | 827855d | 2008-04-22 14:46:16 -0300 | [diff] [blame] | 30 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 31 | #include "cxusb.h" |
| 32 | |
| 33 | #include "cx22702.h" |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 34 | #include "lgdt330x.h" |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 35 | #include "mt352.h" |
| 36 | #include "mt352_priv.h" |
Michael Krufky | c9ce394 | 2006-06-11 04:24:31 -0300 | [diff] [blame] | 37 | #include "zl10353.h" |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 38 | #include "tuner-xc2028.h" |
Michael Krufky | 827855d | 2008-04-22 14:46:16 -0300 | [diff] [blame] | 39 | #include "tuner-simple.h" |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 40 | #include "mxl5005s.h" |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 41 | #include "max2165.h" |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 42 | #include "dib7000p.h" |
| 43 | #include "dib0070.h" |
David T.L. Wong | 6bf1a99 | 2009-08-05 13:07:10 -0300 | [diff] [blame] | 44 | #include "lgs8gxx.h" |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 45 | #include "atbm8830.h" |
Olli Salonen | 26c42b0 | 2014-07-13 10:52:22 -0300 | [diff] [blame] | 46 | #include "si2168.h" |
| 47 | #include "si2157.h" |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 48 | |
| 49 | /* debug */ |
Adrian Bunk | 53133af | 2007-11-05 14:07:06 -0300 | [diff] [blame] | 50 | static int dvb_usb_cxusb_debug; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 51 | module_param_named(debug, dvb_usb_cxusb_debug, int, 0644); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 52 | MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS); |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 53 | |
| 54 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
| 55 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 56 | #define deb_info(args...) dprintk(dvb_usb_cxusb_debug, 0x03, args) |
| 57 | #define deb_i2c(args...) dprintk(dvb_usb_cxusb_debug, 0x02, args) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 58 | |
| 59 | static int cxusb_ctrl_msg(struct dvb_usb_device *d, |
Colin Ian King | cee32ed | 2017-09-18 10:24:44 -0400 | [diff] [blame] | 60 | u8 cmd, const u8 *wbuf, int wlen, u8 *rbuf, int rlen) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 61 | { |
Mauro Carvalho Chehab | 17ce039 | 2016-10-07 06:30:27 -0300 | [diff] [blame] | 62 | struct cxusb_state *st = d->priv; |
Stefan Brüns | 3f190e3 | 2017-02-05 12:57:59 -0200 | [diff] [blame] | 63 | int ret; |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 64 | |
Mauro Carvalho Chehab | 17ce039 | 2016-10-07 06:30:27 -0300 | [diff] [blame] | 65 | if (1 + wlen > MAX_XFER_SIZE) { |
| 66 | warn("i2c wr: len=%d is too big!\n", wlen); |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 67 | return -EOPNOTSUPP; |
| 68 | } |
| 69 | |
Stefan Brüns | 3f190e3 | 2017-02-05 12:57:59 -0200 | [diff] [blame] | 70 | if (rlen > MAX_XFER_SIZE) { |
| 71 | warn("i2c rd: len=%d is too big!\n", rlen); |
| 72 | return -EOPNOTSUPP; |
| 73 | } |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 74 | |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 75 | mutex_lock(&d->data_mutex); |
Mauro Carvalho Chehab | 17ce039 | 2016-10-07 06:30:27 -0300 | [diff] [blame] | 76 | st->data[0] = cmd; |
| 77 | memcpy(&st->data[1], wbuf, wlen); |
Stefan Brüns | 3f190e3 | 2017-02-05 12:57:59 -0200 | [diff] [blame] | 78 | ret = dvb_usb_generic_rw(d, st->data, 1 + wlen, st->data, rlen, 0); |
| 79 | if (!ret && rbuf && rlen) |
| 80 | memcpy(rbuf, st->data, rlen); |
Mauro Carvalho Chehab | 17ce039 | 2016-10-07 06:30:27 -0300 | [diff] [blame] | 81 | |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 82 | mutex_unlock(&d->data_mutex); |
Mauro Carvalho Chehab | 17ce039 | 2016-10-07 06:30:27 -0300 | [diff] [blame] | 83 | return ret; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 84 | } |
| 85 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 86 | /* GPIO */ |
| 87 | static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 88 | { |
| 89 | struct cxusb_state *st = d->priv; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 90 | u8 o[2], i; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 91 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 92 | if (st->gpio_write_state[GPIO_TUNER] == onoff) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 93 | return; |
| 94 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 95 | o[0] = GPIO_TUNER; |
| 96 | o[1] = onoff; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 97 | cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 98 | |
| 99 | if (i != 0x01) |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 100 | deb_info("gpio_write failed.\n"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 101 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 102 | st->gpio_write_state[GPIO_TUNER] = onoff; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 103 | } |
| 104 | |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 105 | static int cxusb_bluebird_gpio_rw(struct dvb_usb_device *d, u8 changemask, |
| 106 | u8 newval) |
| 107 | { |
| 108 | u8 o[2], gpio_state; |
| 109 | int rc; |
| 110 | |
| 111 | o[0] = 0xff & ~changemask; /* mask of bits to keep */ |
| 112 | o[1] = newval & changemask; /* new values for bits */ |
| 113 | |
| 114 | rc = cxusb_ctrl_msg(d, CMD_BLUEBIRD_GPIO_RW, o, 2, &gpio_state, 1); |
| 115 | if (rc < 0 || (gpio_state & changemask) != (newval & changemask)) |
| 116 | deb_info("bluebird_gpio_write failed.\n"); |
| 117 | |
| 118 | return rc < 0 ? rc : gpio_state; |
| 119 | } |
| 120 | |
| 121 | static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low) |
| 122 | { |
| 123 | cxusb_bluebird_gpio_rw(d, pin, low ? 0 : pin); |
| 124 | msleep(5); |
| 125 | cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0); |
| 126 | } |
| 127 | |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 128 | static void cxusb_nano2_led(struct dvb_usb_device *d, int onoff) |
| 129 | { |
| 130 | cxusb_bluebird_gpio_rw(d, 0x40, onoff ? 0 : 0x40); |
| 131 | } |
| 132 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 133 | static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d, |
| 134 | u8 addr, int onoff) |
| 135 | { |
| 136 | u8 o[2] = {addr, onoff}; |
| 137 | u8 i; |
| 138 | int rc; |
| 139 | |
| 140 | rc = cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1); |
| 141 | |
| 142 | if (rc < 0) |
| 143 | return rc; |
| 144 | if (i == 0x01) |
| 145 | return 0; |
| 146 | else { |
| 147 | deb_info("gpio_write failed.\n"); |
| 148 | return -EIO; |
| 149 | } |
| 150 | } |
| 151 | |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 152 | /* I2C */ |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 153 | static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], |
| 154 | int num) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 155 | { |
| 156 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 157 | int ret; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 158 | int i; |
| 159 | |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 160 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 161 | return -EAGAIN; |
| 162 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 163 | for (i = 0; i < num; i++) { |
| 164 | |
Hans Verkuil | 41150cb9 | 2014-08-21 11:55:00 -0300 | [diff] [blame] | 165 | if (le16_to_cpu(d->udev->descriptor.idVendor) == USB_VID_MEDION) |
Michael Krufky | 5e805ef | 2006-03-23 00:01:34 -0300 | [diff] [blame] | 166 | switch (msg[i].addr) { |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 167 | case 0x63: |
| 168 | cxusb_gpio_tuner(d, 0); |
| 169 | break; |
| 170 | default: |
| 171 | cxusb_gpio_tuner(d, 1); |
| 172 | break; |
Michael Krufky | 5e805ef | 2006-03-23 00:01:34 -0300 | [diff] [blame] | 173 | } |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 174 | |
Chris Pascoe | 272479d7 | 2007-11-19 03:01:22 -0300 | [diff] [blame] | 175 | if (msg[i].flags & I2C_M_RD) { |
| 176 | /* read only */ |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 177 | u8 obuf[3], ibuf[MAX_XFER_SIZE]; |
| 178 | |
| 179 | if (1 + msg[i].len > sizeof(ibuf)) { |
| 180 | warn("i2c rd: len=%d is too big!\n", |
| 181 | msg[i].len); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 182 | ret = -EOPNOTSUPP; |
| 183 | goto unlock; |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 184 | } |
Chris Pascoe | 272479d7 | 2007-11-19 03:01:22 -0300 | [diff] [blame] | 185 | obuf[0] = 0; |
| 186 | obuf[1] = msg[i].len; |
| 187 | obuf[2] = msg[i].addr; |
| 188 | if (cxusb_ctrl_msg(d, CMD_I2C_READ, |
| 189 | obuf, 3, |
| 190 | ibuf, 1+msg[i].len) < 0) { |
| 191 | warn("i2c read failed"); |
| 192 | break; |
| 193 | } |
| 194 | memcpy(msg[i].buf, &ibuf[1], msg[i].len); |
Chris Pascoe | a644e4a | 2007-11-19 03:05:09 -0300 | [diff] [blame] | 195 | } else if (i+1 < num && (msg[i+1].flags & I2C_M_RD) && |
| 196 | msg[i].addr == msg[i+1].addr) { |
| 197 | /* write to then read from same address */ |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 198 | u8 obuf[MAX_XFER_SIZE], ibuf[MAX_XFER_SIZE]; |
| 199 | |
| 200 | if (3 + msg[i].len > sizeof(obuf)) { |
| 201 | warn("i2c wr: len=%d is too big!\n", |
| 202 | msg[i].len); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 203 | ret = -EOPNOTSUPP; |
| 204 | goto unlock; |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 205 | } |
| 206 | if (1 + msg[i + 1].len > sizeof(ibuf)) { |
| 207 | warn("i2c rd: len=%d is too big!\n", |
| 208 | msg[i + 1].len); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 209 | ret = -EOPNOTSUPP; |
| 210 | goto unlock; |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 211 | } |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 212 | obuf[0] = msg[i].len; |
| 213 | obuf[1] = msg[i+1].len; |
| 214 | obuf[2] = msg[i].addr; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 215 | memcpy(&obuf[3], msg[i].buf, msg[i].len); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 216 | |
| 217 | if (cxusb_ctrl_msg(d, CMD_I2C_READ, |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 218 | obuf, 3+msg[i].len, |
| 219 | ibuf, 1+msg[i+1].len) < 0) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 220 | break; |
| 221 | |
| 222 | if (ibuf[0] != 0x08) |
Michael Krufky | ae62e3d | 2006-03-23 01:11:18 -0300 | [diff] [blame] | 223 | deb_i2c("i2c read may have failed\n"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 224 | |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 225 | memcpy(msg[i+1].buf, &ibuf[1], msg[i+1].len); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 226 | |
| 227 | i++; |
Chris Pascoe | 272479d7 | 2007-11-19 03:01:22 -0300 | [diff] [blame] | 228 | } else { |
| 229 | /* write only */ |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 230 | u8 obuf[MAX_XFER_SIZE], ibuf; |
| 231 | |
| 232 | if (2 + msg[i].len > sizeof(obuf)) { |
| 233 | warn("i2c wr: len=%d is too big!\n", |
| 234 | msg[i].len); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 235 | ret = -EOPNOTSUPP; |
| 236 | goto unlock; |
Mauro Carvalho Chehab | 64f7ef8 | 2013-11-02 07:18:09 -0300 | [diff] [blame] | 237 | } |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 238 | obuf[0] = msg[i].addr; |
| 239 | obuf[1] = msg[i].len; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 240 | memcpy(&obuf[2], msg[i].buf, msg[i].len); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 241 | |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 242 | if (cxusb_ctrl_msg(d, CMD_I2C_WRITE, obuf, |
| 243 | 2+msg[i].len, &ibuf,1) < 0) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 244 | break; |
| 245 | if (ibuf != 0x08) |
Michael Krufky | ae62e3d | 2006-03-23 01:11:18 -0300 | [diff] [blame] | 246 | deb_i2c("i2c write may have failed\n"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 247 | } |
| 248 | } |
| 249 | |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 250 | if (i == num) |
| 251 | ret = num; |
| 252 | else |
| 253 | ret = -EREMOTEIO; |
| 254 | |
| 255 | unlock: |
Ingo Molnar | 3593cab | 2006-02-07 06:49:14 -0200 | [diff] [blame] | 256 | mutex_unlock(&d->i2c_mutex); |
Dan Carpenter | 1cdbcc5 | 2013-11-22 04:55:43 -0300 | [diff] [blame] | 257 | return ret; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | static u32 cxusb_i2c_func(struct i2c_adapter *adapter) |
| 261 | { |
| 262 | return I2C_FUNC_I2C; |
| 263 | } |
| 264 | |
| 265 | static struct i2c_algorithm cxusb_i2c_algo = { |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 266 | .master_xfer = cxusb_i2c_xfer, |
| 267 | .functionality = cxusb_i2c_func, |
| 268 | }; |
| 269 | |
| 270 | static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 271 | { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 272 | u8 b = 0; |
| 273 | if (onoff) |
| 274 | return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); |
| 275 | else |
| 276 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 277 | } |
| 278 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 279 | static int cxusb_aver_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 280 | { |
| 281 | int ret; |
| 282 | if (!onoff) |
| 283 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, NULL, 0, NULL, 0); |
| 284 | if (d->state == DVB_USB_STATE_INIT && |
| 285 | usb_set_interface(d->udev, 0, 0) < 0) |
| 286 | err("set interface failed"); |
Hans Verkuil | c6eb8ea | 2008-09-03 17:11:54 -0300 | [diff] [blame] | 287 | do {} while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) && |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 288 | !(ret = cxusb_ctrl_msg(d, 0x15, NULL, 0, NULL, 0)) && |
| 289 | !(ret = cxusb_ctrl_msg(d, 0x17, NULL, 0, NULL, 0)) && 0); |
| 290 | if (!ret) { |
| 291 | /* FIXME: We don't know why, but we need to configure the |
| 292 | * lgdt3303 with the register settings below on resume */ |
| 293 | int i; |
Colin Ian King | cee32ed | 2017-09-18 10:24:44 -0400 | [diff] [blame] | 294 | u8 buf; |
| 295 | static const u8 bufs[] = { |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 296 | 0x0e, 0x2, 0x00, 0x7f, |
| 297 | 0x0e, 0x2, 0x02, 0xfe, |
| 298 | 0x0e, 0x2, 0x02, 0x01, |
| 299 | 0x0e, 0x2, 0x00, 0x03, |
| 300 | 0x0e, 0x2, 0x0d, 0x40, |
| 301 | 0x0e, 0x2, 0x0e, 0x87, |
| 302 | 0x0e, 0x2, 0x0f, 0x8e, |
| 303 | 0x0e, 0x2, 0x10, 0x01, |
| 304 | 0x0e, 0x2, 0x14, 0xd7, |
| 305 | 0x0e, 0x2, 0x47, 0x88, |
| 306 | }; |
| 307 | msleep(20); |
Jérémy Lefaure | e40d14a | 2017-10-01 15:30:41 -0400 | [diff] [blame] | 308 | for (i = 0; i < ARRAY_SIZE(bufs); i += 4 / sizeof(u8)) { |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 309 | ret = cxusb_ctrl_msg(d, CMD_I2C_WRITE, |
| 310 | bufs+i, 4, &buf, 1); |
| 311 | if (ret) |
| 312 | break; |
| 313 | if (buf != 0x8) |
| 314 | return -EREMOTEIO; |
| 315 | } |
| 316 | } |
| 317 | return ret; |
| 318 | } |
| 319 | |
Michael Krufky | 5691c84 | 2006-04-19 20:40:01 -0300 | [diff] [blame] | 320 | static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 321 | { |
| 322 | u8 b = 0; |
| 323 | if (onoff) |
| 324 | return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); |
| 325 | else |
| 326 | return 0; |
| 327 | } |
| 328 | |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 329 | static int cxusb_nano2_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 330 | { |
| 331 | int rc = 0; |
| 332 | |
| 333 | rc = cxusb_power_ctrl(d, onoff); |
| 334 | if (!onoff) |
| 335 | cxusb_nano2_led(d, 0); |
| 336 | |
| 337 | return rc; |
| 338 | } |
| 339 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 340 | static int cxusb_d680_dmb_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 341 | { |
| 342 | int ret; |
| 343 | u8 b; |
| 344 | ret = cxusb_power_ctrl(d, onoff); |
| 345 | if (!onoff) |
| 346 | return ret; |
| 347 | |
| 348 | msleep(128); |
| 349 | cxusb_ctrl_msg(d, CMD_DIGITAL, NULL, 0, &b, 1); |
| 350 | msleep(100); |
| 351 | return ret; |
| 352 | } |
| 353 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 354 | static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 355 | { |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 356 | u8 buf[2] = { 0x03, 0x00 }; |
| 357 | if (onoff) |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 358 | cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, buf, 2, NULL, 0); |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 359 | else |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 360 | cxusb_ctrl_msg(adap->dev, CMD_STREAMING_OFF, NULL, 0, NULL, 0); |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 361 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 362 | return 0; |
| 363 | } |
| 364 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 365 | static int cxusb_aver_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
| 366 | { |
| 367 | if (onoff) |
| 368 | cxusb_ctrl_msg(adap->dev, CMD_AVER_STREAM_ON, NULL, 0, NULL, 0); |
| 369 | else |
| 370 | cxusb_ctrl_msg(adap->dev, CMD_AVER_STREAM_OFF, |
| 371 | NULL, 0, NULL, 0); |
| 372 | return 0; |
| 373 | } |
| 374 | |
CrazyCat | 5fa8815 | 2016-10-21 17:35:40 -0200 | [diff] [blame] | 375 | static int cxusb_read_status(struct dvb_frontend *fe, |
| 376 | enum fe_status *status) |
| 377 | { |
| 378 | struct dvb_usb_adapter *adap = (struct dvb_usb_adapter *)fe->dvb->priv; |
| 379 | struct cxusb_state *state = (struct cxusb_state *)adap->dev->priv; |
| 380 | int ret; |
| 381 | |
| 382 | ret = state->fe_read_status(fe, status); |
| 383 | |
| 384 | /* it need resync slave fifo when signal change from unlock to lock.*/ |
| 385 | if ((*status & FE_HAS_LOCK) && (!state->last_lock)) { |
| 386 | mutex_lock(&state->stream_mutex); |
| 387 | cxusb_streaming_ctrl(adap, 1); |
| 388 | mutex_unlock(&state->stream_mutex); |
| 389 | } |
| 390 | |
| 391 | state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0; |
| 392 | return ret; |
| 393 | } |
| 394 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 395 | static void cxusb_d680_dmb_drain_message(struct dvb_usb_device *d) |
| 396 | { |
| 397 | int ep = d->props.generic_bulk_ctrl_endpoint; |
| 398 | const int timeout = 100; |
| 399 | const int junk_len = 32; |
| 400 | u8 *junk; |
| 401 | int rd_count; |
| 402 | |
| 403 | /* Discard remaining data in video pipe */ |
| 404 | junk = kmalloc(junk_len, GFP_KERNEL); |
| 405 | if (!junk) |
| 406 | return; |
| 407 | while (1) { |
| 408 | if (usb_bulk_msg(d->udev, |
| 409 | usb_rcvbulkpipe(d->udev, ep), |
| 410 | junk, junk_len, &rd_count, timeout) < 0) |
| 411 | break; |
| 412 | if (!rd_count) |
| 413 | break; |
| 414 | } |
| 415 | kfree(junk); |
| 416 | } |
| 417 | |
| 418 | static void cxusb_d680_dmb_drain_video(struct dvb_usb_device *d) |
| 419 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 420 | struct usb_data_stream_properties *p = &d->props.adapter[0].fe[0].stream; |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 421 | const int timeout = 100; |
| 422 | const int junk_len = p->u.bulk.buffersize; |
| 423 | u8 *junk; |
| 424 | int rd_count; |
| 425 | |
| 426 | /* Discard remaining data in video pipe */ |
| 427 | junk = kmalloc(junk_len, GFP_KERNEL); |
| 428 | if (!junk) |
| 429 | return; |
| 430 | while (1) { |
| 431 | if (usb_bulk_msg(d->udev, |
| 432 | usb_rcvbulkpipe(d->udev, p->endpoint), |
| 433 | junk, junk_len, &rd_count, timeout) < 0) |
| 434 | break; |
| 435 | if (!rd_count) |
| 436 | break; |
| 437 | } |
| 438 | kfree(junk); |
| 439 | } |
| 440 | |
| 441 | static int cxusb_d680_dmb_streaming_ctrl( |
| 442 | struct dvb_usb_adapter *adap, int onoff) |
| 443 | { |
| 444 | if (onoff) { |
| 445 | u8 buf[2] = { 0x03, 0x00 }; |
| 446 | cxusb_d680_dmb_drain_video(adap->dev); |
| 447 | return cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, |
| 448 | buf, sizeof(buf), NULL, 0); |
| 449 | } else { |
| 450 | int ret = cxusb_ctrl_msg(adap->dev, |
| 451 | CMD_STREAMING_OFF, NULL, 0, NULL, 0); |
| 452 | return ret; |
| 453 | } |
| 454 | } |
| 455 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 456 | static int cxusb_rc_query(struct dvb_usb_device *d) |
Chris Pascoe | 7c23970 | 2006-01-09 18:21:29 -0200 | [diff] [blame] | 457 | { |
Michael Krufky | a07e609 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 458 | u8 ircode[4]; |
Chris Pascoe | 7c23970 | 2006-01-09 18:21:29 -0200 | [diff] [blame] | 459 | |
Michael Krufky | a07e609 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 460 | cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4); |
Chris Pascoe | 7c23970 | 2006-01-09 18:21:29 -0200 | [diff] [blame] | 461 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 462 | if (ircode[2] || ircode[3]) |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 463 | rc_keydown(d->rc_dev, RC_PROTO_NEC, |
Sean Young | 207c957 | 2017-02-04 17:00:36 -0200 | [diff] [blame] | 464 | RC_SCANCODE_NEC(~ircode[2] & 0xff, ircode[3]), 0); |
Chris Pascoe | 7c23970 | 2006-01-09 18:21:29 -0200 | [diff] [blame] | 465 | return 0; |
| 466 | } |
| 467 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 468 | static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d) |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 469 | { |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 470 | u8 ircode[4]; |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 471 | struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD, |
| 472 | .buf = ircode, .len = 4 }; |
| 473 | |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 474 | if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1) |
| 475 | return 0; |
| 476 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 477 | if (ircode[1] || ircode[2]) |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 478 | rc_keydown(d->rc_dev, RC_PROTO_NEC, |
Sean Young | 207c957 | 2017-02-04 17:00:36 -0200 | [diff] [blame] | 479 | RC_SCANCODE_NEC(~ircode[1] & 0xff, ircode[2]), 0); |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 480 | return 0; |
| 481 | } |
| 482 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 483 | static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d) |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 484 | { |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 485 | u8 ircode[2]; |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 486 | |
| 487 | if (cxusb_ctrl_msg(d, 0x10, NULL, 0, ircode, 2) < 0) |
| 488 | return 0; |
| 489 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 490 | if (ircode[0] || ircode[1]) |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 491 | rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 492 | RC_SCANCODE_RC5(ircode[0], ircode[1]), 0); |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 493 | return 0; |
| 494 | } |
| 495 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 496 | static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) |
| 497 | { |
Chris Pascoe | d9ed881 | 2006-02-07 06:49:11 -0200 | [diff] [blame] | 498 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 }; |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 499 | static u8 reset [] = { RESET, 0x80 }; |
| 500 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 501 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 }; |
| 502 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; |
| 503 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; |
| 504 | |
| 505 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 506 | udelay(200); |
| 507 | mt352_write(fe, reset, sizeof(reset)); |
| 508 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 509 | |
| 510 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 511 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 512 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 513 | |
| 514 | return 0; |
| 515 | } |
| 516 | |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 517 | static int cxusb_mt352_demod_init(struct dvb_frontend* fe) |
| 518 | { /* used in both lgz201 and th7579 */ |
Michael Krufky | fb51fd2 | 2006-02-07 06:49:12 -0200 | [diff] [blame] | 519 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x29 }; |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 520 | static u8 reset [] = { RESET, 0x80 }; |
| 521 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 522 | static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 }; |
| 523 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; |
| 524 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; |
| 525 | |
| 526 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 527 | udelay(200); |
| 528 | mt352_write(fe, reset, sizeof(reset)); |
| 529 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 530 | |
| 531 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 532 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 533 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 534 | return 0; |
| 535 | } |
| 536 | |
Adrian Bunk | 703cb2c | 2006-01-23 17:11:09 -0200 | [diff] [blame] | 537 | static struct cx22702_config cxusb_cx22702_config = { |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 538 | .demod_address = 0x63, |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 539 | .output_mode = CX22702_PARALLEL_OUTPUT, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 540 | }; |
| 541 | |
Michael Krufky | fddd632 | 2006-02-27 00:08:17 -0300 | [diff] [blame] | 542 | static struct lgdt330x_config cxusb_lgdt3303_config = { |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 543 | .demod_chip = LGDT3303, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 544 | }; |
| 545 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 546 | static struct lgdt330x_config cxusb_aver_lgdt3303_config = { |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 547 | .demod_chip = LGDT3303, |
| 548 | .clock_polarity_flip = 2, |
| 549 | }; |
| 550 | |
Adrian Bunk | 703cb2c | 2006-01-23 17:11:09 -0200 | [diff] [blame] | 551 | static struct mt352_config cxusb_dee1601_config = { |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 552 | .demod_address = 0x0f, |
| 553 | .demod_init = cxusb_dee1601_demod_init, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 554 | }; |
| 555 | |
Michael Krufky | c9ce394 | 2006-06-11 04:24:31 -0300 | [diff] [blame] | 556 | static struct zl10353_config cxusb_zl10353_dee1601_config = { |
| 557 | .demod_address = 0x0f, |
Chris Pascoe | 8fb9578 | 2006-08-10 03:17:16 -0300 | [diff] [blame] | 558 | .parallel_ts = 1, |
Michael Krufky | c9ce394 | 2006-06-11 04:24:31 -0300 | [diff] [blame] | 559 | }; |
| 560 | |
Adrian Bunk | 6fe00b0 | 2006-04-19 20:49:28 -0300 | [diff] [blame] | 561 | static struct mt352_config cxusb_mt352_config = { |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 562 | /* used in both lgz201 and th7579 */ |
| 563 | .demod_address = 0x0f, |
| 564 | .demod_init = cxusb_mt352_demod_init, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 565 | }; |
| 566 | |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 567 | static struct zl10353_config cxusb_zl10353_xc3028_config = { |
| 568 | .demod_address = 0x0f, |
Chris Pascoe | a1dcd9d | 2007-11-20 08:17:54 -0300 | [diff] [blame] | 569 | .if2 = 45600, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 570 | .no_tuner = 1, |
| 571 | .parallel_ts = 1, |
| 572 | }; |
| 573 | |
Robert Lowery | 0bc3518 | 2009-11-08 00:00:11 -0300 | [diff] [blame] | 574 | static struct zl10353_config cxusb_zl10353_xc3028_config_no_i2c_gate = { |
| 575 | .demod_address = 0x0f, |
| 576 | .if2 = 45600, |
| 577 | .no_tuner = 1, |
| 578 | .parallel_ts = 1, |
| 579 | .disable_i2c_gate_ctrl = 1, |
| 580 | }; |
| 581 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 582 | static struct mt352_config cxusb_mt352_xc3028_config = { |
| 583 | .demod_address = 0x0f, |
| 584 | .if2 = 4560, |
| 585 | .no_tuner = 1, |
| 586 | .demod_init = cxusb_mt352_demod_init, |
| 587 | }; |
| 588 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 589 | /* FIXME: needs tweaking */ |
| 590 | static struct mxl5005s_config aver_a868r_tuner = { |
| 591 | .i2c_address = 0x63, |
| 592 | .if_freq = 6000000UL, |
| 593 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, |
| 594 | .agc_mode = MXL_SINGLE_AGC, |
| 595 | .tracking_filter = MXL_TF_C, |
| 596 | .rssi_enable = MXL_RSSI_ENABLE, |
| 597 | .cap_select = MXL_CAP_SEL_ENABLE, |
| 598 | .div_out = MXL_DIV_OUT_4, |
| 599 | .clock_out = MXL_CLOCK_OUT_DISABLE, |
| 600 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, |
| 601 | .top = MXL5005S_TOP_25P2, |
| 602 | .mod_mode = MXL_DIGITAL_MODE, |
| 603 | .if_mode = MXL_ZERO_IF, |
| 604 | .AgcMasterByte = 0x00, |
| 605 | }; |
| 606 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 607 | /* FIXME: needs tweaking */ |
| 608 | static struct mxl5005s_config d680_dmb_tuner = { |
| 609 | .i2c_address = 0x63, |
| 610 | .if_freq = 36125000UL, |
| 611 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, |
| 612 | .agc_mode = MXL_SINGLE_AGC, |
| 613 | .tracking_filter = MXL_TF_C, |
| 614 | .rssi_enable = MXL_RSSI_ENABLE, |
| 615 | .cap_select = MXL_CAP_SEL_ENABLE, |
| 616 | .div_out = MXL_DIV_OUT_4, |
| 617 | .clock_out = MXL_CLOCK_OUT_DISABLE, |
| 618 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, |
| 619 | .top = MXL5005S_TOP_25P2, |
| 620 | .mod_mode = MXL_DIGITAL_MODE, |
| 621 | .if_mode = MXL_ZERO_IF, |
| 622 | .AgcMasterByte = 0x00, |
| 623 | }; |
| 624 | |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 625 | static struct max2165_config mygica_d689_max2165_cfg = { |
| 626 | .i2c_address = 0x60, |
| 627 | .osc_clk = 20 |
| 628 | }; |
| 629 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 630 | /* Callbacks for DVB USB */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 631 | static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 632 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 633 | dvb_attach(simple_tuner_attach, adap->fe_adap[0].fe, |
Michael Krufky | cb89cd3 | 2008-04-22 14:46:16 -0300 | [diff] [blame] | 634 | &adap->dev->i2c_adap, 0x61, |
| 635 | TUNER_PHILIPS_FMD1216ME_MK3); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 636 | return 0; |
| 637 | } |
| 638 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 639 | static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap) |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 640 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 641 | dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 642 | NULL, DVB_PLL_THOMSON_DTT7579); |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 643 | return 0; |
| 644 | } |
| 645 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 646 | static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap) |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 647 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 648 | dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, NULL, DVB_PLL_LG_Z201); |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 649 | return 0; |
| 650 | } |
| 651 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 652 | static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap) |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 653 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 654 | dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x60, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 655 | NULL, DVB_PLL_THOMSON_DTT7579); |
Patrick Boettcher | 332bed5 | 2006-05-14 04:49:00 -0300 | [diff] [blame] | 656 | return 0; |
| 657 | } |
| 658 | |
Michael Krufky | f71a56c | 2006-10-13 21:55:57 -0300 | [diff] [blame] | 659 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap) |
Patrick Boettcher | 332bed5 | 2006-05-14 04:49:00 -0300 | [diff] [blame] | 660 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 661 | dvb_attach(simple_tuner_attach, adap->fe_adap[0].fe, |
Michael Krufky | 827855d | 2008-04-22 14:46:16 -0300 | [diff] [blame] | 662 | &adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF); |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 663 | return 0; |
| 664 | } |
| 665 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 666 | static int dvico_bluebird_xc2028_callback(void *ptr, int component, |
| 667 | int command, int arg) |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 668 | { |
Robert Lowery | d483b73 | 2008-07-30 19:43:11 -0300 | [diff] [blame] | 669 | struct dvb_usb_adapter *adap = ptr; |
| 670 | struct dvb_usb_device *d = adap->dev; |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 671 | |
| 672 | switch (command) { |
| 673 | case XC2028_TUNER_RESET: |
Harvey Harrison | 708bebd | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 674 | deb_info("%s: XC2028_TUNER_RESET %d\n", __func__, arg); |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 675 | cxusb_bluebird_gpio_pulse(d, 0x01, 1); |
| 676 | break; |
| 677 | case XC2028_RESET_CLK: |
Harvey Harrison | 708bebd | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 678 | deb_info("%s: XC2028_RESET_CLK %d\n", __func__, arg); |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 679 | break; |
Mauro Carvalho Chehab | 9893b90 | 2018-01-24 06:01:57 -0500 | [diff] [blame] | 680 | case XC2028_I2C_FLUSH: |
| 681 | break; |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 682 | default: |
Harvey Harrison | 708bebd | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 683 | deb_info("%s: unknown command %d, arg %d\n", __func__, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 684 | command, arg); |
| 685 | return -EINVAL; |
| 686 | } |
| 687 | |
| 688 | return 0; |
| 689 | } |
| 690 | |
| 691 | static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap) |
| 692 | { |
| 693 | struct dvb_frontend *fe; |
| 694 | struct xc2028_config cfg = { |
| 695 | .i2c_adap = &adap->dev->i2c_adap, |
| 696 | .i2c_addr = 0x61, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 697 | }; |
| 698 | static struct xc2028_ctrl ctl = { |
Michael Krufky | ef80bfe | 2008-09-16 02:15:30 -0300 | [diff] [blame] | 699 | .fname = XC2028_DEFAULT_FIRMWARE, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 700 | .max_len = 64, |
Robert Lowery | d483b73 | 2008-07-30 19:43:11 -0300 | [diff] [blame] | 701 | .demod = XC3028_FE_ZARLINK456, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 702 | }; |
| 703 | |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 704 | /* FIXME: generalize & move to common area */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 705 | adap->fe_adap[0].fe->callback = dvico_bluebird_xc2028_callback; |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 706 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 707 | fe = dvb_attach(xc2028_attach, adap->fe_adap[0].fe, &cfg); |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 708 | if (fe == NULL || fe->ops.tuner_ops.set_config == NULL) |
| 709 | return -EIO; |
| 710 | |
| 711 | fe->ops.tuner_ops.set_config(fe, &ctl); |
| 712 | |
| 713 | return 0; |
| 714 | } |
| 715 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 716 | static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) |
| 717 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 718 | dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe, |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 719 | &adap->dev->i2c_adap, &aver_a868r_tuner); |
| 720 | return 0; |
| 721 | } |
| 722 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 723 | static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap) |
| 724 | { |
| 725 | struct dvb_frontend *fe; |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 726 | fe = dvb_attach(mxl5005s_attach, adap->fe_adap[0].fe, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 727 | &adap->dev->i2c_adap, &d680_dmb_tuner); |
| 728 | return (fe == NULL) ? -EIO : 0; |
| 729 | } |
| 730 | |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 731 | static int cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap) |
| 732 | { |
| 733 | struct dvb_frontend *fe; |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 734 | fe = dvb_attach(max2165_attach, adap->fe_adap[0].fe, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 735 | &adap->dev->i2c_adap, &mygica_d689_max2165_cfg); |
| 736 | return (fe == NULL) ? -EIO : 0; |
| 737 | } |
| 738 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 739 | static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 740 | { |
Patrick Boettcher | e2efeab | 2005-09-09 13:02:51 -0700 | [diff] [blame] | 741 | u8 b; |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 742 | if (usb_set_interface(adap->dev->udev, 0, 6) < 0) |
Patrick Boettcher | 8257e8a | 2005-07-07 17:58:15 -0700 | [diff] [blame] | 743 | err("set interface failed"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 744 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 745 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 746 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 747 | adap->fe_adap[0].fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, |
| 748 | &adap->dev->i2c_adap); |
| 749 | if ((adap->fe_adap[0].fe) != NULL) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 750 | return 0; |
| 751 | |
| 752 | return -EIO; |
| 753 | } |
| 754 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 755 | static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 756 | { |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 757 | if (usb_set_interface(adap->dev->udev, 0, 7) < 0) |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 758 | err("set interface failed"); |
| 759 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 760 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 761 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 762 | adap->fe_adap[0].fe = dvb_attach(lgdt330x_attach, |
| 763 | &cxusb_lgdt3303_config, |
Mauro Carvalho Chehab | 23ba635 | 2018-03-09 10:53:30 -0500 | [diff] [blame] | 764 | 0x0e, |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 765 | &adap->dev->i2c_adap); |
| 766 | if ((adap->fe_adap[0].fe) != NULL) |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 767 | return 0; |
| 768 | |
| 769 | return -EIO; |
| 770 | } |
| 771 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 772 | static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) |
| 773 | { |
Mauro Carvalho Chehab | 23ba635 | 2018-03-09 10:53:30 -0500 | [diff] [blame] | 774 | adap->fe_adap[0].fe = dvb_attach(lgdt330x_attach, |
| 775 | &cxusb_aver_lgdt3303_config, |
| 776 | 0x0e, |
| 777 | &adap->dev->i2c_adap); |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 778 | if (adap->fe_adap[0].fe != NULL) |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 779 | return 0; |
| 780 | |
| 781 | return -EIO; |
| 782 | } |
| 783 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 784 | static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap) |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 785 | { |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 786 | /* used in both lgz201 and th7579 */ |
| 787 | if (usb_set_interface(adap->dev->udev, 0, 0) < 0) |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 788 | err("set interface failed"); |
| 789 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 790 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 791 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 792 | adap->fe_adap[0].fe = dvb_attach(mt352_attach, &cxusb_mt352_config, |
| 793 | &adap->dev->i2c_adap); |
| 794 | if ((adap->fe_adap[0].fe) != NULL) |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 795 | return 0; |
| 796 | |
| 797 | return -EIO; |
| 798 | } |
| 799 | |
| 800 | static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap) |
| 801 | { |
| 802 | if (usb_set_interface(adap->dev->udev, 0, 0) < 0) |
| 803 | err("set interface failed"); |
| 804 | |
| 805 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
| 806 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 807 | adap->fe_adap[0].fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, |
| 808 | &adap->dev->i2c_adap); |
| 809 | if ((adap->fe_adap[0].fe) != NULL) |
| 810 | return 0; |
| 811 | |
| 812 | adap->fe_adap[0].fe = dvb_attach(zl10353_attach, |
| 813 | &cxusb_zl10353_dee1601_config, |
| 814 | &adap->dev->i2c_adap); |
| 815 | if ((adap->fe_adap[0].fe) != NULL) |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 816 | return 0; |
| 817 | |
| 818 | return -EIO; |
| 819 | } |
| 820 | |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 821 | static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap) |
| 822 | { |
| 823 | u8 ircode[4]; |
| 824 | int i; |
| 825 | struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD, |
| 826 | .buf = ircode, .len = 4 }; |
| 827 | |
| 828 | if (usb_set_interface(adap->dev->udev, 0, 1) < 0) |
| 829 | err("set interface failed"); |
| 830 | |
| 831 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
| 832 | |
| 833 | /* reset the tuner and demodulator */ |
| 834 | cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0); |
| 835 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); |
| 836 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); |
| 837 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 838 | adap->fe_adap[0].fe = |
| 839 | dvb_attach(zl10353_attach, |
| 840 | &cxusb_zl10353_xc3028_config_no_i2c_gate, |
| 841 | &adap->dev->i2c_adap); |
| 842 | if ((adap->fe_adap[0].fe) == NULL) |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 843 | return -EIO; |
| 844 | |
| 845 | /* try to determine if there is no IR decoder on the I2C bus */ |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 846 | for (i = 0; adap->dev->props.rc.core.rc_codes && i < 5; i++) { |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 847 | msleep(20); |
| 848 | if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1) |
| 849 | goto no_IR; |
| 850 | if (ircode[0] == 0 && ircode[1] == 0) |
| 851 | continue; |
| 852 | if (ircode[2] + ircode[3] != 0xff) { |
| 853 | no_IR: |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 854 | adap->dev->props.rc.core.rc_codes = NULL; |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 855 | info("No IR receiver detected on this device."); |
| 856 | break; |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | return 0; |
| 861 | } |
| 862 | |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 863 | static struct dibx000_agc_config dib7070_agc_config = { |
| 864 | .band_caps = BAND_UHF | BAND_VHF | BAND_LBAND | BAND_SBAND, |
| 865 | |
| 866 | /* |
| 867 | * P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=5, |
| 868 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, P_agc_inh_dc_rv_est=0, |
| 869 | * P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 |
| 870 | */ |
| 871 | .setup = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | |
| 872 | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), |
| 873 | .inv_gain = 600, |
| 874 | .time_stabiliz = 10, |
| 875 | .alpha_level = 0, |
| 876 | .thlock = 118, |
| 877 | .wbd_inv = 0, |
| 878 | .wbd_ref = 3530, |
| 879 | .wbd_sel = 1, |
| 880 | .wbd_alpha = 5, |
| 881 | .agc1_max = 65535, |
| 882 | .agc1_min = 0, |
| 883 | .agc2_max = 65535, |
| 884 | .agc2_min = 0, |
| 885 | .agc1_pt1 = 0, |
| 886 | .agc1_pt2 = 40, |
| 887 | .agc1_pt3 = 183, |
| 888 | .agc1_slope1 = 206, |
| 889 | .agc1_slope2 = 255, |
| 890 | .agc2_pt1 = 72, |
| 891 | .agc2_pt2 = 152, |
| 892 | .agc2_slope1 = 88, |
| 893 | .agc2_slope2 = 90, |
| 894 | .alpha_mant = 17, |
| 895 | .alpha_exp = 27, |
| 896 | .beta_mant = 23, |
| 897 | .beta_exp = 51, |
| 898 | .perform_agc_softsplit = 0, |
| 899 | }; |
| 900 | |
| 901 | static struct dibx000_bandwidth_config dib7070_bw_config_12_mhz = { |
| 902 | .internal = 60000, |
| 903 | .sampling = 15000, |
| 904 | .pll_prediv = 1, |
| 905 | .pll_ratio = 20, |
| 906 | .pll_range = 3, |
| 907 | .pll_reset = 1, |
| 908 | .pll_bypass = 0, |
| 909 | .enable_refdiv = 0, |
| 910 | .bypclk_div = 0, |
| 911 | .IO_CLK_en_core = 1, |
| 912 | .ADClkSrc = 1, |
| 913 | .modulo = 2, |
| 914 | /* refsel, sel, freq_15k */ |
| 915 | .sad_cfg = (3 << 14) | (1 << 12) | (524 << 0), |
| 916 | .ifreq = (0 << 25) | 0, |
| 917 | .timf = 20452225, |
| 918 | .xtal_hz = 12000000, |
| 919 | }; |
| 920 | |
| 921 | static struct dib7000p_config cxusb_dualdig4_rev2_config = { |
| 922 | .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK, |
| 923 | .output_mpeg2_in_188_bytes = 1, |
| 924 | |
| 925 | .agc_config_count = 1, |
| 926 | .agc = &dib7070_agc_config, |
| 927 | .bw = &dib7070_bw_config_12_mhz, |
| 928 | .tuner_is_baseband = 1, |
| 929 | .spur_protect = 1, |
| 930 | |
| 931 | .gpio_dir = 0xfcef, |
| 932 | .gpio_val = 0x0110, |
| 933 | |
| 934 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, |
| 935 | |
| 936 | .hostbus_diversity = 1, |
| 937 | }; |
| 938 | |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 939 | struct dib0700_adapter_state { |
| 940 | int (*set_param_save)(struct dvb_frontend *); |
| 941 | struct dib7000p_ops dib7000p_ops; |
| 942 | }; |
| 943 | |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 944 | static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap) |
| 945 | { |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 946 | struct dib0700_adapter_state *state = adap->priv; |
| 947 | |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 948 | if (usb_set_interface(adap->dev->udev, 0, 1) < 0) |
| 949 | err("set interface failed"); |
| 950 | |
| 951 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
| 952 | |
| 953 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); |
| 954 | |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 955 | if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) |
| 956 | return -ENODEV; |
| 957 | |
| 958 | if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
| 959 | &cxusb_dualdig4_rev2_config) < 0) { |
Prarit Bhargava | a49ba16 | 2010-05-12 19:30:02 -0300 | [diff] [blame] | 960 | printk(KERN_WARNING "Unable to enumerate dib7000p\n"); |
Randy Dunlap | 30d81bb | 2010-02-08 20:30:44 -0300 | [diff] [blame] | 961 | return -ENODEV; |
Prarit Bhargava | a49ba16 | 2010-05-12 19:30:02 -0300 | [diff] [blame] | 962 | } |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 963 | |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 964 | adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, |
| 965 | &cxusb_dualdig4_rev2_config); |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 966 | if (adap->fe_adap[0].fe == NULL) |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 967 | return -EIO; |
| 968 | |
| 969 | return 0; |
| 970 | } |
| 971 | |
| 972 | static int dib7070_tuner_reset(struct dvb_frontend *fe, int onoff) |
| 973 | { |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 974 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 975 | struct dib0700_adapter_state *state = adap->priv; |
| 976 | |
| 977 | return state->dib7000p_ops.set_gpio(fe, 8, 0, !onoff); |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 978 | } |
| 979 | |
| 980 | static int dib7070_tuner_sleep(struct dvb_frontend *fe, int onoff) |
| 981 | { |
| 982 | return 0; |
| 983 | } |
| 984 | |
| 985 | static struct dib0070_config dib7070p_dib0070_config = { |
| 986 | .i2c_address = DEFAULT_DIB0070_I2C_ADDRESS, |
| 987 | .reset = dib7070_tuner_reset, |
| 988 | .sleep = dib7070_tuner_sleep, |
| 989 | .clock_khz = 12000, |
| 990 | }; |
| 991 | |
Mauro Carvalho Chehab | 14d24d1 | 2011-12-24 12:24:33 -0300 | [diff] [blame] | 992 | static int dib7070_set_param_override(struct dvb_frontend *fe) |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 993 | { |
Mauro Carvalho Chehab | afd2b38 | 2011-12-24 10:17:30 -0300 | [diff] [blame] | 994 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 995 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
| 996 | struct dib0700_adapter_state *state = adap->priv; |
| 997 | |
| 998 | u16 offset; |
Mauro Carvalho Chehab | afd2b38 | 2011-12-24 10:17:30 -0300 | [diff] [blame] | 999 | u8 band = BAND_OF_FREQUENCY(p->frequency/1000); |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1000 | switch (band) { |
Michael Krufky | a2dc86b | 2008-08-09 13:06:26 -0300 | [diff] [blame] | 1001 | case BAND_VHF: offset = 950; break; |
| 1002 | default: |
| 1003 | case BAND_UHF: offset = 550; break; |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1004 | } |
| 1005 | |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 1006 | state->dib7000p_ops.set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1007 | |
Mauro Carvalho Chehab | 14d24d1 | 2011-12-24 12:24:33 -0300 | [diff] [blame] | 1008 | return state->set_param_save(fe); |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1009 | } |
| 1010 | |
| 1011 | static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap) |
| 1012 | { |
| 1013 | struct dib0700_adapter_state *st = adap->priv; |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 1014 | struct i2c_adapter *tun_i2c; |
| 1015 | |
| 1016 | /* |
| 1017 | * No need to call dvb7000p_attach here, as it was called |
| 1018 | * already, as frontend_attach method is called first, and |
Mauro Carvalho Chehab | 3e4d8f4 | 2019-02-18 14:29:03 -0500 | [diff] [blame] | 1019 | * tuner_attach is only called on success. |
Mauro Carvalho Chehab | 8abe4a0 | 2014-05-29 09:20:15 -0300 | [diff] [blame] | 1020 | */ |
| 1021 | tun_i2c = st->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, |
Michael Krufky | a2dc86b | 2008-08-09 13:06:26 -0300 | [diff] [blame] | 1022 | DIBX000_I2C_INTERFACE_TUNER, 1); |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1023 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1024 | if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1025 | &dib7070p_dib0070_config) == NULL) |
| 1026 | return -ENODEV; |
| 1027 | |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1028 | st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; |
| 1029 | adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7070_set_param_override; |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1030 | return 0; |
| 1031 | } |
| 1032 | |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1033 | static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap) |
| 1034 | { |
| 1035 | if (usb_set_interface(adap->dev->udev, 0, 1) < 0) |
| 1036 | err("set interface failed"); |
| 1037 | |
| 1038 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
| 1039 | |
| 1040 | /* reset the tuner and demodulator */ |
| 1041 | cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0); |
| 1042 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); |
| 1043 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); |
| 1044 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 1045 | adap->fe_adap[0].fe = dvb_attach(zl10353_attach, |
| 1046 | &cxusb_zl10353_xc3028_config, |
| 1047 | &adap->dev->i2c_adap); |
| 1048 | if ((adap->fe_adap[0].fe) != NULL) |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1049 | return 0; |
| 1050 | |
Michael Krufky | 310df36 | 2011-09-17 14:22:59 -0300 | [diff] [blame] | 1051 | adap->fe_adap[0].fe = dvb_attach(mt352_attach, |
| 1052 | &cxusb_mt352_xc3028_config, |
| 1053 | &adap->dev->i2c_adap); |
| 1054 | if ((adap->fe_adap[0].fe) != NULL) |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1055 | return 0; |
| 1056 | |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1057 | return -EIO; |
| 1058 | } |
| 1059 | |
David T.L. Wong | 6bf1a99 | 2009-08-05 13:07:10 -0300 | [diff] [blame] | 1060 | static struct lgs8gxx_config d680_lgs8gl5_cfg = { |
| 1061 | .prod = LGS8GXX_PROD_LGS8GL5, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1062 | .demod_address = 0x19, |
David T.L. Wong | 6bf1a99 | 2009-08-05 13:07:10 -0300 | [diff] [blame] | 1063 | .serial_ts = 0, |
| 1064 | .ts_clk_pol = 0, |
| 1065 | .ts_clk_gated = 1, |
| 1066 | .if_clk_freq = 30400, /* 30.4 MHz */ |
| 1067 | .if_freq = 5725, /* 5.725 MHz */ |
| 1068 | .if_neg_center = 0, |
| 1069 | .ext_adc = 0, |
| 1070 | .adc_signed = 0, |
| 1071 | .if_neg_edge = 0, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1072 | }; |
| 1073 | |
| 1074 | static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap) |
| 1075 | { |
| 1076 | struct dvb_usb_device *d = adap->dev; |
| 1077 | int n; |
| 1078 | |
| 1079 | /* Select required USB configuration */ |
| 1080 | if (usb_set_interface(d->udev, 0, 0) < 0) |
| 1081 | err("set interface failed"); |
| 1082 | |
| 1083 | /* Unblock all USB pipes */ |
| 1084 | usb_clear_halt(d->udev, |
| 1085 | usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1086 | usb_clear_halt(d->udev, |
| 1087 | usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1088 | usb_clear_halt(d->udev, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1089 | usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1090 | |
| 1091 | /* Drain USB pipes to avoid hang after reboot */ |
| 1092 | for (n = 0; n < 5; n++) { |
| 1093 | cxusb_d680_dmb_drain_message(d); |
| 1094 | cxusb_d680_dmb_drain_video(d); |
| 1095 | msleep(200); |
| 1096 | } |
| 1097 | |
| 1098 | /* Reset the tuner */ |
| 1099 | if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 0) < 0) { |
| 1100 | err("clear tuner gpio failed"); |
| 1101 | return -EIO; |
| 1102 | } |
| 1103 | msleep(100); |
| 1104 | if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 1) < 0) { |
| 1105 | err("set tuner gpio failed"); |
| 1106 | return -EIO; |
| 1107 | } |
| 1108 | msleep(100); |
| 1109 | |
| 1110 | /* Attach frontend */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1111 | adap->fe_adap[0].fe = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap); |
| 1112 | if (adap->fe_adap[0].fe == NULL) |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1113 | return -EIO; |
| 1114 | |
| 1115 | return 0; |
| 1116 | } |
| 1117 | |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1118 | static struct atbm8830_config mygica_d689_atbm8830_cfg = { |
| 1119 | .prod = ATBM8830_PROD_8830, |
| 1120 | .demod_address = 0x40, |
| 1121 | .serial_ts = 0, |
| 1122 | .ts_sampling_edge = 1, |
| 1123 | .ts_clk_gated = 0, |
| 1124 | .osc_clk_freq = 30400, /* in kHz */ |
| 1125 | .if_freq = 0, /* zero IF */ |
| 1126 | .zif_swap_iq = 1, |
David Wong | c245c75 | 2009-11-28 08:36:31 -0300 | [diff] [blame] | 1127 | .agc_min = 0x2E, |
| 1128 | .agc_max = 0x90, |
| 1129 | .agc_hold_loop = 0, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1130 | }; |
| 1131 | |
| 1132 | static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap) |
| 1133 | { |
| 1134 | struct dvb_usb_device *d = adap->dev; |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1135 | |
| 1136 | /* Select required USB configuration */ |
| 1137 | if (usb_set_interface(d->udev, 0, 0) < 0) |
| 1138 | err("set interface failed"); |
| 1139 | |
| 1140 | /* Unblock all USB pipes */ |
| 1141 | usb_clear_halt(d->udev, |
| 1142 | usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1143 | usb_clear_halt(d->udev, |
| 1144 | usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1145 | usb_clear_halt(d->udev, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1146 | usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1147 | |
| 1148 | |
| 1149 | /* Reset the tuner */ |
| 1150 | if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 0) < 0) { |
| 1151 | err("clear tuner gpio failed"); |
| 1152 | return -EIO; |
| 1153 | } |
| 1154 | msleep(100); |
| 1155 | if (cxusb_d680_dmb_gpio_tuner(d, 0x07, 1) < 0) { |
| 1156 | err("set tuner gpio failed"); |
| 1157 | return -EIO; |
| 1158 | } |
| 1159 | msleep(100); |
| 1160 | |
| 1161 | /* Attach frontend */ |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1162 | adap->fe_adap[0].fe = dvb_attach(atbm8830_attach, &mygica_d689_atbm8830_cfg, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1163 | &d->i2c_adap); |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1164 | if (adap->fe_adap[0].fe == NULL) |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1165 | return -EIO; |
| 1166 | |
| 1167 | return 0; |
| 1168 | } |
| 1169 | |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1170 | static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap) |
| 1171 | { |
| 1172 | struct dvb_usb_device *d = adap->dev; |
| 1173 | struct cxusb_state *st = d->priv; |
| 1174 | struct i2c_adapter *adapter; |
| 1175 | struct i2c_client *client_demod; |
| 1176 | struct i2c_client *client_tuner; |
| 1177 | struct i2c_board_info info; |
| 1178 | struct si2168_config si2168_config; |
| 1179 | struct si2157_config si2157_config; |
| 1180 | |
| 1181 | /* Select required USB configuration */ |
| 1182 | if (usb_set_interface(d->udev, 0, 0) < 0) |
| 1183 | err("set interface failed"); |
| 1184 | |
| 1185 | /* Unblock all USB pipes */ |
| 1186 | usb_clear_halt(d->udev, |
| 1187 | usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1188 | usb_clear_halt(d->udev, |
| 1189 | usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); |
| 1190 | usb_clear_halt(d->udev, |
| 1191 | usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); |
| 1192 | |
| 1193 | /* attach frontend */ |
| 1194 | si2168_config.i2c_adapter = &adapter; |
| 1195 | si2168_config.fe = &adap->fe_adap[0].fe; |
| 1196 | si2168_config.ts_mode = SI2168_TS_PARALLEL; |
| 1197 | si2168_config.ts_clock_inv = 1; |
| 1198 | memset(&info, 0, sizeof(struct i2c_board_info)); |
Mauro Carvalho Chehab | c0decac | 2018-09-10 08:19:14 -0400 | [diff] [blame] | 1199 | strscpy(info.type, "si2168", I2C_NAME_SIZE); |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1200 | info.addr = 0x64; |
| 1201 | info.platform_data = &si2168_config; |
| 1202 | request_module(info.type); |
| 1203 | client_demod = i2c_new_device(&d->i2c_adap, &info); |
| 1204 | if (client_demod == NULL || client_demod->dev.driver == NULL) |
| 1205 | return -ENODEV; |
| 1206 | |
| 1207 | if (!try_module_get(client_demod->dev.driver->owner)) { |
| 1208 | i2c_unregister_device(client_demod); |
| 1209 | return -ENODEV; |
| 1210 | } |
| 1211 | |
| 1212 | st->i2c_client_demod = client_demod; |
| 1213 | |
| 1214 | /* attach tuner */ |
| 1215 | memset(&si2157_config, 0, sizeof(si2157_config)); |
| 1216 | si2157_config.fe = adap->fe_adap[0].fe; |
Olli Salonen | ee3c3e4 | 2015-05-05 13:54:17 -0300 | [diff] [blame] | 1217 | si2157_config.if_port = 1; |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1218 | memset(&info, 0, sizeof(struct i2c_board_info)); |
Mauro Carvalho Chehab | c0decac | 2018-09-10 08:19:14 -0400 | [diff] [blame] | 1219 | strscpy(info.type, "si2157", I2C_NAME_SIZE); |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1220 | info.addr = 0x60; |
| 1221 | info.platform_data = &si2157_config; |
| 1222 | request_module(info.type); |
| 1223 | client_tuner = i2c_new_device(adapter, &info); |
| 1224 | if (client_tuner == NULL || client_tuner->dev.driver == NULL) { |
| 1225 | module_put(client_demod->dev.driver->owner); |
| 1226 | i2c_unregister_device(client_demod); |
| 1227 | return -ENODEV; |
| 1228 | } |
| 1229 | if (!try_module_get(client_tuner->dev.driver->owner)) { |
| 1230 | i2c_unregister_device(client_tuner); |
| 1231 | module_put(client_demod->dev.driver->owner); |
| 1232 | i2c_unregister_device(client_demod); |
| 1233 | return -ENODEV; |
| 1234 | } |
| 1235 | |
| 1236 | st->i2c_client_tuner = client_tuner; |
| 1237 | |
CrazyCat | 5fa8815 | 2016-10-21 17:35:40 -0200 | [diff] [blame] | 1238 | /* hook fe: need to resync the slave fifo when signal locks. */ |
| 1239 | mutex_init(&st->stream_mutex); |
| 1240 | st->last_lock = 0; |
| 1241 | st->fe_read_status = adap->fe_adap[0].fe->ops.read_status; |
| 1242 | adap->fe_adap[0].fe->ops.read_status = cxusb_read_status; |
| 1243 | |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1244 | return 0; |
| 1245 | } |
| 1246 | |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1247 | /* |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1248 | * DViCO has shipped two devices with the same USB ID, but only one of them |
| 1249 | * needs a firmware download. Check the device class details to see if they |
| 1250 | * have non-default values to decide whether the device is actually cold or |
| 1251 | * not, and forget a match if it turns out we selected the wrong device. |
| 1252 | */ |
| 1253 | static int bluebird_fx2_identify_state(struct usb_device *udev, |
| 1254 | struct dvb_usb_device_properties *props, |
| 1255 | struct dvb_usb_device_description **desc, |
| 1256 | int *cold) |
| 1257 | { |
| 1258 | int wascold = *cold; |
| 1259 | |
| 1260 | *cold = udev->descriptor.bDeviceClass == 0xff && |
| 1261 | udev->descriptor.bDeviceSubClass == 0xff && |
| 1262 | udev->descriptor.bDeviceProtocol == 0xff; |
| 1263 | |
| 1264 | if (*cold && !wascold) |
| 1265 | *desc = NULL; |
| 1266 | |
| 1267 | return 0; |
| 1268 | } |
| 1269 | |
| 1270 | /* |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1271 | * DViCO bluebird firmware needs the "warm" product ID to be patched into the |
| 1272 | * firmware file before download. |
| 1273 | */ |
| 1274 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1275 | static const int dvico_firmware_id_offsets[] = { 6638, 3204 }; |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 1276 | static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, |
| 1277 | const struct firmware *fw) |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1278 | { |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1279 | int pos; |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1280 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1281 | for (pos = 0; pos < ARRAY_SIZE(dvico_firmware_id_offsets); pos++) { |
| 1282 | int idoff = dvico_firmware_id_offsets[pos]; |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1283 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1284 | if (fw->size < idoff + 4) |
| 1285 | continue; |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1286 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1287 | if (fw->data[idoff] == (USB_VID_DVICO & 0xff) && |
| 1288 | fw->data[idoff + 1] == USB_VID_DVICO >> 8) { |
David Woodhouse | e62f89f | 2008-05-24 00:12:42 +0100 | [diff] [blame] | 1289 | struct firmware new_fw; |
| 1290 | u8 *new_fw_data = vmalloc(fw->size); |
| 1291 | int ret; |
| 1292 | |
| 1293 | if (!new_fw_data) |
| 1294 | return -ENOMEM; |
| 1295 | |
| 1296 | memcpy(new_fw_data, fw->data, fw->size); |
| 1297 | new_fw.size = fw->size; |
| 1298 | new_fw.data = new_fw_data; |
| 1299 | |
| 1300 | new_fw_data[idoff + 2] = |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1301 | le16_to_cpu(udev->descriptor.idProduct) + 1; |
David Woodhouse | e62f89f | 2008-05-24 00:12:42 +0100 | [diff] [blame] | 1302 | new_fw_data[idoff + 3] = |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1303 | le16_to_cpu(udev->descriptor.idProduct) >> 8; |
| 1304 | |
David Woodhouse | e62f89f | 2008-05-24 00:12:42 +0100 | [diff] [blame] | 1305 | ret = usb_cypress_load_firmware(udev, &new_fw, |
| 1306 | CYPRESS_FX2); |
| 1307 | vfree(new_fw_data); |
| 1308 | return ret; |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1309 | } |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1310 | } |
| 1311 | |
| 1312 | return -EINVAL; |
| 1313 | } |
| 1314 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1315 | /* DVB USB Driver stuff */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1316 | static struct dvb_usb_device_properties cxusb_medion_properties; |
| 1317 | static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties; |
| 1318 | static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties; |
| 1319 | static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties; |
| 1320 | static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties; |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1321 | static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties; |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1322 | static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties; |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1323 | static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties; |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1324 | static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties; |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1325 | static struct dvb_usb_device_properties cxusb_aver_a868r_properties; |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1326 | static struct dvb_usb_device_properties cxusb_d680_dmb_properties; |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1327 | static struct dvb_usb_device_properties cxusb_mygica_d689_properties; |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1328 | static struct dvb_usb_device_properties cxusb_mygica_t230_properties; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1329 | |
| 1330 | static int cxusb_probe(struct usb_interface *intf, |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 1331 | const struct usb_device_id *id) |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1332 | { |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1333 | if (0 == dvb_usb_device_init(intf, &cxusb_medion_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1334 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1335 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgh064f_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1336 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1337 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dee1601_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1338 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1339 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgz201_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1340 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1341 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dtt7579_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1342 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1343 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1344 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1345 | 0 == dvb_usb_device_init(intf, &cxusb_bluebird_nano2_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1346 | THIS_MODULE, NULL, adapter_nr) || |
Janne Grunau | 78e92006 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 1347 | 0 == dvb_usb_device_init(intf, |
| 1348 | &cxusb_bluebird_nano2_needsfirmware_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1349 | THIS_MODULE, NULL, adapter_nr) || |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1350 | 0 == dvb_usb_device_init(intf, &cxusb_aver_a868r_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1351 | THIS_MODULE, NULL, adapter_nr) || |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1352 | 0 == dvb_usb_device_init(intf, |
| 1353 | &cxusb_bluebird_dualdig4_rev2_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1354 | THIS_MODULE, NULL, adapter_nr) || |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 1355 | 0 == dvb_usb_device_init(intf, &cxusb_d680_dmb_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1356 | THIS_MODULE, NULL, adapter_nr) || |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 1357 | 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1358 | THIS_MODULE, NULL, adapter_nr) || |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 1359 | 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, |
Mauro Carvalho Chehab | 7724325 | 2016-11-12 12:46:26 -0200 | [diff] [blame] | 1360 | THIS_MODULE, NULL, adapter_nr) || |
| 1361 | 0) |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1362 | return 0; |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1363 | |
| 1364 | return -EINVAL; |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1365 | } |
| 1366 | |
Olli Salonen | 26c42b0 | 2014-07-13 10:52:22 -0300 | [diff] [blame] | 1367 | static void cxusb_disconnect(struct usb_interface *intf) |
| 1368 | { |
| 1369 | struct dvb_usb_device *d = usb_get_intfdata(intf); |
| 1370 | struct cxusb_state *st = d->priv; |
| 1371 | struct i2c_client *client; |
| 1372 | |
| 1373 | /* remove I2C client for tuner */ |
| 1374 | client = st->i2c_client_tuner; |
| 1375 | if (client) { |
| 1376 | module_put(client->dev.driver->owner); |
| 1377 | i2c_unregister_device(client); |
| 1378 | } |
| 1379 | |
| 1380 | /* remove I2C client for demodulator */ |
| 1381 | client = st->i2c_client_demod; |
| 1382 | if (client) { |
| 1383 | module_put(client->dev.driver->owner); |
| 1384 | i2c_unregister_device(client); |
| 1385 | } |
| 1386 | |
| 1387 | dvb_usb_device_exit(intf); |
| 1388 | } |
| 1389 | |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1390 | enum cxusb_table_index { |
| 1391 | MEDION_MD95700, |
| 1392 | DVICO_BLUEBIRD_LG064F_COLD, |
| 1393 | DVICO_BLUEBIRD_LG064F_WARM, |
| 1394 | DVICO_BLUEBIRD_DUAL_1_COLD, |
| 1395 | DVICO_BLUEBIRD_DUAL_1_WARM, |
| 1396 | DVICO_BLUEBIRD_LGZ201_COLD, |
| 1397 | DVICO_BLUEBIRD_LGZ201_WARM, |
| 1398 | DVICO_BLUEBIRD_TH7579_COLD, |
| 1399 | DVICO_BLUEBIRD_TH7579_WARM, |
| 1400 | DIGITALNOW_BLUEBIRD_DUAL_1_COLD, |
| 1401 | DIGITALNOW_BLUEBIRD_DUAL_1_WARM, |
| 1402 | DVICO_BLUEBIRD_DUAL_2_COLD, |
| 1403 | DVICO_BLUEBIRD_DUAL_2_WARM, |
| 1404 | DVICO_BLUEBIRD_DUAL_4, |
| 1405 | DVICO_BLUEBIRD_DVB_T_NANO_2, |
| 1406 | DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM, |
| 1407 | AVERMEDIA_VOLAR_A868R, |
| 1408 | DVICO_BLUEBIRD_DUAL_4_REV_2, |
| 1409 | CONEXANT_D680_DMB, |
| 1410 | MYGICA_D689, |
| 1411 | MYGICA_T230, |
| 1412 | NR__cxusb_table_index |
| 1413 | }; |
| 1414 | |
| 1415 | static struct usb_device_id cxusb_table[NR__cxusb_table_index + 1] = { |
| 1416 | [MEDION_MD95700] = { |
| 1417 | USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) |
| 1418 | }, |
| 1419 | [DVICO_BLUEBIRD_LG064F_COLD] = { |
| 1420 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) |
| 1421 | }, |
| 1422 | [DVICO_BLUEBIRD_LG064F_WARM] = { |
| 1423 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) |
| 1424 | }, |
| 1425 | [DVICO_BLUEBIRD_DUAL_1_COLD] = { |
| 1426 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD) |
| 1427 | }, |
| 1428 | [DVICO_BLUEBIRD_DUAL_1_WARM] = { |
| 1429 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM) |
| 1430 | }, |
| 1431 | [DVICO_BLUEBIRD_LGZ201_COLD] = { |
| 1432 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) |
| 1433 | }, |
| 1434 | [DVICO_BLUEBIRD_LGZ201_WARM] = { |
| 1435 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) |
| 1436 | }, |
| 1437 | [DVICO_BLUEBIRD_TH7579_COLD] = { |
| 1438 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) |
| 1439 | }, |
| 1440 | [DVICO_BLUEBIRD_TH7579_WARM] = { |
| 1441 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) |
| 1442 | }, |
| 1443 | [DIGITALNOW_BLUEBIRD_DUAL_1_COLD] = { |
| 1444 | USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD) |
| 1445 | }, |
| 1446 | [DIGITALNOW_BLUEBIRD_DUAL_1_WARM] = { |
| 1447 | USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM) |
| 1448 | }, |
| 1449 | [DVICO_BLUEBIRD_DUAL_2_COLD] = { |
| 1450 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) |
| 1451 | }, |
| 1452 | [DVICO_BLUEBIRD_DUAL_2_WARM] = { |
| 1453 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) |
| 1454 | }, |
| 1455 | [DVICO_BLUEBIRD_DUAL_4] = { |
| 1456 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) |
| 1457 | }, |
| 1458 | [DVICO_BLUEBIRD_DVB_T_NANO_2] = { |
| 1459 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2) |
| 1460 | }, |
| 1461 | [DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM] = { |
| 1462 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM) |
| 1463 | }, |
| 1464 | [AVERMEDIA_VOLAR_A868R] = { |
| 1465 | USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_VOLAR_A868R) |
| 1466 | }, |
| 1467 | [DVICO_BLUEBIRD_DUAL_4_REV_2] = { |
| 1468 | USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) |
| 1469 | }, |
| 1470 | [CONEXANT_D680_DMB] = { |
| 1471 | USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) |
| 1472 | }, |
| 1473 | [MYGICA_D689] = { |
| 1474 | USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_D689) |
| 1475 | }, |
| 1476 | [MYGICA_T230] = { |
| 1477 | USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) |
| 1478 | }, |
Michael Krufky | f35db23 | 2006-12-05 14:53:39 -0300 | [diff] [blame] | 1479 | {} /* Terminating entry */ |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1480 | }; |
| 1481 | MODULE_DEVICE_TABLE (usb, cxusb_table); |
| 1482 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1483 | static struct dvb_usb_device_properties cxusb_medion_properties = { |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1484 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1485 | |
| 1486 | .usb_ctrl = CYPRESS_FX2, |
| 1487 | |
| 1488 | .size_of_priv = sizeof(struct cxusb_state), |
| 1489 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1490 | .num_adapters = 1, |
| 1491 | .adapter = { |
| 1492 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1493 | .num_frontends = 1, |
| 1494 | .fe = {{ |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1495 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1496 | .frontend_attach = cxusb_cx22702_frontend_attach, |
| 1497 | .tuner_attach = cxusb_fmd1216me_tuner_attach, |
| 1498 | /* parameter for the MPEG2-data transfer */ |
| 1499 | .stream = { |
| 1500 | .type = USB_BULK, |
| 1501 | .count = 5, |
| 1502 | .endpoint = 0x02, |
| 1503 | .u = { |
| 1504 | .bulk = { |
| 1505 | .buffersize = 8192, |
| 1506 | } |
| 1507 | } |
| 1508 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1509 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1510 | }, |
| 1511 | }, |
| 1512 | .power_ctrl = cxusb_power_ctrl, |
| 1513 | |
| 1514 | .i2c_algo = &cxusb_i2c_algo, |
| 1515 | |
| 1516 | .generic_bulk_ctrl_endpoint = 0x01, |
| 1517 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1518 | .num_device_descs = 1, |
| 1519 | .devices = { |
| 1520 | { "Medion MD95700 (MDUSBTV-HYBRID)", |
| 1521 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1522 | { &cxusb_table[MEDION_MD95700], NULL }, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 1523 | }, |
| 1524 | } |
| 1525 | }; |
| 1526 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1527 | static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = { |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1528 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1529 | |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1530 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1531 | .firmware = "dvb-usb-bluebird-01.fw", |
| 1532 | .download_firmware = bluebird_patch_dvico_firmware_download, |
Michael Krufky | 37bdfa0 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1533 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 1534 | use usb alt setting 7 for EP2 transfer (atsc) */ |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1535 | |
| 1536 | .size_of_priv = sizeof(struct cxusb_state), |
| 1537 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1538 | .num_adapters = 1, |
| 1539 | .adapter = { |
| 1540 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1541 | .num_frontends = 1, |
| 1542 | .fe = {{ |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1543 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1544 | .frontend_attach = cxusb_lgdt3303_frontend_attach, |
Michael Krufky | f71a56c | 2006-10-13 21:55:57 -0300 | [diff] [blame] | 1545 | .tuner_attach = cxusb_lgh064f_tuner_attach, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1546 | |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1547 | /* parameter for the MPEG2-data transfer */ |
| 1548 | .stream = { |
| 1549 | .type = USB_BULK, |
| 1550 | .count = 5, |
| 1551 | .endpoint = 0x02, |
| 1552 | .u = { |
| 1553 | .bulk = { |
| 1554 | .buffersize = 8192, |
| 1555 | } |
| 1556 | } |
| 1557 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1558 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1559 | }, |
| 1560 | }, |
| 1561 | |
| 1562 | .power_ctrl = cxusb_bluebird_power_ctrl, |
| 1563 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1564 | .i2c_algo = &cxusb_i2c_algo, |
| 1565 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1566 | .rc.core = { |
| 1567 | .rc_interval = 100, |
| 1568 | .rc_codes = RC_MAP_DVICO_PORTABLE, |
| 1569 | .module_name = KBUILD_MODNAME, |
| 1570 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1571 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1572 | }, |
Michael Krufky | c150178 | 2006-03-26 05:43:36 -0300 | [diff] [blame] | 1573 | |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1574 | .generic_bulk_ctrl_endpoint = 0x01, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1575 | |
| 1576 | .num_device_descs = 1, |
| 1577 | .devices = { |
| 1578 | { "DViCO FusionHDTV5 USB Gold", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1579 | { &cxusb_table[DVICO_BLUEBIRD_LG064F_COLD], NULL }, |
| 1580 | { &cxusb_table[DVICO_BLUEBIRD_LG064F_WARM], NULL }, |
Michael Krufky | effee03 | 2006-01-09 15:25:47 -0200 | [diff] [blame] | 1581 | }, |
| 1582 | } |
| 1583 | }; |
| 1584 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1585 | static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = { |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1586 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1587 | |
Patrick Boettcher | f537378 | 2006-01-09 18:21:38 -0200 | [diff] [blame] | 1588 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1589 | .firmware = "dvb-usb-bluebird-01.fw", |
| 1590 | .download_firmware = bluebird_patch_dvico_firmware_download, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1591 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 1592 | use usb alt setting 7 for EP2 transfer (atsc) */ |
| 1593 | |
| 1594 | .size_of_priv = sizeof(struct cxusb_state), |
| 1595 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1596 | .num_adapters = 1, |
| 1597 | .adapter = { |
| 1598 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1599 | .num_frontends = 1, |
| 1600 | .fe = {{ |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1601 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1602 | .frontend_attach = cxusb_dee1601_frontend_attach, |
| 1603 | .tuner_attach = cxusb_dee1601_tuner_attach, |
| 1604 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1605 | .stream = { |
| 1606 | .type = USB_BULK, |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1607 | .count = 5, |
| 1608 | .endpoint = 0x04, |
| 1609 | .u = { |
| 1610 | .bulk = { |
| 1611 | .buffersize = 8192, |
| 1612 | } |
| 1613 | } |
| 1614 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1615 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1616 | }, |
| 1617 | }, |
| 1618 | |
| 1619 | .power_ctrl = cxusb_bluebird_power_ctrl, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1620 | |
| 1621 | .i2c_algo = &cxusb_i2c_algo, |
| 1622 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1623 | .rc.core = { |
| 1624 | .rc_interval = 100, |
| 1625 | .rc_codes = RC_MAP_DVICO_MCE, |
| 1626 | .module_name = KBUILD_MODNAME, |
| 1627 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1628 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1629 | }, |
Chris Pascoe | 7c23970 | 2006-01-09 18:21:29 -0200 | [diff] [blame] | 1630 | |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1631 | .generic_bulk_ctrl_endpoint = 0x01, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1632 | |
Michael Krufky | 587c03d | 2006-09-28 02:16:01 -0300 | [diff] [blame] | 1633 | .num_device_descs = 3, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1634 | .devices = { |
| 1635 | { "DViCO FusionHDTV DVB-T Dual USB", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1636 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_1_COLD], NULL }, |
| 1637 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_1_WARM], NULL }, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1638 | }, |
Michael Krufky | ac9ffb9 | 2006-01-11 23:21:00 -0200 | [diff] [blame] | 1639 | { "DigitalNow DVB-T Dual USB", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1640 | { &cxusb_table[DIGITALNOW_BLUEBIRD_DUAL_1_COLD], NULL }, |
| 1641 | { &cxusb_table[DIGITALNOW_BLUEBIRD_DUAL_1_WARM], NULL }, |
Michael Krufky | ac9ffb9 | 2006-01-11 23:21:00 -0200 | [diff] [blame] | 1642 | }, |
Michael Krufky | 587c03d | 2006-09-28 02:16:01 -0300 | [diff] [blame] | 1643 | { "DViCO FusionHDTV DVB-T Dual Digital 2", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1644 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_2_COLD], NULL }, |
| 1645 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_2_WARM], NULL }, |
Michael Krufky | 587c03d | 2006-09-28 02:16:01 -0300 | [diff] [blame] | 1646 | }, |
Chris Pascoe | 0029ee1 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 1647 | } |
| 1648 | }; |
| 1649 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1650 | static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = { |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1651 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1652 | |
| 1653 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1654 | .firmware = "dvb-usb-bluebird-01.fw", |
| 1655 | .download_firmware = bluebird_patch_dvico_firmware_download, |
| 1656 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 1657 | use usb alt setting 7 for EP2 transfer (atsc) */ |
| 1658 | |
| 1659 | .size_of_priv = sizeof(struct cxusb_state), |
| 1660 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1661 | .num_adapters = 2, |
| 1662 | .adapter = { |
| 1663 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1664 | .num_frontends = 1, |
| 1665 | .fe = {{ |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1666 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1667 | .frontend_attach = cxusb_mt352_frontend_attach, |
| 1668 | .tuner_attach = cxusb_lgz201_tuner_attach, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1669 | |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1670 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1671 | .stream = { |
| 1672 | .type = USB_BULK, |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1673 | .count = 5, |
| 1674 | .endpoint = 0x04, |
| 1675 | .u = { |
| 1676 | .bulk = { |
| 1677 | .buffersize = 8192, |
| 1678 | } |
| 1679 | } |
| 1680 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1681 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1682 | }, |
| 1683 | }, |
| 1684 | .power_ctrl = cxusb_bluebird_power_ctrl, |
| 1685 | |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1686 | .i2c_algo = &cxusb_i2c_algo, |
| 1687 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1688 | .rc.core = { |
| 1689 | .rc_interval = 100, |
| 1690 | .rc_codes = RC_MAP_DVICO_PORTABLE, |
| 1691 | .module_name = KBUILD_MODNAME, |
| 1692 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1693 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1694 | }, |
Michael Krufky | c150178 | 2006-03-26 05:43:36 -0300 | [diff] [blame] | 1695 | |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1696 | .generic_bulk_ctrl_endpoint = 0x01, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1697 | .num_device_descs = 1, |
| 1698 | .devices = { |
| 1699 | { "DViCO FusionHDTV DVB-T USB (LGZ201)", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1700 | { &cxusb_table[DVICO_BLUEBIRD_LGZ201_COLD], NULL }, |
| 1701 | { &cxusb_table[DVICO_BLUEBIRD_LGZ201_WARM], NULL }, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1702 | }, |
| 1703 | } |
| 1704 | }; |
| 1705 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1706 | static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = { |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1707 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1708 | |
| 1709 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1710 | .firmware = "dvb-usb-bluebird-01.fw", |
| 1711 | .download_firmware = bluebird_patch_dvico_firmware_download, |
| 1712 | /* use usb alt setting 0 for EP4 transfer (dvb-t), |
| 1713 | use usb alt setting 7 for EP2 transfer (atsc) */ |
| 1714 | |
| 1715 | .size_of_priv = sizeof(struct cxusb_state), |
| 1716 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1717 | .num_adapters = 1, |
| 1718 | .adapter = { |
| 1719 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1720 | .num_frontends = 1, |
| 1721 | .fe = {{ |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1722 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1723 | .frontend_attach = cxusb_mt352_frontend_attach, |
| 1724 | .tuner_attach = cxusb_dtt7579_tuner_attach, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1725 | |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1726 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1727 | .stream = { |
| 1728 | .type = USB_BULK, |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 1729 | .count = 5, |
| 1730 | .endpoint = 0x04, |
| 1731 | .u = { |
| 1732 | .bulk = { |
| 1733 | .buffersize = 8192, |
| 1734 | } |
| 1735 | } |
| 1736 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1737 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 1738 | }, |
| 1739 | }, |
| 1740 | .power_ctrl = cxusb_bluebird_power_ctrl, |
| 1741 | |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1742 | .i2c_algo = &cxusb_i2c_algo, |
| 1743 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1744 | .rc.core = { |
| 1745 | .rc_interval = 100, |
| 1746 | .rc_codes = RC_MAP_DVICO_PORTABLE, |
| 1747 | .module_name = KBUILD_MODNAME, |
| 1748 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1749 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1750 | }, |
Michael Krufky | c150178 | 2006-03-26 05:43:36 -0300 | [diff] [blame] | 1751 | |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1752 | .generic_bulk_ctrl_endpoint = 0x01, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1753 | |
| 1754 | .num_device_descs = 1, |
| 1755 | .devices = { |
| 1756 | { "DViCO FusionHDTV DVB-T USB (TH7579)", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1757 | { &cxusb_table[DVICO_BLUEBIRD_TH7579_COLD], NULL }, |
| 1758 | { &cxusb_table[DVICO_BLUEBIRD_TH7579_WARM], NULL }, |
Michael Krufky | 6f44725 | 2006-01-11 19:40:33 -0200 | [diff] [blame] | 1759 | }, |
| 1760 | } |
| 1761 | }; |
| 1762 | |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1763 | static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = { |
| 1764 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1765 | |
| 1766 | .usb_ctrl = CYPRESS_FX2, |
| 1767 | |
| 1768 | .size_of_priv = sizeof(struct cxusb_state), |
| 1769 | |
| 1770 | .num_adapters = 1, |
| 1771 | .adapter = { |
| 1772 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1773 | .num_frontends = 1, |
| 1774 | .fe = {{ |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1775 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1776 | .frontend_attach = cxusb_dualdig4_frontend_attach, |
| 1777 | .tuner_attach = cxusb_dvico_xc3028_tuner_attach, |
| 1778 | /* parameter for the MPEG2-data transfer */ |
| 1779 | .stream = { |
| 1780 | .type = USB_BULK, |
| 1781 | .count = 5, |
| 1782 | .endpoint = 0x02, |
| 1783 | .u = { |
| 1784 | .bulk = { |
| 1785 | .buffersize = 8192, |
| 1786 | } |
| 1787 | } |
| 1788 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1789 | }}, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1790 | }, |
| 1791 | }, |
| 1792 | |
| 1793 | .power_ctrl = cxusb_power_ctrl, |
| 1794 | |
| 1795 | .i2c_algo = &cxusb_i2c_algo, |
| 1796 | |
| 1797 | .generic_bulk_ctrl_endpoint = 0x01, |
| 1798 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1799 | .rc.core = { |
| 1800 | .rc_interval = 100, |
| 1801 | .rc_codes = RC_MAP_DVICO_MCE, |
| 1802 | .module_name = KBUILD_MODNAME, |
| 1803 | .rc_query = cxusb_bluebird2_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1804 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1805 | }, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1806 | |
| 1807 | .num_device_descs = 1, |
| 1808 | .devices = { |
| 1809 | { "DViCO FusionHDTV DVB-T Dual Digital 4", |
| 1810 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1811 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_4], NULL }, |
Chris Pascoe | aeb012b | 2007-11-19 21:57:10 -0300 | [diff] [blame] | 1812 | }, |
| 1813 | } |
| 1814 | }; |
| 1815 | |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1816 | static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties = { |
| 1817 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1818 | |
| 1819 | .usb_ctrl = CYPRESS_FX2, |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1820 | .identify_state = bluebird_fx2_identify_state, |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1821 | |
| 1822 | .size_of_priv = sizeof(struct cxusb_state), |
| 1823 | |
| 1824 | .num_adapters = 1, |
| 1825 | .adapter = { |
| 1826 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1827 | .num_frontends = 1, |
| 1828 | .fe = {{ |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1829 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1830 | .frontend_attach = cxusb_nano2_frontend_attach, |
| 1831 | .tuner_attach = cxusb_dvico_xc3028_tuner_attach, |
| 1832 | /* parameter for the MPEG2-data transfer */ |
| 1833 | .stream = { |
| 1834 | .type = USB_BULK, |
| 1835 | .count = 5, |
| 1836 | .endpoint = 0x02, |
| 1837 | .u = { |
| 1838 | .bulk = { |
| 1839 | .buffersize = 8192, |
| 1840 | } |
| 1841 | } |
| 1842 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1843 | }}, |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1844 | }, |
| 1845 | }, |
| 1846 | |
| 1847 | .power_ctrl = cxusb_nano2_power_ctrl, |
| 1848 | |
| 1849 | .i2c_algo = &cxusb_i2c_algo, |
| 1850 | |
| 1851 | .generic_bulk_ctrl_endpoint = 0x01, |
| 1852 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1853 | .rc.core = { |
| 1854 | .rc_interval = 100, |
| 1855 | .rc_codes = RC_MAP_DVICO_PORTABLE, |
| 1856 | .module_name = KBUILD_MODNAME, |
| 1857 | .rc_query = cxusb_bluebird2_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1858 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1859 | }, |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1860 | |
| 1861 | .num_device_descs = 1, |
| 1862 | .devices = { |
| 1863 | { "DViCO FusionHDTV DVB-T NANO2", |
| 1864 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1865 | { &cxusb_table[DVICO_BLUEBIRD_DVB_T_NANO_2], NULL }, |
Chris Pascoe | 5ccaf90 | 2007-11-20 01:53:31 -0300 | [diff] [blame] | 1866 | }, |
| 1867 | } |
| 1868 | }; |
| 1869 | |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1870 | static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_properties = { |
| 1871 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1872 | |
| 1873 | .usb_ctrl = DEVICE_SPECIFIC, |
| 1874 | .firmware = "dvb-usb-bluebird-02.fw", |
| 1875 | .download_firmware = bluebird_patch_dvico_firmware_download, |
| 1876 | .identify_state = bluebird_fx2_identify_state, |
| 1877 | |
| 1878 | .size_of_priv = sizeof(struct cxusb_state), |
| 1879 | |
| 1880 | .num_adapters = 1, |
| 1881 | .adapter = { |
| 1882 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1883 | .num_frontends = 1, |
| 1884 | .fe = {{ |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1885 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1886 | .frontend_attach = cxusb_nano2_frontend_attach, |
| 1887 | .tuner_attach = cxusb_dvico_xc3028_tuner_attach, |
| 1888 | /* parameter for the MPEG2-data transfer */ |
| 1889 | .stream = { |
| 1890 | .type = USB_BULK, |
| 1891 | .count = 5, |
| 1892 | .endpoint = 0x02, |
| 1893 | .u = { |
| 1894 | .bulk = { |
| 1895 | .buffersize = 8192, |
| 1896 | } |
| 1897 | } |
| 1898 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1899 | }}, |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1900 | }, |
| 1901 | }, |
| 1902 | |
| 1903 | .power_ctrl = cxusb_nano2_power_ctrl, |
| 1904 | |
| 1905 | .i2c_algo = &cxusb_i2c_algo, |
| 1906 | |
| 1907 | .generic_bulk_ctrl_endpoint = 0x01, |
| 1908 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 1909 | .rc.core = { |
| 1910 | .rc_interval = 100, |
| 1911 | .rc_codes = RC_MAP_DVICO_PORTABLE, |
| 1912 | .module_name = KBUILD_MODNAME, |
| 1913 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 1914 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 1915 | }, |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1916 | |
| 1917 | .num_device_descs = 1, |
| 1918 | .devices = { |
| 1919 | { "DViCO FusionHDTV DVB-T NANO2 w/o firmware", |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1920 | { &cxusb_table[DVICO_BLUEBIRD_DVB_T_NANO_2], NULL }, |
| 1921 | { &cxusb_table[DVICO_BLUEBIRD_DVB_T_NANO_2_NFW_WARM], NULL }, |
Chris Pascoe | 702a676 | 2007-11-20 03:34:11 -0300 | [diff] [blame] | 1922 | }, |
| 1923 | } |
| 1924 | }; |
| 1925 | |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1926 | static struct dvb_usb_device_properties cxusb_aver_a868r_properties = { |
| 1927 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1928 | |
| 1929 | .usb_ctrl = CYPRESS_FX2, |
| 1930 | |
| 1931 | .size_of_priv = sizeof(struct cxusb_state), |
| 1932 | |
| 1933 | .num_adapters = 1, |
| 1934 | .adapter = { |
| 1935 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1936 | .num_frontends = 1, |
| 1937 | .fe = {{ |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1938 | .streaming_ctrl = cxusb_aver_streaming_ctrl, |
| 1939 | .frontend_attach = cxusb_aver_lgdt3303_frontend_attach, |
| 1940 | .tuner_attach = cxusb_mxl5003s_tuner_attach, |
| 1941 | /* parameter for the MPEG2-data transfer */ |
| 1942 | .stream = { |
| 1943 | .type = USB_BULK, |
| 1944 | .count = 5, |
| 1945 | .endpoint = 0x04, |
| 1946 | .u = { |
| 1947 | .bulk = { |
| 1948 | .buffersize = 8192, |
| 1949 | } |
| 1950 | } |
| 1951 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1952 | }}, |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1953 | }, |
| 1954 | }, |
| 1955 | .power_ctrl = cxusb_aver_power_ctrl, |
| 1956 | |
| 1957 | .i2c_algo = &cxusb_i2c_algo, |
| 1958 | |
| 1959 | .generic_bulk_ctrl_endpoint = 0x01, |
| 1960 | |
| 1961 | .num_device_descs = 1, |
| 1962 | .devices = { |
| 1963 | { "AVerMedia AVerTVHD Volar (A868R)", |
| 1964 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 1965 | { &cxusb_table[AVERMEDIA_VOLAR_A868R], NULL }, |
Daniel Gimpelevich | f5376ad | 2008-06-28 05:01:30 -0300 | [diff] [blame] | 1966 | }, |
| 1967 | } |
| 1968 | }; |
| 1969 | |
Michael Krufky | a2dc86b | 2008-08-09 13:06:26 -0300 | [diff] [blame] | 1970 | static |
| 1971 | struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties = { |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1972 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 1973 | |
| 1974 | .usb_ctrl = CYPRESS_FX2, |
| 1975 | |
| 1976 | .size_of_priv = sizeof(struct cxusb_state), |
| 1977 | |
| 1978 | .num_adapters = 1, |
| 1979 | .adapter = { |
| 1980 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1981 | .size_of_priv = sizeof(struct dib0700_adapter_state), |
| 1982 | .num_frontends = 1, |
| 1983 | .fe = {{ |
Michael Krufky | a2dc86b | 2008-08-09 13:06:26 -0300 | [diff] [blame] | 1984 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 1985 | .frontend_attach = cxusb_dualdig4_rev2_frontend_attach, |
| 1986 | .tuner_attach = cxusb_dualdig4_rev2_tuner_attach, |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1987 | /* parameter for the MPEG2-data transfer */ |
| 1988 | .stream = { |
| 1989 | .type = USB_BULK, |
| 1990 | .count = 7, |
| 1991 | .endpoint = 0x02, |
| 1992 | .u = { |
| 1993 | .bulk = { |
| 1994 | .buffersize = 4096, |
| 1995 | } |
| 1996 | } |
| 1997 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 1998 | }}, |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 1999 | }, |
| 2000 | }, |
| 2001 | |
| 2002 | .power_ctrl = cxusb_bluebird_power_ctrl, |
| 2003 | |
| 2004 | .i2c_algo = &cxusb_i2c_algo, |
| 2005 | |
| 2006 | .generic_bulk_ctrl_endpoint = 0x01, |
| 2007 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2008 | .rc.core = { |
| 2009 | .rc_interval = 100, |
| 2010 | .rc_codes = RC_MAP_DVICO_MCE, |
| 2011 | .module_name = KBUILD_MODNAME, |
| 2012 | .rc_query = cxusb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 2013 | .allowed_protos = RC_PROTO_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2014 | }, |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 2015 | |
| 2016 | .num_device_descs = 1, |
| 2017 | .devices = { |
| 2018 | { "DViCO FusionHDTV DVB-T Dual Digital 4 (rev 2)", |
| 2019 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 2020 | { &cxusb_table[DVICO_BLUEBIRD_DUAL_4_REV_2], NULL }, |
Anton Blanchard | 8d79898 | 2008-08-09 12:23:15 -0300 | [diff] [blame] | 2021 | }, |
| 2022 | } |
| 2023 | }; |
| 2024 | |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 2025 | static struct dvb_usb_device_properties cxusb_d680_dmb_properties = { |
| 2026 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 2027 | |
| 2028 | .usb_ctrl = CYPRESS_FX2, |
| 2029 | |
| 2030 | .size_of_priv = sizeof(struct cxusb_state), |
| 2031 | |
| 2032 | .num_adapters = 1, |
| 2033 | .adapter = { |
| 2034 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 2035 | .num_frontends = 1, |
| 2036 | .fe = {{ |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 2037 | .streaming_ctrl = cxusb_d680_dmb_streaming_ctrl, |
| 2038 | .frontend_attach = cxusb_d680_dmb_frontend_attach, |
| 2039 | .tuner_attach = cxusb_d680_dmb_tuner_attach, |
| 2040 | |
| 2041 | /* parameter for the MPEG2-data transfer */ |
| 2042 | .stream = { |
| 2043 | .type = USB_BULK, |
| 2044 | .count = 5, |
| 2045 | .endpoint = 0x02, |
| 2046 | .u = { |
| 2047 | .bulk = { |
| 2048 | .buffersize = 8192, |
| 2049 | } |
| 2050 | } |
| 2051 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 2052 | }}, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 2053 | }, |
| 2054 | }, |
| 2055 | |
| 2056 | .power_ctrl = cxusb_d680_dmb_power_ctrl, |
| 2057 | |
| 2058 | .i2c_algo = &cxusb_i2c_algo, |
| 2059 | |
| 2060 | .generic_bulk_ctrl_endpoint = 0x01, |
| 2061 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2062 | .rc.core = { |
| 2063 | .rc_interval = 100, |
Stefan Brüns | 1bbab52 | 2018-01-09 18:33:39 -0500 | [diff] [blame] | 2064 | .rc_codes = RC_MAP_TOTAL_MEDIA_IN_HAND_02, |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2065 | .module_name = KBUILD_MODNAME, |
| 2066 | .rc_query = cxusb_d680_dmb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 2067 | .allowed_protos = RC_PROTO_BIT_UNKNOWN, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2068 | }, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 2069 | |
| 2070 | .num_device_descs = 1, |
| 2071 | .devices = { |
| 2072 | { |
| 2073 | "Conexant DMB-TH Stick", |
| 2074 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 2075 | { &cxusb_table[CONEXANT_D680_DMB], NULL }, |
Timothy Lee | dfbdce0 | 2008-08-09 13:36:51 -0300 | [diff] [blame] | 2076 | }, |
| 2077 | } |
| 2078 | }; |
| 2079 | |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 2080 | static struct dvb_usb_device_properties cxusb_mygica_d689_properties = { |
| 2081 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 2082 | |
| 2083 | .usb_ctrl = CYPRESS_FX2, |
| 2084 | |
| 2085 | .size_of_priv = sizeof(struct cxusb_state), |
| 2086 | |
| 2087 | .num_adapters = 1, |
| 2088 | .adapter = { |
| 2089 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 2090 | .num_frontends = 1, |
| 2091 | .fe = {{ |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 2092 | .streaming_ctrl = cxusb_d680_dmb_streaming_ctrl, |
| 2093 | .frontend_attach = cxusb_mygica_d689_frontend_attach, |
| 2094 | .tuner_attach = cxusb_mygica_d689_tuner_attach, |
| 2095 | |
| 2096 | /* parameter for the MPEG2-data transfer */ |
| 2097 | .stream = { |
| 2098 | .type = USB_BULK, |
| 2099 | .count = 5, |
| 2100 | .endpoint = 0x02, |
| 2101 | .u = { |
| 2102 | .bulk = { |
| 2103 | .buffersize = 8192, |
| 2104 | } |
| 2105 | } |
| 2106 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 2107 | }}, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 2108 | }, |
| 2109 | }, |
| 2110 | |
| 2111 | .power_ctrl = cxusb_d680_dmb_power_ctrl, |
| 2112 | |
| 2113 | .i2c_algo = &cxusb_i2c_algo, |
| 2114 | |
| 2115 | .generic_bulk_ctrl_endpoint = 0x01, |
| 2116 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2117 | .rc.core = { |
| 2118 | .rc_interval = 100, |
| 2119 | .rc_codes = RC_MAP_D680_DMB, |
| 2120 | .module_name = KBUILD_MODNAME, |
| 2121 | .rc_query = cxusb_d680_dmb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 2122 | .allowed_protos = RC_PROTO_BIT_UNKNOWN, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 2123 | }, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 2124 | |
| 2125 | .num_device_descs = 1, |
| 2126 | .devices = { |
| 2127 | { |
| 2128 | "Mygica D689 DMB-TH", |
| 2129 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 2130 | { &cxusb_table[MYGICA_D689], NULL }, |
David Wong | b18bd1d | 2009-10-26 09:41:22 -0300 | [diff] [blame] | 2131 | }, |
| 2132 | } |
| 2133 | }; |
| 2134 | |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 2135 | static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { |
| 2136 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
| 2137 | |
| 2138 | .usb_ctrl = CYPRESS_FX2, |
| 2139 | |
| 2140 | .size_of_priv = sizeof(struct cxusb_state), |
| 2141 | |
| 2142 | .num_adapters = 1, |
| 2143 | .adapter = { |
| 2144 | { |
| 2145 | .num_frontends = 1, |
| 2146 | .fe = {{ |
| 2147 | .streaming_ctrl = cxusb_streaming_ctrl, |
| 2148 | .frontend_attach = cxusb_mygica_t230_frontend_attach, |
| 2149 | |
| 2150 | /* parameter for the MPEG2-data transfer */ |
| 2151 | .stream = { |
| 2152 | .type = USB_BULK, |
| 2153 | .count = 5, |
| 2154 | .endpoint = 0x02, |
| 2155 | .u = { |
| 2156 | .bulk = { |
| 2157 | .buffersize = 8192, |
| 2158 | } |
| 2159 | } |
| 2160 | }, |
| 2161 | } }, |
| 2162 | }, |
| 2163 | }, |
| 2164 | |
| 2165 | .power_ctrl = cxusb_d680_dmb_power_ctrl, |
| 2166 | |
| 2167 | .i2c_algo = &cxusb_i2c_algo, |
| 2168 | |
| 2169 | .generic_bulk_ctrl_endpoint = 0x01, |
| 2170 | |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2171 | .rc.core = { |
| 2172 | .rc_interval = 100, |
Evgeny Plehov | c20ffbf | 2018-01-09 18:33:38 -0500 | [diff] [blame] | 2173 | .rc_codes = RC_MAP_D680_DMB, |
Sean Young | 517b500 | 2016-11-20 07:45:52 -0200 | [diff] [blame] | 2174 | .module_name = KBUILD_MODNAME, |
| 2175 | .rc_query = cxusb_d680_dmb_rc_query, |
Sean Young | 6d741bf | 2017-08-07 16:20:58 -0400 | [diff] [blame] | 2176 | .allowed_protos = RC_PROTO_BIT_UNKNOWN, |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 2177 | }, |
| 2178 | |
| 2179 | .num_device_descs = 1, |
| 2180 | .devices = { |
| 2181 | { |
| 2182 | "Mygica T230 DVB-T/T2/C", |
| 2183 | { NULL }, |
David Howells | 974e08d | 2015-02-17 11:30:34 -0300 | [diff] [blame] | 2184 | { &cxusb_table[MYGICA_T230], NULL }, |
CrazyCat | a0f629b | 2014-11-14 18:24:28 -0300 | [diff] [blame] | 2185 | }, |
| 2186 | } |
| 2187 | }; |
| 2188 | |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 2189 | static struct usb_driver cxusb_driver = { |
Patrick Boettcher | 63b5c1c | 2005-07-07 17:58:30 -0700 | [diff] [blame] | 2190 | .name = "dvb_usb_cxusb", |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 2191 | .probe = cxusb_probe, |
Olli Salonen | 26c42b0 | 2014-07-13 10:52:22 -0300 | [diff] [blame] | 2192 | .disconnect = cxusb_disconnect, |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 2193 | .id_table = cxusb_table, |
| 2194 | }; |
| 2195 | |
Greg Kroah-Hartman | ecb3b2b | 2011-11-18 09:46:12 -0800 | [diff] [blame] | 2196 | module_usb_driver(cxusb_driver); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 2197 | |
Patrick Boettcher | 99e44da | 2016-01-24 12:56:58 -0200 | [diff] [blame] | 2198 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>"); |
Michael Krufky | 5b9ed28 | 2006-10-15 14:51:08 -0300 | [diff] [blame] | 2199 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); |
Michael Krufky | f4efb4d | 2006-01-13 14:10:25 -0200 | [diff] [blame] | 2200 | MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); |
Patrick Boettcher | 22c6d93 | 2005-07-07 17:58:10 -0700 | [diff] [blame] | 2201 | MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design"); |
| 2202 | MODULE_VERSION("1.0-alpha"); |
| 2203 | MODULE_LICENSE("GPL"); |