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