blob: 03c28655af1be54eec6e10486ab5fa71ccc58787 [file] [log] [blame]
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001/*
2 * DVB USB Linux driver for Anysee E30 DVB-C & DVB-T USB2.0 receiver
3 *
4 * Copyright (C) 2007 Antti Palosaari <crope@iki.fi>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * TODO:
21 * - add smart card reader support for Conditional Access (CA)
22 *
23 * Card reader in Anysee is nothing more than ISO 7816 card reader.
24 * There is no hardware CAM in any Anysee device sold.
25 * In my understanding it should be implemented by making own module
Antti Palosaari9fdd9ca2008-06-11 11:43:19 -030026 * for ISO 7816 card reader, like dvb_ca_en50221 is implemented. This
27 * module registers serial interface that can be used to communicate
Antti Palosaaria51e34d2008-05-17 23:05:48 -030028 * with any ISO 7816 smart card.
29 *
30 * Any help according to implement serial smart card reader support
31 * is highly welcome!
32 */
33
34#include "anysee.h"
35#include "tda1002x.h"
36#include "mt352.h"
37#include "mt352_priv.h"
38#include "zl10353.h"
Antti Palosaari72ffd2b2011-04-10 20:14:50 -030039#include "tda18212.h"
Antti Palosaarif0a53102011-04-27 21:11:59 -030040#include "cx24116.h"
Antti Palosaaribedbf3d2011-04-29 13:55:02 -030041#include "stv0900.h"
42#include "stv6110.h"
Antti Palosaarif0a53102011-04-27 21:11:59 -030043#include "isl6423.h"
Antti Palosaari608add82011-08-12 18:29:46 -030044#include "cxd2820r.h"
Antti Palosaaria51e34d2008-05-17 23:05:48 -030045
46/* debug */
47static int dvb_usb_anysee_debug;
48module_param_named(debug, dvb_usb_anysee_debug, int, 0644);
49MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS);
Mauro Carvalho Chehabffbc5f82009-01-05 01:34:20 -030050static int dvb_usb_anysee_delsys;
Antti Palosaari0f77c3a2008-08-11 10:54:16 -030051module_param_named(delsys, dvb_usb_anysee_delsys, int, 0644);
52MODULE_PARM_DESC(delsys, "select delivery mode (0=DVB-C, 1=DVB-T)");
Antti Palosaaria51e34d2008-05-17 23:05:48 -030053DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
54
Akinobu Mitadec0c462008-10-29 21:16:04 -030055static DEFINE_MUTEX(anysee_usb_mutex);
Antti Palosaaria51e34d2008-05-17 23:05:48 -030056
57static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen,
58 u8 *rbuf, u8 rlen)
59{
60 struct anysee_state *state = d->priv;
Antti Palosaaricf427952012-01-21 11:19:29 -030061 int act_len, ret, i;
Antti Palosaaria51e34d2008-05-17 23:05:48 -030062 u8 buf[64];
63
Antti Palosaaria51e34d2008-05-17 23:05:48 -030064 memcpy(&buf[0], sbuf, slen);
65 buf[60] = state->seq++;
66
67 if (mutex_lock_interruptible(&anysee_usb_mutex) < 0)
68 return -EAGAIN;
69
Antti Palosaari4048da22011-09-29 20:28:53 -030070 deb_xfer(">>> ");
71 debug_dump(buf, slen, deb_xfer);
72
Antti Palosaaria51e34d2008-05-17 23:05:48 -030073 /* We need receive one message more after dvb_usb_generic_rw due
74 to weird transaction flow, which is 1 x send + 2 x receive. */
75 ret = dvb_usb_generic_rw(d, buf, sizeof(buf), buf, sizeof(buf), 0);
Antti Palosaaricf427952012-01-21 11:19:29 -030076 if (ret)
77 goto error_unlock;
78
79 /* TODO FIXME: dvb_usb_generic_rw() fails rarely with error code -32
80 * (EPIPE, Broken pipe). Function supports currently msleep() as a
81 * parameter but I would not like to use it, since according to
82 * Documentation/timers/timers-howto.txt it should not be used such
83 * short, under < 20ms, sleeps. Repeating failed message would be
84 * better choice as not to add unwanted delays...
85 * Fixing that correctly is one of those or both;
86 * 1) use repeat if possible
87 * 2) add suitable delay
88 */
89
90 /* get answer, retry few times if error returned */
91 for (i = 0; i < 3; i++) {
Antti Palosaaria51e34d2008-05-17 23:05:48 -030092 /* receive 2nd answer */
93 ret = usb_bulk_msg(d->udev, usb_rcvbulkpipe(d->udev,
94 d->props.generic_bulk_ctrl_endpoint), buf, sizeof(buf),
95 &act_len, 2000);
Antti Palosaaricf427952012-01-21 11:19:29 -030096
97 if (ret) {
98 deb_info("%s: recv bulk message failed: %d",
99 __func__, ret);
100 } else {
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300101 deb_xfer("<<< ");
Antti Palosaari4048da22011-09-29 20:28:53 -0300102 debug_dump(buf, rlen, deb_xfer);
103
104 if (buf[63] != 0x4f)
105 deb_info("%s: cmd failed\n", __func__);
Antti Palosaaricf427952012-01-21 11:19:29 -0300106
107 break;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300108 }
109 }
110
Antti Palosaaricf427952012-01-21 11:19:29 -0300111 if (ret) {
112 /* all retries failed, it is fatal */
113 err("%s: recv bulk message failed: %d", __func__, ret);
114 goto error_unlock;
115 }
116
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300117 /* read request, copy returned data to return buf */
Antti Palosaaricf427952012-01-21 11:19:29 -0300118 if (rbuf && rlen)
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300119 memcpy(rbuf, buf, rlen);
120
Antti Palosaaricf427952012-01-21 11:19:29 -0300121error_unlock:
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300122 mutex_unlock(&anysee_usb_mutex);
123
124 return ret;
125}
126
127static int anysee_read_reg(struct dvb_usb_device *d, u16 reg, u8 *val)
128{
129 u8 buf[] = {CMD_REG_READ, reg >> 8, reg & 0xff, 0x01};
130 int ret;
131 ret = anysee_ctrl_msg(d, buf, sizeof(buf), val, 1);
132 deb_info("%s: reg:%04x val:%02x\n", __func__, reg, *val);
133 return ret;
134}
135
136static int anysee_write_reg(struct dvb_usb_device *d, u16 reg, u8 val)
137{
138 u8 buf[] = {CMD_REG_WRITE, reg >> 8, reg & 0xff, 0x01, val};
139 deb_info("%s: reg:%04x val:%02x\n", __func__, reg, val);
140 return anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
141}
142
Antti Palosaari41f81f62011-04-10 17:53:52 -0300143/* write single register with mask */
144static int anysee_wr_reg_mask(struct dvb_usb_device *d, u16 reg, u8 val,
145 u8 mask)
146{
147 int ret;
148 u8 tmp;
149
150 /* no need for read if whole reg is written */
151 if (mask != 0xff) {
152 ret = anysee_read_reg(d, reg, &tmp);
153 if (ret)
154 return ret;
155
156 val &= mask;
157 tmp &= ~mask;
158 val |= tmp;
159 }
160
161 return anysee_write_reg(d, reg, val);
162}
163
Antti Palosaari05cd37d2011-09-05 23:33:04 -0300164/* read single register with mask */
165static int anysee_rd_reg_mask(struct dvb_usb_device *d, u16 reg, u8 *val,
166 u8 mask)
167{
168 int ret, i;
169 u8 tmp;
170
171 ret = anysee_read_reg(d, reg, &tmp);
172 if (ret)
173 return ret;
174
175 tmp &= mask;
176
177 /* find position of the first bit */
178 for (i = 0; i < 8; i++) {
179 if ((mask >> i) & 0x01)
180 break;
181 }
182 *val = tmp >> i;
183
184 return 0;
185}
186
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300187static int anysee_get_hw_info(struct dvb_usb_device *d, u8 *id)
188{
189 u8 buf[] = {CMD_GET_HW_INFO};
190 return anysee_ctrl_msg(d, buf, sizeof(buf), id, 3);
191}
192
193static int anysee_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
194{
195 u8 buf[] = {CMD_STREAMING_CTRL, (u8)onoff, 0x00};
196 deb_info("%s: onoff:%02x\n", __func__, onoff);
197 return anysee_ctrl_msg(adap->dev, buf, sizeof(buf), NULL, 0);
198}
199
200static int anysee_led_ctrl(struct dvb_usb_device *d, u8 mode, u8 interval)
201{
202 u8 buf[] = {CMD_LED_AND_IR_CTRL, 0x01, mode, interval};
203 deb_info("%s: state:%02x interval:%02x\n", __func__, mode, interval);
204 return anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
205}
206
207static int anysee_ir_ctrl(struct dvb_usb_device *d, u8 onoff)
208{
209 u8 buf[] = {CMD_LED_AND_IR_CTRL, 0x02, onoff};
210 deb_info("%s: onoff:%02x\n", __func__, onoff);
211 return anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
212}
213
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300214/* I2C */
215static int anysee_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
216 int num)
217{
218 struct dvb_usb_device *d = i2c_get_adapdata(adap);
Mauro Carvalho Chehab902571a2008-12-29 19:02:24 -0300219 int ret = 0, inc, i = 0;
Antti Palosaari21d2e932011-05-24 06:04:08 -0300220 u8 buf[52]; /* 4 + 48 (I2C WR USB command header + I2C WR max) */
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300221
222 if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
223 return -EAGAIN;
224
225 while (i < num) {
226 if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
Antti Palosaari21d2e932011-05-24 06:04:08 -0300227 if (msg[i].len > 2 || msg[i+1].len > 60) {
228 ret = -EOPNOTSUPP;
229 break;
230 }
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300231 buf[0] = CMD_I2C_READ;
Antti Palosaari7ea03d22011-04-09 20:50:07 -0300232 buf[1] = (msg[i].addr << 1) | 0x01;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300233 buf[2] = msg[i].buf[0];
Antti Palosaari882b82c2011-04-12 19:49:25 -0300234 buf[3] = msg[i].buf[1];
235 buf[4] = msg[i].len-1;
Antti Palosaarib3e6a5a2011-04-09 21:00:51 -0300236 buf[5] = msg[i+1].len;
Antti Palosaari21d2e932011-05-24 06:04:08 -0300237 ret = anysee_ctrl_msg(d, buf, 6, msg[i+1].buf,
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300238 msg[i+1].len);
239 inc = 2;
240 } else {
Antti Palosaari21d2e932011-05-24 06:04:08 -0300241 if (msg[i].len > 48) {
242 ret = -EOPNOTSUPP;
243 break;
244 }
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300245 buf[0] = CMD_I2C_WRITE;
Antti Palosaari7ea03d22011-04-09 20:50:07 -0300246 buf[1] = (msg[i].addr << 1);
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300247 buf[2] = msg[i].len;
248 buf[3] = 0x01;
249 memcpy(&buf[4], msg[i].buf, msg[i].len);
Antti Palosaari21d2e932011-05-24 06:04:08 -0300250 ret = anysee_ctrl_msg(d, buf, 4 + msg[i].len, NULL, 0);
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300251 inc = 1;
252 }
253 if (ret)
Antti Palosaarie613f8f2008-08-11 10:36:43 -0300254 break;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300255
256 i += inc;
257 }
258
259 mutex_unlock(&d->i2c_mutex);
260
Antti Palosaarie613f8f2008-08-11 10:36:43 -0300261 return ret ? ret : i;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300262}
263
264static u32 anysee_i2c_func(struct i2c_adapter *adapter)
265{
266 return I2C_FUNC_I2C;
267}
268
269static struct i2c_algorithm anysee_i2c_algo = {
270 .master_xfer = anysee_master_xfer,
271 .functionality = anysee_i2c_func,
272};
273
274static int anysee_mt352_demod_init(struct dvb_frontend *fe)
275{
Antti Palosaariae3745f2009-09-16 19:50:25 -0300276 static u8 clock_config[] = { CLOCK_CTL, 0x38, 0x28 };
277 static u8 reset[] = { RESET, 0x80 };
278 static u8 adc_ctl_1_cfg[] = { ADC_CTL_1, 0x40 };
279 static u8 agc_cfg[] = { AGC_TARGET, 0x28, 0x20 };
280 static u8 gpp_ctl_cfg[] = { GPP_CTL, 0x33 };
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300281 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
282
283 mt352_write(fe, clock_config, sizeof(clock_config));
284 udelay(200);
285 mt352_write(fe, reset, sizeof(reset));
286 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
287
288 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
289 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
290 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
291
292 return 0;
293}
294
295/* Callbacks for DVB USB */
296static struct tda10023_config anysee_tda10023_config = {
Antti Palosaari7ea03d22011-04-09 20:50:07 -0300297 .demod_address = (0x1a >> 1),
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300298 .invert = 0,
299 .xtal = 16000000,
300 .pll_m = 11,
301 .pll_p = 3,
302 .pll_n = 1,
Antti Palosaari5ae2fca2008-06-09 22:58:22 -0300303 .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_C,
304 .deltaf = 0xfeeb,
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300305};
306
307static struct mt352_config anysee_mt352_config = {
Antti Palosaari7ea03d22011-04-09 20:50:07 -0300308 .demod_address = (0x1e >> 1),
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300309 .demod_init = anysee_mt352_demod_init,
310};
311
312static struct zl10353_config anysee_zl10353_config = {
Antti Palosaari7ea03d22011-04-09 20:50:07 -0300313 .demod_address = (0x1e >> 1),
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300314 .parallel_ts = 1,
315};
316
Antti Palosaari1fd80702011-04-12 17:34:08 -0300317static struct zl10353_config anysee_zl10353_tda18212_config2 = {
318 .demod_address = (0x1e >> 1),
319 .parallel_ts = 1,
320 .disable_i2c_gate_ctrl = 1,
321 .no_tuner = 1,
322 .if2 = 41500,
323};
324
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300325static struct zl10353_config anysee_zl10353_tda18212_config = {
326 .demod_address = (0x18 >> 1),
327 .parallel_ts = 1,
328 .disable_i2c_gate_ctrl = 1,
329 .no_tuner = 1,
330 .if2 = 41500,
331};
332
333static struct tda10023_config anysee_tda10023_tda18212_config = {
334 .demod_address = (0x1a >> 1),
335 .xtal = 16000000,
336 .pll_m = 12,
337 .pll_p = 3,
338 .pll_n = 1,
Antti Palosaari05cd37d2011-09-05 23:33:04 -0300339 .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_B,
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300340 .deltaf = 0xba02,
341};
342
343static struct tda18212_config anysee_tda18212_config = {
344 .i2c_address = (0xc0 >> 1),
345 .if_dvbt_6 = 4150,
346 .if_dvbt_7 = 4150,
347 .if_dvbt_8 = 4150,
348 .if_dvbc = 5000,
349};
350
Antti Palosaari608add82011-08-12 18:29:46 -0300351static struct tda18212_config anysee_tda18212_config2 = {
352 .i2c_address = 0x60 /* (0xc0 >> 1) */,
353 .if_dvbt_6 = 3550,
354 .if_dvbt_7 = 3700,
355 .if_dvbt_8 = 4150,
356 .if_dvbt2_6 = 3250,
357 .if_dvbt2_7 = 4000,
358 .if_dvbt2_8 = 4000,
359 .if_dvbc = 5000,
360};
361
Antti Palosaarif0a53102011-04-27 21:11:59 -0300362static struct cx24116_config anysee_cx24116_config = {
363 .demod_address = (0xaa >> 1),
364 .mpg_clk_pos_pol = 0x00,
365 .i2c_wr_max = 48,
366};
367
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300368static struct stv0900_config anysee_stv0900_config = {
369 .demod_address = (0xd0 >> 1),
370 .demod_mode = 0,
371 .xtal = 8000000,
372 .clkmode = 3,
373 .diseqc_mode = 2,
374 .tun1_maddress = 0,
375 .tun1_adc = 1, /* 1 Vpp */
376 .path1_mode = 3,
377};
378
379static struct stv6110_config anysee_stv6110_config = {
380 .i2c_address = (0xc0 >> 1),
381 .mclk = 16000000,
382 .clk_div = 1,
383};
384
Antti Palosaarif0a53102011-04-27 21:11:59 -0300385static struct isl6423_config anysee_isl6423_config = {
386 .current_max = SEC_CURRENT_800m,
387 .curlim = SEC_CURRENT_LIM_OFF,
388 .mod_extern = 1,
389 .addr = (0x10 >> 1),
390};
391
Antti Palosaari608add82011-08-12 18:29:46 -0300392static struct cxd2820r_config anysee_cxd2820r_config = {
393 .i2c_address = 0x6d, /* (0xda >> 1) */
394 .ts_mode = 0x38,
Antti Palosaari608add82011-08-12 18:29:46 -0300395};
396
Antti Palosaari41f81f62011-04-10 17:53:52 -0300397/*
398 * New USB device strings: Mfr=1, Product=2, SerialNumber=0
399 * Manufacturer: AMT.CO.KR
400 *
401 * E30 VID=04b4 PID=861f HW=2 FW=2.1 Product=????????
402 * PCB: ?
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300403 * parts: DNOS404ZH102A(MT352, DTT7579(?))
Antti Palosaari41f81f62011-04-10 17:53:52 -0300404 *
Antti Palosaari05c46c02011-05-25 18:30:09 -0300405 * E30 VID=04b4 PID=861f HW=2 FW=2.1 "anysee-T(LP)"
406 * PCB: PCB 507T (rev1.61)
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300407 * parts: DNOS404ZH103A(ZL10353, DTT7579(?))
Antti Palosaari05c46c02011-05-25 18:30:09 -0300408 * OEA=0a OEB=00 OEC=00 OED=ff OEE=00
409 * IOA=45 IOB=ff IOC=00 IOD=ff IOE=00
Antti Palosaari41f81f62011-04-10 17:53:52 -0300410 *
411 * E30 Plus VID=04b4 PID=861f HW=6 FW=1.0 "anysee"
412 * PCB: 507CD (rev1.1)
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300413 * parts: DNOS404ZH103A(ZL10353, DTT7579(?)), CST56I01
Antti Palosaari05c46c02011-05-25 18:30:09 -0300414 * OEA=80 OEB=00 OEC=00 OED=ff OEE=fe
415 * IOA=4f IOB=ff IOC=00 IOD=06 IOE=01
Antti Palosaari41f81f62011-04-10 17:53:52 -0300416 * IOD[0] ZL10353 1=enabled
417 * IOA[7] TS 0=enabled
418 * tuner is not behind ZL10353 I2C-gate (no care if gate disabled or not)
419 *
420 * E30 C Plus VID=04b4 PID=861f HW=10 FW=1.0 "anysee-DC(LP)"
421 * PCB: 507DC (rev0.2)
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300422 * parts: TDA10023, DTOS403IH102B TM, CST56I01
Antti Palosaari05c46c02011-05-25 18:30:09 -0300423 * OEA=80 OEB=00 OEC=00 OED=ff OEE=fe
424 * IOA=4f IOB=ff IOC=00 IOD=26 IOE=01
Antti Palosaari41f81f62011-04-10 17:53:52 -0300425 * IOD[0] TDA10023 1=enabled
426 *
Antti Palosaarif0a53102011-04-27 21:11:59 -0300427 * E30 S2 Plus VID=04b4 PID=861f HW=11 FW=0.1 "anysee-S2(LP)"
428 * PCB: 507SI (rev2.1)
429 * parts: BS2N10WCC01(CX24116, CX24118), ISL6423, TDA8024
Antti Palosaari05c46c02011-05-25 18:30:09 -0300430 * OEA=80 OEB=00 OEC=ff OED=ff OEE=fe
431 * IOA=4d IOB=ff IOC=00 IOD=26 IOE=01
Antti Palosaarif0a53102011-04-27 21:11:59 -0300432 * IOD[0] CX24116 1=enabled
433 *
Antti Palosaari41f81f62011-04-10 17:53:52 -0300434 * E30 C Plus VID=1c73 PID=861f HW=15 FW=1.2 "anysee-FA(LP)"
435 * PCB: 507FA (rev0.4)
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300436 * parts: TDA10023, DTOS403IH102B TM, TDA8024
Antti Palosaari05c46c02011-05-25 18:30:09 -0300437 * OEA=80 OEB=00 OEC=ff OED=ff OEE=ff
438 * IOA=4d IOB=ff IOC=00 IOD=00 IOE=c0
Antti Palosaari41f81f62011-04-10 17:53:52 -0300439 * IOD[5] TDA10023 1=enabled
440 * IOE[0] tuner 1=enabled
441 *
442 * E30 Combo Plus VID=1c73 PID=861f HW=15 FW=1.2 "anysee-FA(LP)"
443 * PCB: 507FA (rev1.1)
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300444 * parts: ZL10353, TDA10023, DTOS403IH102B TM, TDA8024
Antti Palosaari05c46c02011-05-25 18:30:09 -0300445 * OEA=80 OEB=00 OEC=ff OED=ff OEE=ff
446 * IOA=4d IOB=ff IOC=00 IOD=00 IOE=c0
Antti Palosaari41f81f62011-04-10 17:53:52 -0300447 * DVB-C:
448 * IOD[5] TDA10023 1=enabled
449 * IOE[0] tuner 1=enabled
450 * DVB-T:
451 * IOD[0] ZL10353 1=enabled
452 * IOE[0] tuner 0=enabled
453 * tuner is behind ZL10353 I2C-gate
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300454 *
455 * E7 TC VID=1c73 PID=861f HW=18 FW=0.7 AMTCI=0.5 "anysee-E7TC(LP)"
456 * PCB: 508TC (rev0.6)
457 * parts: ZL10353, TDA10023, DNOD44CDH086A(TDA18212)
Antti Palosaari05c46c02011-05-25 18:30:09 -0300458 * OEA=80 OEB=00 OEC=03 OED=f7 OEE=ff
459 * IOA=4d IOB=00 IOC=cc IOD=48 IOE=e4
Antti Palosaari70fc26f2011-04-12 20:17:11 -0300460 * IOA[7] TS 1=enabled
461 * IOE[4] TDA18212 1=enabled
462 * DVB-C:
463 * IOD[6] ZL10353 0=disabled
464 * IOD[5] TDA10023 1=enabled
465 * IOE[0] IF 1=enabled
466 * DVB-T:
467 * IOD[5] TDA10023 0=disabled
468 * IOD[6] ZL10353 1=enabled
469 * IOE[0] IF 0=enabled
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300470 *
471 * E7 S2 VID=1c73 PID=861f HW=19 FW=0.4 AMTCI=0.5 "anysee-E7S2(LP)"
472 * PCB: 508S2 (rev0.7)
473 * parts: DNBU10512IST(STV0903, STV6110), ISL6423
Antti Palosaari05c46c02011-05-25 18:30:09 -0300474 * OEA=80 OEB=00 OEC=03 OED=f7 OEE=ff
475 * IOA=4d IOB=00 IOC=c4 IOD=08 IOE=e4
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300476 * IOA[7] TS 1=enabled
477 * IOE[5] STV0903 1=enabled
478 *
Antti Palosaari608add82011-08-12 18:29:46 -0300479 * E7 T2C VID=1c73 PID=861f HW=20 FW=0.1 AMTCI=0.5 "anysee-E7T2C(LP)"
480 * PCB: 508T2C (rev0.3)
481 * parts: DNOQ44QCH106A(CXD2820R, TDA18212), TDA8024
482 * OEA=80 OEB=00 OEC=03 OED=f7 OEE=ff
483 * IOA=4d IOB=00 IOC=cc IOD=48 IOE=e4
484 * IOA[7] TS 1=enabled
485 * IOE[5] CXD2820R 1=enabled
486 *
Antti Palosaari8439e0d2011-05-24 07:57:34 -0300487 * E7 PTC VID=1c73 PID=861f HW=21 FW=0.1 AMTCI=?? "anysee-E7PTC(LP)"
488 * PCB: 508PTC (rev0.5)
489 * parts: ZL10353, TDA10023, DNOD44CDH086A(TDA18212)
490 * OEA=80 OEB=00 OEC=03 OED=f7 OEE=ff
491 * IOA=4d IOB=00 IOC=cc IOD=48 IOE=e4
492 * IOA[7] TS 1=enabled
493 * IOE[4] TDA18212 1=enabled
494 * DVB-C:
495 * IOD[6] ZL10353 0=disabled
496 * IOD[5] TDA10023 1=enabled
497 * IOE[0] IF 1=enabled
498 * DVB-T:
499 * IOD[5] TDA10023 0=disabled
500 * IOD[6] ZL10353 1=enabled
501 * IOE[0] IF 0=enabled
Antti Palosaarifea3c392011-05-25 18:21:43 -0300502 *
Antti Palosaari608add82011-08-12 18:29:46 -0300503 * E7 PS2 VID=1c73 PID=861f HW=22 FW=0.1 AMTCI=?? "anysee-E7PS2(LP)"
Antti Palosaarifea3c392011-05-25 18:21:43 -0300504 * PCB: 508PS2 (rev0.4)
505 * parts: DNBU10512IST(STV0903, STV6110), ISL6423
506 * OEA=80 OEB=00 OEC=03 OED=f7 OEE=ff
507 * IOA=4d IOB=00 IOC=c4 IOD=08 IOE=e4
508 * IOA[7] TS 1=enabled
509 * IOE[5] STV0903 1=enabled
Antti Palosaari41f81f62011-04-10 17:53:52 -0300510 */
511
Antti Palosaaribe943512011-09-05 22:10:05 -0300512
513/* external I2C gate used for DNOD44CDH086A(TDA18212) tuner module */
514static int anysee_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
515{
516 struct dvb_usb_adapter *adap = fe->dvb->priv;
517
518 /* enable / disable tuner access on IOE[4] */
519 return anysee_wr_reg_mask(adap->dev, REG_IOE, (enable << 4), 0x10);
520}
521
Antti Palosaari449d1a02011-07-25 20:25:21 -0300522static int anysee_frontend_ctrl(struct dvb_frontend *fe, int onoff)
523{
524 struct dvb_usb_adapter *adap = fe->dvb->priv;
525 struct anysee_state *state = adap->dev->priv;
526 int ret;
527
528 deb_info("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff);
529
530 /* no frontend sleep control */
531 if (onoff == 0)
532 return 0;
533
534 switch (state->hw) {
535 case ANYSEE_HW_507FA: /* 15 */
536 /* E30 Combo Plus */
537 /* E30 C Plus */
538
539 if ((fe->id ^ dvb_usb_anysee_delsys) == 0) {
540 /* disable DVB-T demod on IOD[0] */
541 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 0),
542 0x01);
543 if (ret)
544 goto error;
545
546 /* enable DVB-C demod on IOD[5] */
547 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 5),
548 0x20);
549 if (ret)
550 goto error;
551
552 /* enable DVB-C tuner on IOE[0] */
553 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 0),
554 0x01);
555 if (ret)
556 goto error;
557 } else {
558 /* disable DVB-C demod on IOD[5] */
559 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5),
560 0x20);
561 if (ret)
562 goto error;
563
564 /* enable DVB-T demod on IOD[0] */
565 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 0),
566 0x01);
567 if (ret)
568 goto error;
569
570 /* enable DVB-T tuner on IOE[0] */
571 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 0),
572 0x01);
573 if (ret)
574 goto error;
575 }
576
577 break;
578 case ANYSEE_HW_508TC: /* 18 */
579 case ANYSEE_HW_508PTC: /* 21 */
580 /* E7 TC */
581 /* E7 PTC */
582
583 if ((fe->id ^ dvb_usb_anysee_delsys) == 0) {
584 /* disable DVB-T demod on IOD[6] */
585 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 6),
586 0x40);
587 if (ret)
588 goto error;
589
590 /* enable DVB-C demod on IOD[5] */
591 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 5),
592 0x20);
593 if (ret)
594 goto error;
595
596 /* enable IF route on IOE[0] */
597 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 0),
598 0x01);
599 if (ret)
600 goto error;
601 } else {
602 /* disable DVB-C demod on IOD[5] */
603 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5),
604 0x20);
605 if (ret)
606 goto error;
607
608 /* enable DVB-T demod on IOD[6] */
609 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 6),
610 0x40);
611 if (ret)
612 goto error;
613
614 /* enable IF route on IOE[0] */
615 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 0),
616 0x01);
617 if (ret)
618 goto error;
619 }
620
621 break;
622 default:
623 ret = 0;
624 }
625
626error:
627 return ret;
628}
629
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300630static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
631{
632 int ret;
633 struct anysee_state *state = adap->dev->priv;
634 u8 hw_info[3];
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300635 u8 tmp;
636 struct i2c_msg msg[2] = {
637 {
638 .addr = anysee_tda18212_config.i2c_address,
639 .flags = 0,
640 .len = 1,
641 .buf = "\x00",
642 }, {
643 .addr = anysee_tda18212_config.i2c_address,
644 .flags = I2C_M_RD,
645 .len = 1,
646 .buf = &tmp,
647 }
648 };
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300649
Antti Palosaari449d1a02011-07-25 20:25:21 -0300650 /* detect hardware only once */
Michael Krufky77eed212011-09-06 09:31:57 -0300651 if (adap->fe_adap[0].fe == NULL) {
Antti Palosaari449d1a02011-07-25 20:25:21 -0300652 /* Check which hardware we have.
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300653 * We must do this call two times to get reliable values
654 * (hw/fw bug).
Antti Palosaari449d1a02011-07-25 20:25:21 -0300655 */
656 ret = anysee_get_hw_info(adap->dev, hw_info);
657 if (ret)
658 goto error;
Antti Palosaari41f81f62011-04-10 17:53:52 -0300659
Antti Palosaari449d1a02011-07-25 20:25:21 -0300660 ret = anysee_get_hw_info(adap->dev, hw_info);
661 if (ret)
662 goto error;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300663
Antti Palosaari449d1a02011-07-25 20:25:21 -0300664 /* Meaning of these info bytes are guessed. */
665 info("firmware version:%d.%d hardware id:%d",
666 hw_info[1], hw_info[2], hw_info[0]);
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300667
Antti Palosaari449d1a02011-07-25 20:25:21 -0300668 state->hw = hw_info[0];
669 }
670
671 /* set current frondend ID for devices having two frondends */
Michael Krufky77eed212011-09-06 09:31:57 -0300672 if (adap->fe_adap[0].fe)
Antti Palosaari449d1a02011-07-25 20:25:21 -0300673 state->fe_id++;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300674
Antti Palosaari41f81f62011-04-10 17:53:52 -0300675 switch (state->hw) {
Antti Palosaari05c46c02011-05-25 18:30:09 -0300676 case ANYSEE_HW_507T: /* 2 */
Antti Palosaari41f81f62011-04-10 17:53:52 -0300677 /* E30 */
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300678
Antti Palosaari449d1a02011-07-25 20:25:21 -0300679 if (state->fe_id)
680 break;
681
Antti Palosaari41f81f62011-04-10 17:53:52 -0300682 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300683 adap->fe_adap[0].fe = dvb_attach(mt352_attach,
684 &anysee_mt352_config, &adap->dev->i2c_adap);
Michael Krufky77eed212011-09-06 09:31:57 -0300685 if (adap->fe_adap[0].fe)
Antti Palosaari41f81f62011-04-10 17:53:52 -0300686 break;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300687
Antti Palosaari41f81f62011-04-10 17:53:52 -0300688 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300689 adap->fe_adap[0].fe = dvb_attach(zl10353_attach,
690 &anysee_zl10353_config, &adap->dev->i2c_adap);
Antti Palosaari41f81f62011-04-10 17:53:52 -0300691
692 break;
693 case ANYSEE_HW_507CD: /* 6 */
694 /* E30 Plus */
695
Antti Palosaari449d1a02011-07-25 20:25:21 -0300696 if (state->fe_id)
697 break;
698
Antti Palosaari41f81f62011-04-10 17:53:52 -0300699 /* enable DVB-T demod on IOD[0] */
700 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 0), 0x01);
701 if (ret)
702 goto error;
703
704 /* enable transport stream on IOA[7] */
705 ret = anysee_wr_reg_mask(adap->dev, REG_IOA, (0 << 7), 0x80);
706 if (ret)
707 goto error;
708
709 /* attach demod */
Michael Krufky77eed212011-09-06 09:31:57 -0300710 adap->fe_adap[0].fe = dvb_attach(zl10353_attach,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300711 &anysee_zl10353_config, &adap->dev->i2c_adap);
Antti Palosaari41f81f62011-04-10 17:53:52 -0300712
713 break;
714 case ANYSEE_HW_507DC: /* 10 */
715 /* E30 C Plus */
716
Antti Palosaari449d1a02011-07-25 20:25:21 -0300717 if (state->fe_id)
718 break;
719
Antti Palosaari41f81f62011-04-10 17:53:52 -0300720 /* enable DVB-C demod on IOD[0] */
721 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 0), 0x01);
722 if (ret)
723 goto error;
724
725 /* attach demod */
Michael Krufky77eed212011-09-06 09:31:57 -0300726 adap->fe_adap[0].fe = dvb_attach(tda10023_attach,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300727 &anysee_tda10023_config, &adap->dev->i2c_adap, 0x48);
Antti Palosaari41f81f62011-04-10 17:53:52 -0300728
729 break;
Antti Palosaarif0a53102011-04-27 21:11:59 -0300730 case ANYSEE_HW_507SI: /* 11 */
731 /* E30 S2 Plus */
732
Antti Palosaari449d1a02011-07-25 20:25:21 -0300733 if (state->fe_id)
734 break;
735
Antti Palosaarif0a53102011-04-27 21:11:59 -0300736 /* enable DVB-S/S2 demod on IOD[0] */
737 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 0), 0x01);
738 if (ret)
739 goto error;
740
741 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300742 adap->fe_adap[0].fe = dvb_attach(cx24116_attach,
743 &anysee_cx24116_config, &adap->dev->i2c_adap);
Antti Palosaarif0a53102011-04-27 21:11:59 -0300744
745 break;
Antti Palosaari41f81f62011-04-10 17:53:52 -0300746 case ANYSEE_HW_507FA: /* 15 */
747 /* E30 Combo Plus */
748 /* E30 C Plus */
749
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300750 /* enable tuner on IOE[4] */
751 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10);
752 if (ret)
753 goto error;
754
755 /* probe TDA18212 */
756 tmp = 0;
757 ret = i2c_transfer(&adap->dev->i2c_adap, msg, 2);
758 if (ret == 2 && tmp == 0xc7)
759 deb_info("%s: TDA18212 found\n", __func__);
760 else
761 tmp = 0;
762
763 /* disable tuner on IOE[4] */
764 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 4), 0x10);
765 if (ret)
766 goto error;
767
Antti Palosaari449d1a02011-07-25 20:25:21 -0300768 if ((state->fe_id ^ dvb_usb_anysee_delsys) == 0) {
Antti Palosaari41f81f62011-04-10 17:53:52 -0300769 /* disable DVB-T demod on IOD[0] */
770 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 0),
771 0x01);
772 if (ret)
773 goto error;
774
775 /* enable DVB-C demod on IOD[5] */
776 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 5),
777 0x20);
778 if (ret)
779 goto error;
780
781 /* attach demod */
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300782 if (tmp == 0xc7) {
783 /* TDA18212 config */
Michael Krufky77eed212011-09-06 09:31:57 -0300784 adap->fe_adap[state->fe_id].fe = dvb_attach(
Antti Palosaari449d1a02011-07-25 20:25:21 -0300785 tda10023_attach,
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300786 &anysee_tda10023_tda18212_config,
787 &adap->dev->i2c_adap, 0x48);
788 } else {
789 /* PLL config */
Michael Krufky77eed212011-09-06 09:31:57 -0300790 adap->fe_adap[state->fe_id].fe = dvb_attach(
Antti Palosaari449d1a02011-07-25 20:25:21 -0300791 tda10023_attach,
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300792 &anysee_tda10023_config,
793 &adap->dev->i2c_adap, 0x48);
794 }
Antti Palosaari449d1a02011-07-25 20:25:21 -0300795 } else {
796 /* disable DVB-C demod on IOD[5] */
797 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5),
798 0x20);
799 if (ret)
800 goto error;
801
802 /* enable DVB-T demod on IOD[0] */
803 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 0),
804 0x01);
805 if (ret)
806 goto error;
807
808 /* attach demod */
809 if (tmp == 0xc7) {
810 /* TDA18212 config */
Michael Krufky77eed212011-09-06 09:31:57 -0300811 adap->fe_adap[state->fe_id].fe = dvb_attach(
Antti Palosaari449d1a02011-07-25 20:25:21 -0300812 zl10353_attach,
813 &anysee_zl10353_tda18212_config2,
814 &adap->dev->i2c_adap);
815 } else {
816 /* PLL config */
Michael Krufky77eed212011-09-06 09:31:57 -0300817 adap->fe_adap[state->fe_id].fe = dvb_attach(
Antti Palosaari449d1a02011-07-25 20:25:21 -0300818 zl10353_attach,
819 &anysee_zl10353_config,
820 &adap->dev->i2c_adap);
821 }
Antti Palosaari0f77c3a2008-08-11 10:54:16 -0300822 }
Antti Palosaarie82eea72011-04-12 19:43:30 -0300823
Antti Palosaaribe943512011-09-05 22:10:05 -0300824 /* I2C gate for DNOD44CDH086A(TDA18212) tuner module */
825 if (tmp == 0xc7) {
826 if (adap->fe_adap[state->fe_id].fe)
827 adap->fe_adap[state->fe_id].fe->ops.i2c_gate_ctrl =
828 anysee_i2c_gate_ctrl;
829 }
830
Antti Palosaari41f81f62011-04-10 17:53:52 -0300831 break;
Antti Palosaaria43be982011-04-10 20:23:02 -0300832 case ANYSEE_HW_508TC: /* 18 */
Antti Palosaari8439e0d2011-05-24 07:57:34 -0300833 case ANYSEE_HW_508PTC: /* 21 */
Antti Palosaaria43be982011-04-10 20:23:02 -0300834 /* E7 TC */
Antti Palosaari8439e0d2011-05-24 07:57:34 -0300835 /* E7 PTC */
Antti Palosaaria43be982011-04-10 20:23:02 -0300836
Antti Palosaari449d1a02011-07-25 20:25:21 -0300837 if ((state->fe_id ^ dvb_usb_anysee_delsys) == 0) {
Antti Palosaaria43be982011-04-10 20:23:02 -0300838 /* disable DVB-T demod on IOD[6] */
839 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 6),
840 0x40);
841 if (ret)
842 goto error;
843
844 /* enable DVB-C demod on IOD[5] */
845 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 5),
846 0x20);
847 if (ret)
848 goto error;
849
Antti Palosaari449d1a02011-07-25 20:25:21 -0300850 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300851 adap->fe_adap[state->fe_id].fe =
852 dvb_attach(tda10023_attach,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300853 &anysee_tda10023_tda18212_config,
854 &adap->dev->i2c_adap, 0x48);
855 } else {
856 /* disable DVB-C demod on IOD[5] */
857 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5),
858 0x20);
859 if (ret)
860 goto error;
861
862 /* enable DVB-T demod on IOD[6] */
863 ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (1 << 6),
864 0x40);
Antti Palosaaria43be982011-04-10 20:23:02 -0300865 if (ret)
866 goto error;
867
868 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300869 adap->fe_adap[state->fe_id].fe =
870 dvb_attach(zl10353_attach,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300871 &anysee_zl10353_tda18212_config,
872 &adap->dev->i2c_adap);
Antti Palosaaria43be982011-04-10 20:23:02 -0300873 }
Antti Palosaarie82eea72011-04-12 19:43:30 -0300874
Antti Palosaaribe943512011-09-05 22:10:05 -0300875 /* I2C gate for DNOD44CDH086A(TDA18212) tuner module */
876 if (adap->fe_adap[state->fe_id].fe)
877 adap->fe_adap[state->fe_id].fe->ops.i2c_gate_ctrl =
878 anysee_i2c_gate_ctrl;
879
Antti Palosaari05cd37d2011-09-05 23:33:04 -0300880 state->has_ci = true;
881
Antti Palosaaria43be982011-04-10 20:23:02 -0300882 break;
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300883 case ANYSEE_HW_508S2: /* 19 */
Antti Palosaarifea3c392011-05-25 18:21:43 -0300884 case ANYSEE_HW_508PS2: /* 22 */
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300885 /* E7 S2 */
Antti Palosaarifea3c392011-05-25 18:21:43 -0300886 /* E7 PS2 */
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300887
Antti Palosaari449d1a02011-07-25 20:25:21 -0300888 if (state->fe_id)
889 break;
890
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300891 /* enable DVB-S/S2 demod on IOE[5] */
892 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 5), 0x20);
893 if (ret)
894 goto error;
895
896 /* attach demod */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300897 adap->fe_adap[0].fe = dvb_attach(stv0900_attach,
898 &anysee_stv0900_config, &adap->dev->i2c_adap, 0);
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300899
Antti Palosaari05cd37d2011-09-05 23:33:04 -0300900 state->has_ci = true;
901
Antti Palosaaribedbf3d2011-04-29 13:55:02 -0300902 break;
Antti Palosaari608add82011-08-12 18:29:46 -0300903 case ANYSEE_HW_508T2C: /* 20 */
904 /* E7 T2C */
905
Antti Palosaarifaf27972012-01-15 14:20:50 -0300906 if (state->fe_id)
907 break;
908
Antti Palosaari608add82011-08-12 18:29:46 -0300909 /* enable DVB-T/T2/C demod on IOE[5] */
910 ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 5), 0x20);
911 if (ret)
912 goto error;
913
Antti Palosaarifaf27972012-01-15 14:20:50 -0300914 /* attach demod */
915 adap->fe_adap[state->fe_id].fe = dvb_attach(cxd2820r_attach,
Antti Palosaaric2bbbe72012-01-19 14:46:43 -0300916 &anysee_cxd2820r_config, &adap->dev->i2c_adap);
Antti Palosaari608add82011-08-12 18:29:46 -0300917
Antti Palosaari05cd37d2011-09-05 23:33:04 -0300918 state->has_ci = true;
Antti Palosaari0f77c3a2008-08-11 10:54:16 -0300919
920 break;
921 }
922
Michael Krufky77eed212011-09-06 09:31:57 -0300923 if (!adap->fe_adap[0].fe) {
Antti Palosaari41f81f62011-04-10 17:53:52 -0300924 /* we have no frontend :-( */
925 ret = -ENODEV;
Antti Palosaarie82eea72011-04-12 19:43:30 -0300926 err("Unsupported Anysee version. " \
927 "Please report the <linux-media@vger.kernel.org>.");
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300928 }
Antti Palosaari41f81f62011-04-10 17:53:52 -0300929error:
930 return ret;
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300931}
932
933static int anysee_tuner_attach(struct dvb_usb_adapter *adap)
934{
935 struct anysee_state *state = adap->dev->priv;
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300936 struct dvb_frontend *fe;
Antti Palosaarie82eea72011-04-12 19:43:30 -0300937 int ret;
Antti Palosaari449d1a02011-07-25 20:25:21 -0300938 deb_info("%s: fe=%d\n", __func__, state->fe_id);
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300939
Antti Palosaari41f81f62011-04-10 17:53:52 -0300940 switch (state->hw) {
Antti Palosaari05c46c02011-05-25 18:30:09 -0300941 case ANYSEE_HW_507T: /* 2 */
Antti Palosaari41f81f62011-04-10 17:53:52 -0300942 /* E30 */
943
944 /* attach tuner */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300945 fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe,
946 (0xc2 >> 1), NULL, DVB_PLL_THOMSON_DTT7579);
Antti Palosaarie82eea72011-04-12 19:43:30 -0300947
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300948 break;
Antti Palosaari41f81f62011-04-10 17:53:52 -0300949 case ANYSEE_HW_507CD: /* 6 */
950 /* E30 Plus */
951
952 /* attach tuner */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300953 fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe,
954 (0xc2 >> 1), &adap->dev->i2c_adap,
955 DVB_PLL_THOMSON_DTT7579);
Antti Palosaari41f81f62011-04-10 17:53:52 -0300956
957 break;
958 case ANYSEE_HW_507DC: /* 10 */
959 /* E30 C Plus */
960
961 /* attach tuner */
Antti Palosaari8f4ffb12011-09-29 20:36:33 -0300962 fe = dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe,
963 (0xc0 >> 1), &adap->dev->i2c_adap,
964 DVB_PLL_SAMSUNG_DTOS403IH102A);
Antti Palosaarie82eea72011-04-12 19:43:30 -0300965
Antti Palosaaria51e34d2008-05-17 23:05:48 -0300966 break;
Antti Palosaarif0a53102011-04-27 21:11:59 -0300967 case ANYSEE_HW_507SI: /* 11 */
968 /* E30 S2 Plus */
969
970 /* attach LNB controller */
Michael Krufky77eed212011-09-06 09:31:57 -0300971 fe = dvb_attach(isl6423_attach, adap->fe_adap[0].fe,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300972 &adap->dev->i2c_adap, &anysee_isl6423_config);
Antti Palosaarif0a53102011-04-27 21:11:59 -0300973
974 break;
Antti Palosaari41f81f62011-04-10 17:53:52 -0300975 case ANYSEE_HW_507FA: /* 15 */
976 /* E30 Combo Plus */
977 /* E30 C Plus */
978
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300979 /* Try first attach TDA18212 silicon tuner on IOE[4], if that
980 * fails attach old simple PLL. */
981
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300982 /* attach tuner */
Michael Krufky77eed212011-09-06 09:31:57 -0300983 fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300984 &adap->dev->i2c_adap, &anysee_tda18212_config);
Antti Palosaari72ffd2b2011-04-10 20:14:50 -0300985 if (fe)
986 break;
987
Antti Palosaari41f81f62011-04-10 17:53:52 -0300988 /* attach tuner */
Michael Krufky77eed212011-09-06 09:31:57 -0300989 fe = dvb_attach(dvb_pll_attach, adap->fe_adap[state->fe_id].fe,
Antti Palosaari449d1a02011-07-25 20:25:21 -0300990 (0xc0 >> 1), &adap->dev->i2c_adap,
991 DVB_PLL_SAMSUNG_DTOS403IH102A);
Antti Palosaari41f81f62011-04-10 17:53:52 -0300992
993 break;
Antti Palosaaria43be982011-04-10 20:23:02 -0300994 case ANYSEE_HW_508TC: /* 18 */
Antti Palosaari8439e0d2011-05-24 07:57:34 -0300995 case ANYSEE_HW_508PTC: /* 21 */
Antti Palosaaria43be982011-04-10 20:23:02 -0300996 /* E7 TC */
Antti Palosaari8439e0d2011-05-24 07:57:34 -0300997 /* E7 PTC */
Antti Palosaaria43be982011-04-10 20:23:02 -0300998
Antti Palosaaria43be982011-04-10 20:23:02 -0300999 /* attach tuner */
Michael Krufky77eed212011-09-06 09:31:57 -03001000 fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
Antti Palosaari449d1a02011-07-25 20:25:21 -03001001 &adap->dev->i2c_adap, &anysee_tda18212_config);
Antti Palosaaria43be982011-04-10 20:23:02 -03001002
1003 break;
Antti Palosaaribedbf3d2011-04-29 13:55:02 -03001004 case ANYSEE_HW_508S2: /* 19 */
Antti Palosaarifea3c392011-05-25 18:21:43 -03001005 case ANYSEE_HW_508PS2: /* 22 */
Antti Palosaaribedbf3d2011-04-29 13:55:02 -03001006 /* E7 S2 */
Antti Palosaarifea3c392011-05-25 18:21:43 -03001007 /* E7 PS2 */
Antti Palosaaribedbf3d2011-04-29 13:55:02 -03001008
1009 /* attach tuner */
Michael Krufky77eed212011-09-06 09:31:57 -03001010 fe = dvb_attach(stv6110_attach, adap->fe_adap[0].fe,
Antti Palosaaribedbf3d2011-04-29 13:55:02 -03001011 &anysee_stv6110_config, &adap->dev->i2c_adap);
1012
1013 if (fe) {
1014 /* attach LNB controller */
Michael Krufky77eed212011-09-06 09:31:57 -03001015 fe = dvb_attach(isl6423_attach, adap->fe_adap[0].fe,
Antti Palosaaribedbf3d2011-04-29 13:55:02 -03001016 &adap->dev->i2c_adap, &anysee_isl6423_config);
1017 }
1018
1019 break;
Antti Palosaari608add82011-08-12 18:29:46 -03001020
1021 case ANYSEE_HW_508T2C: /* 20 */
1022 /* E7 T2C */
1023
1024 /* attach tuner */
Antti Palosaaribe943512011-09-05 22:10:05 -03001025 fe = dvb_attach(tda18212_attach, adap->fe_adap[state->fe_id].fe,
Antti Palosaari608add82011-08-12 18:29:46 -03001026 &adap->dev->i2c_adap, &anysee_tda18212_config2);
1027
1028 break;
Antti Palosaari41f81f62011-04-10 17:53:52 -03001029 default:
Antti Palosaarie82eea72011-04-12 19:43:30 -03001030 fe = NULL;
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001031 }
1032
Antti Palosaarie82eea72011-04-12 19:43:30 -03001033 if (fe)
1034 ret = 0;
1035 else
1036 ret = -ENODEV;
1037
Antti Palosaari41f81f62011-04-10 17:53:52 -03001038 return ret;
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001039}
1040
Antti Palosaaria8494682010-10-17 18:25:10 -03001041static int anysee_rc_query(struct dvb_usb_device *d)
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001042{
1043 u8 buf[] = {CMD_GET_IR_CODE};
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001044 u8 ircode[2];
Antti Palosaaria8494682010-10-17 18:25:10 -03001045 int ret;
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001046
Antti Palosaaria8494682010-10-17 18:25:10 -03001047 /* Remote controller is basic NEC using address byte 0x08.
1048 Anysee device RC query returns only two bytes, status and code,
1049 address byte is dropped. Also it does not return any value for
1050 NEC RCs having address byte other than 0x08. Due to that, we
1051 cannot use that device as standard NEC receiver.
1052 It could be possible make hack which reads whole code directly
1053 from device memory... */
1054
1055 ret = anysee_ctrl_msg(d, buf, sizeof(buf), ircode, sizeof(ircode));
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001056 if (ret)
1057 return ret;
1058
Antti Palosaaria8494682010-10-17 18:25:10 -03001059 if (ircode[0]) {
1060 deb_rc("%s: key pressed %02x\n", __func__, ircode[1]);
Mauro Carvalho Chehabca866742010-11-17 13:53:11 -03001061 rc_keydown(d->rc_dev, 0x08 << 8 | ircode[1], 0);
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001062 }
Antti Palosaaria8494682010-10-17 18:25:10 -03001063
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001064 return 0;
1065}
1066
Antti Palosaari05cd37d2011-09-05 23:33:04 -03001067static int anysee_ci_read_attribute_mem(struct dvb_ca_en50221 *ci, int slot,
1068 int addr)
1069{
1070 struct dvb_usb_device *d = ci->data;
1071 int ret;
1072 u8 buf[] = {CMD_CI, 0x02, 0x40 | addr >> 8, addr & 0xff, 0x00, 1};
1073 u8 val;
1074
1075 ret = anysee_ctrl_msg(d, buf, sizeof(buf), &val, 1);
1076 if (ret)
1077 return ret;
1078
1079 return val;
1080}
1081
1082static int anysee_ci_write_attribute_mem(struct dvb_ca_en50221 *ci, int slot,
1083 int addr, u8 val)
1084{
1085 struct dvb_usb_device *d = ci->data;
1086 int ret;
1087 u8 buf[] = {CMD_CI, 0x03, 0x40 | addr >> 8, addr & 0xff, 0x00, 1, val};
1088
1089 ret = anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
1090 if (ret)
1091 return ret;
1092
1093 return 0;
1094}
1095
1096static int anysee_ci_read_cam_control(struct dvb_ca_en50221 *ci, int slot,
1097 u8 addr)
1098{
1099 struct dvb_usb_device *d = ci->data;
1100 int ret;
1101 u8 buf[] = {CMD_CI, 0x04, 0x40, addr, 0x00, 1};
1102 u8 val;
1103
1104 ret = anysee_ctrl_msg(d, buf, sizeof(buf), &val, 1);
1105 if (ret)
1106 return ret;
1107
1108 return val;
1109}
1110
1111static int anysee_ci_write_cam_control(struct dvb_ca_en50221 *ci, int slot,
1112 u8 addr, u8 val)
1113{
1114 struct dvb_usb_device *d = ci->data;
1115 int ret;
1116 u8 buf[] = {CMD_CI, 0x05, 0x40, addr, 0x00, 1, val};
1117
1118 ret = anysee_ctrl_msg(d, buf, sizeof(buf), NULL, 0);
1119 if (ret)
1120 return ret;
1121
1122 return 0;
1123}
1124
1125static int anysee_ci_slot_reset(struct dvb_ca_en50221 *ci, int slot)
1126{
1127 struct dvb_usb_device *d = ci->data;
1128 int ret;
1129 struct anysee_state *state = d->priv;
1130
1131 state->ci_cam_ready = jiffies + msecs_to_jiffies(1000);
1132
1133 ret = anysee_wr_reg_mask(d, REG_IOA, (0 << 7), 0x80);
1134 if (ret)
1135 return ret;
1136
1137 msleep(300);
1138
1139 ret = anysee_wr_reg_mask(d, REG_IOA, (1 << 7), 0x80);
1140 if (ret)
1141 return ret;
1142
1143 return 0;
1144}
1145
1146static int anysee_ci_slot_shutdown(struct dvb_ca_en50221 *ci, int slot)
1147{
1148 struct dvb_usb_device *d = ci->data;
1149 int ret;
1150
1151 ret = anysee_wr_reg_mask(d, REG_IOA, (0 << 7), 0x80);
1152 if (ret)
1153 return ret;
1154
1155 msleep(30);
1156
1157 ret = anysee_wr_reg_mask(d, REG_IOA, (1 << 7), 0x80);
1158 if (ret)
1159 return ret;
1160
1161 return 0;
1162}
1163
1164static int anysee_ci_slot_ts_enable(struct dvb_ca_en50221 *ci, int slot)
1165{
1166 struct dvb_usb_device *d = ci->data;
1167 int ret;
1168
1169 ret = anysee_wr_reg_mask(d, REG_IOD, (0 << 1), 0x02);
1170 if (ret)
1171 return ret;
1172
1173 return 0;
1174}
1175
1176static int anysee_ci_poll_slot_status(struct dvb_ca_en50221 *ci, int slot,
1177 int open)
1178{
1179 struct dvb_usb_device *d = ci->data;
1180 struct anysee_state *state = d->priv;
1181 int ret;
1182 u8 tmp;
1183
1184 ret = anysee_rd_reg_mask(d, REG_IOC, &tmp, 0x40);
1185 if (ret)
1186 return ret;
1187
1188 if (tmp == 0) {
1189 ret = DVB_CA_EN50221_POLL_CAM_PRESENT;
1190 if (time_after(jiffies, state->ci_cam_ready))
1191 ret |= DVB_CA_EN50221_POLL_CAM_READY;
1192 }
1193
1194 return ret;
1195}
1196
1197static int anysee_ci_init(struct dvb_usb_device *d)
1198{
1199 struct anysee_state *state = d->priv;
1200 int ret;
1201
1202 state->ci.owner = THIS_MODULE;
1203 state->ci.read_attribute_mem = anysee_ci_read_attribute_mem;
1204 state->ci.write_attribute_mem = anysee_ci_write_attribute_mem;
1205 state->ci.read_cam_control = anysee_ci_read_cam_control;
1206 state->ci.write_cam_control = anysee_ci_write_cam_control;
1207 state->ci.slot_reset = anysee_ci_slot_reset;
1208 state->ci.slot_shutdown = anysee_ci_slot_shutdown;
1209 state->ci.slot_ts_enable = anysee_ci_slot_ts_enable;
1210 state->ci.poll_slot_status = anysee_ci_poll_slot_status;
1211 state->ci.data = d;
1212
1213 ret = anysee_wr_reg_mask(d, REG_IOA, (1 << 7), 0x80);
1214 if (ret)
1215 return ret;
1216
Antti Palosaari46de20a2012-01-20 17:39:17 -03001217 ret = anysee_wr_reg_mask(d, REG_IOD, (0 << 2)|(0 << 1)|(0 << 0), 0x07);
1218 if (ret)
1219 return ret;
1220
1221 ret = anysee_wr_reg_mask(d, REG_IOD, (1 << 2)|(1 << 1)|(1 << 0), 0x07);
1222 if (ret)
1223 return ret;
1224
Antti Palosaari05cd37d2011-09-05 23:33:04 -03001225 ret = dvb_ca_en50221_init(&d->adapter[0].dvb_adap, &state->ci, 0, 1);
1226 if (ret)
1227 return ret;
1228
1229 return 0;
1230}
1231
1232static void anysee_ci_release(struct dvb_usb_device *d)
1233{
1234 struct anysee_state *state = d->priv;
1235
1236 /* detach CI */
1237 if (state->has_ci)
1238 dvb_ca_en50221_release(&state->ci);
1239
1240 return;
1241}
1242
1243static int anysee_init(struct dvb_usb_device *d)
1244{
1245 struct anysee_state *state = d->priv;
1246 int ret;
1247
1248 /* LED light */
1249 ret = anysee_led_ctrl(d, 0x01, 0x03);
1250 if (ret)
1251 return ret;
1252
1253 /* enable IR */
1254 ret = anysee_ir_ctrl(d, 1);
1255 if (ret)
1256 return ret;
1257
1258 /* attach CI */
1259 if (state->has_ci) {
1260 ret = anysee_ci_init(d);
1261 if (ret) {
1262 state->has_ci = false;
1263 return ret;
1264 }
1265 }
1266
1267 return 0;
1268}
1269
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001270/* DVB USB Driver stuff */
1271static struct dvb_usb_device_properties anysee_properties;
1272
1273static int anysee_probe(struct usb_interface *intf,
1274 const struct usb_device_id *id)
1275{
1276 struct dvb_usb_device *d;
1277 struct usb_host_interface *alt;
1278 int ret;
1279
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001280 /* There is one interface with two alternate settings.
1281 Alternate setting 0 is for bulk transfer.
1282 Alternate setting 1 is for isochronous transfer.
1283 We use bulk transfer (alternate setting 0). */
1284 if (intf->num_altsetting < 1)
1285 return -ENODEV;
1286
Dan Carpenter8b0d7042010-05-31 16:27:39 -03001287 /*
1288 * Anysee is always warm (its USB-bridge, Cypress FX2, uploads
1289 * firmware from eeprom). If dvb_usb_device_init() succeeds that
1290 * means d is a valid pointer.
1291 */
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001292 ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d,
1293 adapter_nr);
1294 if (ret)
1295 return ret;
1296
1297 alt = usb_altnum_to_altsetting(intf, 0);
1298 if (alt == NULL) {
1299 deb_info("%s: no alt found!\n", __func__);
1300 return -ENODEV;
1301 }
1302
1303 ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
1304 alt->desc.bAlternateSetting);
1305 if (ret)
1306 return ret;
1307
Dan Carpenter8b0d7042010-05-31 16:27:39 -03001308 return anysee_init(d);
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001309}
1310
Antti Palosaari05cd37d2011-09-05 23:33:04 -03001311static void anysee_disconnect(struct usb_interface *intf)
1312{
1313 struct dvb_usb_device *d = usb_get_intfdata(intf);
1314
1315 anysee_ci_release(d);
1316 dvb_usb_device_exit(intf);
1317
1318 return;
1319}
1320
Antti Palosaariae3745f2009-09-16 19:50:25 -03001321static struct usb_device_id anysee_table[] = {
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001322 { USB_DEVICE(USB_VID_CYPRESS, USB_PID_ANYSEE) },
1323 { USB_DEVICE(USB_VID_AMT, USB_PID_ANYSEE) },
1324 { } /* Terminating entry */
1325};
1326MODULE_DEVICE_TABLE(usb, anysee_table);
1327
1328static struct dvb_usb_device_properties anysee_properties = {
1329 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
1330
1331 .usb_ctrl = DEVICE_SPECIFIC,
1332
1333 .size_of_priv = sizeof(struct anysee_state),
1334
1335 .num_adapters = 1,
1336 .adapter = {
1337 {
Michael Krufky77eed212011-09-06 09:31:57 -03001338 .num_frontends = 2,
1339 .frontend_ctrl = anysee_frontend_ctrl,
Antti Palosaari8f4ffb12011-09-29 20:36:33 -03001340 .fe = { {
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001341 .streaming_ctrl = anysee_streaming_ctrl,
1342 .frontend_attach = anysee_frontend_attach,
1343 .tuner_attach = anysee_tuner_attach,
1344 .stream = {
1345 .type = USB_BULK,
1346 .count = 8,
1347 .endpoint = 0x82,
1348 .u = {
1349 .bulk = {
Antti Palosaariab693332009-09-16 19:47:01 -03001350 .buffersize = (16*512),
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001351 }
1352 }
1353 },
Michael Krufky77eed212011-09-06 09:31:57 -03001354 }, {
1355 .streaming_ctrl = anysee_streaming_ctrl,
1356 .frontend_attach = anysee_frontend_attach,
1357 .tuner_attach = anysee_tuner_attach,
1358 .stream = {
1359 .type = USB_BULK,
1360 .count = 8,
1361 .endpoint = 0x82,
1362 .u = {
1363 .bulk = {
1364 .buffersize = (16*512),
1365 }
1366 }
1367 },
Antti Palosaari8f4ffb12011-09-29 20:36:33 -03001368 } },
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001369 }
1370 },
1371
Antti Palosaaria8494682010-10-17 18:25:10 -03001372 .rc.core = {
1373 .rc_codes = RC_MAP_ANYSEE,
Mauro Carvalho Chehab52b66142010-11-17 14:20:52 -03001374 .protocol = RC_TYPE_OTHER,
Antti Palosaaria8494682010-10-17 18:25:10 -03001375 .module_name = "anysee",
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001376 .rc_query = anysee_rc_query,
Antti Palosaaria8494682010-10-17 18:25:10 -03001377 .rc_interval = 250, /* windows driver uses 500ms */
Mauro Carvalho Chehabf72a27b2010-07-31 18:04:09 -03001378 },
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001379
1380 .i2c_algo = &anysee_i2c_algo,
1381
1382 .generic_bulk_ctrl_endpoint = 1,
1383
1384 .num_device_descs = 1,
1385 .devices = {
1386 {
1387 .name = "Anysee DVB USB2.0",
1388 .cold_ids = {NULL},
1389 .warm_ids = {&anysee_table[0],
1390 &anysee_table[1], NULL},
1391 },
1392 }
1393};
1394
1395static struct usb_driver anysee_driver = {
1396 .name = "dvb_usb_anysee",
1397 .probe = anysee_probe,
Antti Palosaari05cd37d2011-09-05 23:33:04 -03001398 .disconnect = anysee_disconnect,
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001399 .id_table = anysee_table,
1400};
1401
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08001402module_usb_driver(anysee_driver);
Antti Palosaaria51e34d2008-05-17 23:05:48 -03001403
1404MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
1405MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0");
1406MODULE_LICENSE("GPL");