aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.tuner1
-rw-r--r--drivers/media/dvb/frontends/Kconfig6
-rw-r--r--drivers/media/dvb/frontends/Makefile1
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c15
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.h2
-rw-r--r--drivers/media/dvb/frontends/zl10353.c311
-rw-r--r--drivers/media/dvb/frontends/zl10353.h43
-rw-r--r--drivers/media/dvb/frontends/zl10353_priv.h42
-rw-r--r--drivers/media/video/cx88/Makefile1
-rw-r--r--drivers/media/video/cx88/cx88-cards.c67
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c108
-rw-r--r--drivers/media/video/cx88/cx88.h1
-rw-r--r--drivers/media/video/tuner-types.c20
-rw-r--r--include/media/tuner.h3
15 files changed, 599 insertions, 23 deletions
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index d852ad4f93a2..3b39a91b24bd 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -44,3 +44,4 @@
44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1] 44 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1]
45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] 45 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54]
46 45 -> KWorld HardwareMpegTV XPert [17de:0840] 46 45 -> KWorld HardwareMpegTV XPert [17de:0840]
47 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44]
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index de48438d5115..ab344c94c0a2 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -70,3 +70,4 @@ tuner=68 - Philips TUV1236D ATSC/NTSC dual in
70tuner=69 - Tena TNF 5335 MF 70tuner=69 - Tena TNF 5335 MF
71tuner=70 - Samsung TCPN 2121P30A 71tuner=70 - Samsung TCPN 2121P30A
72tuner=71 - Xceive xc3028 72tuner=71 - Xceive xc3028
73tuner=72 - FE6600
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index c676b1e23ab0..a1a894d81040 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -116,6 +116,12 @@ config DVB_MT352
116 help 116 help
117 A DVB-T tuner module. Say Y when you want to support this frontend. 117 A DVB-T tuner module. Say Y when you want to support this frontend.
118 118
119config DVB_ZL10353
120 tristate "Zarlink ZL10353 based"
121 depends on DVB_CORE
122 help
123 A DVB-T tuner module. Say Y when you want to support this frontend.
124
119config DVB_DIB3000MB 125config DVB_DIB3000MB
120 tristate "DiBcom 3000M-B" 126 tristate "DiBcom 3000M-B"
121 depends on DVB_CORE 127 depends on DVB_CORE
diff --git a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile
index 1af769cd90c0..d09b6071fbaf 100644
--- a/drivers/media/dvb/frontends/Makefile
+++ b/drivers/media/dvb/frontends/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_DVB_TDA1004X) += tda1004x.o
20obj-$(CONFIG_DVB_SP887X) += sp887x.o 20obj-$(CONFIG_DVB_SP887X) += sp887x.o
21obj-$(CONFIG_DVB_NXT6000) += nxt6000.o 21obj-$(CONFIG_DVB_NXT6000) += nxt6000.o
22obj-$(CONFIG_DVB_MT352) += mt352.o 22obj-$(CONFIG_DVB_MT352) += mt352.o
23obj-$(CONFIG_DVB_ZL10353) += zl10353.o
23obj-$(CONFIG_DVB_CX22702) += cx22702.o 24obj-$(CONFIG_DVB_CX22702) += cx22702.o
24obj-$(CONFIG_DVB_TDA10021) += tda10021.o 25obj-$(CONFIG_DVB_TDA10021) += tda10021.o
25obj-$(CONFIG_DVB_STV0297) += stv0297.o 26obj-$(CONFIG_DVB_STV0297) += stv0297.o
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 4f682534df42..8a4c904d3a27 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -404,6 +404,21 @@ struct dvb_pll_desc dvb_pll_philips_td1316 = {
404}; 404};
405EXPORT_SYMBOL(dvb_pll_philips_td1316); 405EXPORT_SYMBOL(dvb_pll_philips_td1316);
406 406
407/* FE6600 used on DViCO Hybrid */
408struct dvb_pll_desc dvb_pll_unknown_fe6600 = {
409 .name = "FE6600",
410 .min = 44250000,
411 .max = 858000000,
412 .count = 4,
413 .entries = {
414 { 250000000, 36213333, 166667, 0xb4, 0x12 },
415 { 455000000, 36213333, 166667, 0xfe, 0x11 },
416 { 775500000, 36213333, 166667, 0xbc, 0x18 },
417 { 999999999, 36213333, 166667, 0xf4, 0x18 },
418 }
419};
420EXPORT_SYMBOL(dvb_pll_unknown_fe6600);
421
407/* ----------------------------------------------------------- */ 422/* ----------------------------------------------------------- */
408/* code */ 423/* code */
409 424
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h
index 56c3cd76a7fa..8a7f0b941c38 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -42,6 +42,8 @@ extern struct dvb_pll_desc dvb_pll_samsung_tbmv;
42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261; 42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261;
43extern struct dvb_pll_desc dvb_pll_philips_td1316; 43extern struct dvb_pll_desc dvb_pll_philips_td1316;
44 44
45extern struct dvb_pll_desc dvb_pll_unknown_fe6600;
46
45int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 47int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
46 u32 freq, int bandwidth); 48 u32 freq, int bandwidth);
47 49
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c
new file mode 100644
index 000000000000..23846c4452ad
--- /dev/null
+++ b/drivers/media/dvb/frontends/zl10353.c
@@ -0,0 +1,311 @@
1/*
2 * Driver for Zarlink DVB-T ZL10353 demodulator
3 *
4 * Copyright (C) 2006 Christopher Pascoe <c.pascoe@itee.uq.edu.au>
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 *
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
20 */
21
22#include <linux/kernel.h>
23#include <linux/module.h>
24#include <linux/moduleparam.h>
25#include <linux/init.h>
26#include <linux/delay.h>
27#include <linux/string.h>
28#include <linux/slab.h>
29
30#include "dvb_frontend.h"
31#include "zl10353_priv.h"
32#include "zl10353.h"
33
34struct zl10353_state {
35 struct i2c_adapter *i2c;
36 struct dvb_frontend frontend;
37 struct dvb_frontend_ops ops;
38
39 struct zl10353_config config;
40};
41
42static int debug_regs = 0;
43
44static int zl10353_single_write(struct dvb_frontend *fe, u8 reg, u8 val)
45{
46 struct zl10353_state *state = fe->demodulator_priv;
47 u8 buf[2] = { reg, val };
48 struct i2c_msg msg = { .addr = state->config.demod_address, .flags = 0,
49 .buf = buf, .len = 2 };
50 int err = i2c_transfer(state->i2c, &msg, 1);
51 if (err != 1) {
52 printk("zl10353: write to reg %x failed (err = %d)!\n", reg, err);
53 return err;
54 }
55 return 0;
56}
57
58int zl10353_write(struct dvb_frontend *fe, u8 *ibuf, int ilen)
59{
60 int err, i;
61 for (i = 0; i < ilen - 1; i++)
62 if ((err = zl10353_single_write(fe, ibuf[0] + i, ibuf[i + 1])))
63 return err;
64
65 return 0;
66}
67
68static int zl10353_read_register(struct zl10353_state *state, u8 reg)
69{
70 int ret;
71 u8 b0[1] = { reg };
72 u8 b1[1] = { 0 };
73 struct i2c_msg msg[2] = { { .addr = state->config.demod_address,
74 .flags = 0,
75 .buf = b0, .len = 1 },
76 { .addr = state->config.demod_address,
77 .flags = I2C_M_RD,
78 .buf = b1, .len = 1 } };
79
80 ret = i2c_transfer(state->i2c, msg, 2);
81
82 if (ret != 2) {
83 printk("%s: readreg error (reg=%d, ret==%i)\n",
84 __FUNCTION__, reg, ret);
85 return ret;
86 }
87
88 return b1[0];
89}
90
91void zl10353_dump_regs(struct dvb_frontend *fe)
92{
93 struct zl10353_state *state = fe->demodulator_priv;
94 char buf[52], buf2[4];
95 int ret;
96 u8 reg;
97
98 /* Dump all registers. */
99 for (reg = 0; ; reg++) {
100 if (reg % 16 == 0) {
101 if (reg)
102 printk(KERN_DEBUG "%s\n", buf);
103 sprintf(buf, "%02x: ", reg);
104 }
105 ret = zl10353_read_register(state, reg);
106 if (ret >= 0)
107 sprintf(buf2, "%02x ", (u8)ret);
108 else
109 strcpy(buf2, "-- ");
110 strcat(buf, buf2);
111 if (reg == 0xff)
112 break;
113 }
114 printk(KERN_DEBUG "%s\n", buf);
115}
116
117static int zl10353_sleep(struct dvb_frontend *fe)
118{
119 static u8 zl10353_softdown[] = { 0x50, 0x0C, 0x44 };
120
121 zl10353_write(fe, zl10353_softdown, sizeof(zl10353_softdown));
122 return 0;
123}
124
125static int zl10353_set_parameters(struct dvb_frontend *fe,
126 struct dvb_frontend_parameters *param)
127{
128 struct zl10353_state *state = fe->demodulator_priv;
129 u8 pllbuf[6] = { 0x67 };
130
131 /* These settings set "auto-everything" and start the FSM. */
132 zl10353_single_write(fe, 0x55, 0x80);
133 udelay(200);
134 zl10353_single_write(fe, 0xEA, 0x01);
135 udelay(200);
136 zl10353_single_write(fe, 0xEA, 0x00);
137
138 zl10353_single_write(fe, 0x56, 0x28);
139 zl10353_single_write(fe, 0x89, 0x20);
140 zl10353_single_write(fe, 0x5E, 0x00);
141 zl10353_single_write(fe, 0x65, 0x5A);
142 zl10353_single_write(fe, 0x66, 0xE9);
143 zl10353_single_write(fe, 0x62, 0x0A);
144
145 state->config.pll_set(fe, param, pllbuf + 1);
146 zl10353_write(fe, pllbuf, sizeof(pllbuf));
147
148 zl10353_single_write(fe, 0x70, 0x01);
149 udelay(250);
150 zl10353_single_write(fe, 0xE4, 0x00);
151 zl10353_single_write(fe, 0xE5, 0x2A);
152 zl10353_single_write(fe, 0xE9, 0x02);
153 zl10353_single_write(fe, 0xE7, 0x40);
154 zl10353_single_write(fe, 0xE8, 0x10);
155
156 return 0;
157}
158
159static int zl10353_read_status(struct dvb_frontend *fe, fe_status_t *status)
160{
161 struct zl10353_state *state = fe->demodulator_priv;
162 int s6, s7, s8;
163
164 if ((s6 = zl10353_read_register(state, STATUS_6)) < 0)
165 return -EREMOTEIO;
166 if ((s7 = zl10353_read_register(state, STATUS_7)) < 0)
167 return -EREMOTEIO;
168 if ((s8 = zl10353_read_register(state, STATUS_8)) < 0)
169 return -EREMOTEIO;
170
171 *status = 0;
172 if (s6 & (1 << 2))
173 *status |= FE_HAS_CARRIER;
174 if (s6 & (1 << 1))
175 *status |= FE_HAS_VITERBI;
176 if (s6 & (1 << 5))
177 *status |= FE_HAS_LOCK;
178 if (s7 & (1 << 4))
179 *status |= FE_HAS_SYNC;
180 if (s8 & (1 << 6))
181 *status |= FE_HAS_SIGNAL;
182
183 if ((*status & (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC)) !=
184 (FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC))
185 *status &= ~FE_HAS_LOCK;
186
187 return 0;
188}
189
190static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
191{
192 struct zl10353_state *state = fe->demodulator_priv;
193 u8 _snr;
194
195 if (debug_regs)
196 zl10353_dump_regs(fe);
197
198 _snr = zl10353_read_register(state, SNR);
199 *snr = (_snr << 8) | _snr;
200
201 return 0;
202}
203
204static int zl10353_get_tune_settings(struct dvb_frontend *fe,
205 struct dvb_frontend_tune_settings
206 *fe_tune_settings)
207{
208 fe_tune_settings->min_delay_ms = 1000;
209 fe_tune_settings->step_size = 0;
210 fe_tune_settings->max_drift = 0;
211
212 return 0;
213}
214
215static int zl10353_init(struct dvb_frontend *fe)
216{
217 struct zl10353_state *state = fe->demodulator_priv;
218 u8 zl10353_reset_attach[6] = { 0x50, 0x03, 0x64, 0x46, 0x15, 0x0F };
219 int rc = 0;
220
221 if (debug_regs)
222 zl10353_dump_regs(fe);
223
224 /* Do a "hard" reset if not already done */
225 if (zl10353_read_register(state, 0x50) != 0x03) {
226 rc = zl10353_write(fe, zl10353_reset_attach,
227 sizeof(zl10353_reset_attach));
228 if (debug_regs)
229 zl10353_dump_regs(fe);
230 }
231
232 return 0;
233}
234
235static void zl10353_release(struct dvb_frontend *fe)
236{
237 struct zl10353_state *state = fe->demodulator_priv;
238
239 kfree(state);
240}
241
242static struct dvb_frontend_ops zl10353_ops;
243
244struct dvb_frontend *zl10353_attach(const struct zl10353_config *config,
245 struct i2c_adapter *i2c)
246{
247 struct zl10353_state *state = NULL;
248
249 /* allocate memory for the internal state */
250 state = kzalloc(sizeof(struct zl10353_state), GFP_KERNEL);
251 if (state == NULL)
252 goto error;
253
254 /* setup the state */
255 state->i2c = i2c;
256 memcpy(&state->config, config, sizeof(struct zl10353_config));
257 memcpy(&state->ops, &zl10353_ops, sizeof(struct dvb_frontend_ops));
258
259 /* check if the demod is there */
260 if (zl10353_read_register(state, CHIP_ID) != ID_ZL10353)
261 goto error;
262
263 /* create dvb_frontend */
264 state->frontend.ops = &state->ops;
265 state->frontend.demodulator_priv = state;
266
267 return &state->frontend;
268error:
269 kfree(state);
270 return NULL;
271}
272
273static struct dvb_frontend_ops zl10353_ops = {
274
275 .info = {
276 .name = "Zarlink ZL10353 DVB-T",
277 .type = FE_OFDM,
278 .frequency_min = 174000000,
279 .frequency_max = 862000000,
280 .frequency_stepsize = 166667,
281 .frequency_tolerance = 0,
282 .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
283 FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 |
284 FE_CAN_FEC_AUTO |
285 FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
286 FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
287 FE_CAN_HIERARCHY_AUTO | FE_CAN_RECOVER |
288 FE_CAN_MUTE_TS
289 },
290
291 .release = zl10353_release,
292
293 .init = zl10353_init,
294 .sleep = zl10353_sleep,
295
296 .set_frontend = zl10353_set_parameters,
297 .get_tune_settings = zl10353_get_tune_settings,
298
299 .read_status = zl10353_read_status,
300 .read_snr = zl10353_read_snr,
301};
302
303module_param(debug_regs, int, 0644);
304MODULE_PARM_DESC(debug_regs, "Turn on/off frontend register dumps (default:off).");
305
306MODULE_DESCRIPTION("Zarlink ZL10353 DVB-T demodulator driver");
307MODULE_AUTHOR("Chris Pascoe");
308MODULE_LICENSE("GPL");
309
310EXPORT_SYMBOL(zl10353_attach);
311EXPORT_SYMBOL(zl10353_write);
diff --git a/drivers/media/dvb/frontends/zl10353.h b/drivers/media/dvb/frontends/zl10353.h
new file mode 100644
index 000000000000..5cc4ae718d8c
--- /dev/null
+++ b/drivers/media/dvb/frontends/zl10353.h
@@ -0,0 +1,43 @@
1/*
2 * Driver for Zarlink DVB-T ZL10353 demodulator
3 *
4 * Copyright (C) 2006 Christopher Pascoe <c.pascoe@itee.uq.edu.au>
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 *
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
20 */
21
22#ifndef ZL10353_H
23#define ZL10353_H
24
25#include <linux/dvb/frontend.h>
26
27struct zl10353_config
28{
29 /* demodulator's I2C address */
30 u8 demod_address;
31
32 /* function which configures the PLL buffer (for secondary I2C
33 * connected tuner) or tunes the PLL (for direct connected tuner) */
34 int (*pll_set)(struct dvb_frontend *fe,
35 struct dvb_frontend_parameters *params, u8 *pllbuf);
36};
37
38extern struct dvb_frontend* zl10353_attach(const struct zl10353_config *config,
39 struct i2c_adapter *i2c);
40
41extern int zl10353_write(struct dvb_frontend *fe, u8 *ibuf, int ilen);
42
43#endif /* ZL10353_H */
diff --git a/drivers/media/dvb/frontends/zl10353_priv.h b/drivers/media/dvb/frontends/zl10353_priv.h
new file mode 100644
index 000000000000..b72224bd7dde
--- /dev/null
+++ b/drivers/media/dvb/frontends/zl10353_priv.h
@@ -0,0 +1,42 @@
1/*
2 * Driver for Zarlink DVB-T ZL10353 demodulator
3 *
4 * Copyright (C) 2006 Christopher Pascoe <c.pascoe@itee.uq.edu.au>
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 *
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
20 */
21
22#ifndef _ZL10353_PRIV_
23#define _ZL10353_PRIV_
24
25#define ID_ZL10353 0x14
26
27enum zl10353_reg_addr {
28 INTERRUPT_0 = 0x00,
29 INTERRUPT_1 = 0x01,
30 INTERRUPT_2 = 0x02,
31 INTERRUPT_3 = 0x03,
32 INTERRUPT_4 = 0x04,
33 INTERRUPT_5 = 0x05,
34 STATUS_6 = 0x06,
35 STATUS_7 = 0x07,
36 STATUS_8 = 0x08,
37 STATUS_9 = 0x09,
38 SNR = 0x10,
39 CHIP_ID = 0x7F,
40};
41
42#endif /* _ZL10353_PRIV_ */
diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index 2b902784facc..6482b9aa6a1f 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -17,6 +17,7 @@ extra-cflags-$(CONFIG_DVB_CX22702) += -DHAVE_CX22702=1
17extra-cflags-$(CONFIG_DVB_OR51132) += -DHAVE_OR51132=1 17extra-cflags-$(CONFIG_DVB_OR51132) += -DHAVE_OR51132=1
18extra-cflags-$(CONFIG_DVB_LGDT330X) += -DHAVE_LGDT330X=1 18extra-cflags-$(CONFIG_DVB_LGDT330X) += -DHAVE_LGDT330X=1
19extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1 19extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1
20extra-cflags-$(CONFIG_DVB_ZL10353) += -DHAVE_ZL10353=1
20extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1 21extra-cflags-$(CONFIG_DVB_NXT200X) += -DHAVE_NXT200X=1
21extra-cflags-$(CONFIG_DVB_CX24123) += -DHAVE_CX24123=1 22extra-cflags-$(CONFIG_DVB_CX24123) += -DHAVE_CX24123=1
22extra-cflags-$(CONFIG_VIDEO_CX88_VP3054)+= -DHAVE_VP3054_I2C=1 23extra-cflags-$(CONFIG_VIDEO_CX88_VP3054)+= -DHAVE_VP3054_I2C=1
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 44e27dc646ae..d91e5b3a64ef 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1071,6 +1071,27 @@ struct cx88_board cx88_boards[] = {
1071 .gpio2 = 0x00ff, 1071 .gpio2 = 0x00ff,
1072 }, 1072 },
1073 }, 1073 },
1074 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID] = {
1075 .name = "DViCO FusionHDTV DVB-T Hybrid",
1076 .tuner_type = TUNER_FE6600,
1077 .radio_type = UNSET,
1078 .tuner_addr = ADDR_UNSET,
1079 .radio_addr = ADDR_UNSET,
1080 .input = {{
1081 .type = CX88_VMUX_TELEVISION,
1082 .vmux = 0,
1083 .gpio0 = 0x0000a75f,
1084 },{
1085 .type = CX88_VMUX_COMPOSITE1,
1086 .vmux = 1,
1087 .gpio0 = 0x0000a75b,
1088 },{
1089 .type = CX88_VMUX_SVIDEO,
1090 .vmux = 2,
1091 .gpio0 = 0x0000a75b,
1092 }},
1093 .dvb = 1,
1094 },
1074 1095
1075}; 1096};
1076const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 1097const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
@@ -1281,6 +1302,14 @@ struct cx88_subid cx88_subids[] = {
1281 .subvendor = 0x17de, 1302 .subvendor = 0x17de,
1282 .subdevice = 0x0840, 1303 .subdevice = 0x0840,
1283 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT, 1304 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1305 },{
1306 .subvendor = 0x18ac,
1307 .subdevice = 0xdb40,
1308 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1309 },{
1310 .subvendor = 0x18ac,
1311 .subdevice = 0xdb44,
1312 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1284 }, 1313 },
1285}; 1314};
1286const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 1315const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1400,6 +1429,40 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
1400} 1429}
1401 1430
1402/* ----------------------------------------------------------------------- */ 1431/* ----------------------------------------------------------------------- */
1432/* some DViCO specific stuff */
1433
1434static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
1435{
1436 struct i2c_msg msg = { .addr = 0x45, .flags = 0 };
1437 int i, err;
1438 u8 init_bufs[13][5] = {
1439 { 0x10, 0x00, 0x20, 0x01, 0x03 },
1440 { 0x10, 0x10, 0x01, 0x00, 0x21 },
1441 { 0x10, 0x10, 0x10, 0x00, 0xCA },
1442 { 0x10, 0x10, 0x12, 0x00, 0x08 },
1443 { 0x10, 0x10, 0x13, 0x00, 0x0A },
1444 { 0x10, 0x10, 0x16, 0x01, 0xC0 },
1445 { 0x10, 0x10, 0x22, 0x01, 0x3D },
1446 { 0x10, 0x10, 0x73, 0x01, 0x2E },
1447 { 0x10, 0x10, 0x72, 0x00, 0xC5 },
1448 { 0x10, 0x10, 0x71, 0x01, 0x97 },
1449 { 0x10, 0x10, 0x70, 0x00, 0x0F },
1450 { 0x10, 0x10, 0xB0, 0x00, 0x01 },
1451 { 0x03, 0x0C },
1452 };
1453
1454 for (i = 0; i < 13; i++) {
1455 msg.buf = init_bufs[i];
1456 msg.len = (i != 12 ? 5 : 2);
1457 err = i2c_transfer(&core->i2c_adap, &msg, 1);
1458 if (err != 1) {
1459 printk("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", i, err);
1460 return;
1461 }
1462 }
1463}
1464
1465/* ----------------------------------------------------------------------- */
1403 1466
1404void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) 1467void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1405{ 1468{
@@ -1465,11 +1528,15 @@ void cx88_card_setup(struct cx88_core *core)
1465 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 1528 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
1466 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 1529 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
1467 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: 1530 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
1531 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
1468 /* GPIO0:0 is hooked to mt352 reset pin */ 1532 /* GPIO0:0 is hooked to mt352 reset pin */
1469 cx_set(MO_GP0_IO, 0x00000101); 1533 cx_set(MO_GP0_IO, 0x00000101);
1470 cx_clear(MO_GP0_IO, 0x00000001); 1534 cx_clear(MO_GP0_IO, 0x00000001);
1471 msleep(1); 1535 msleep(1);
1472 cx_set(MO_GP0_IO, 0x00000101); 1536 cx_set(MO_GP0_IO, 0x00000101);
1537 if (0 == core->i2c_rc &&
1538 core->board == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
1539 dvico_fusionhdtv_hybrid_init(core);
1473 break; 1540 break;
1474 case CX88_BOARD_KWORLD_DVB_T: 1541 case CX88_BOARD_KWORLD_DVB_T:
1475 case CX88_BOARD_DNTV_LIVE_DVB_T: 1542 case CX88_BOARD_DNTV_LIVE_DVB_T:
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index e48aa3f6e500..2c97d3f7101a 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -40,6 +40,9 @@
40# include "cx88-vp3054-i2c.h" 40# include "cx88-vp3054-i2c.h"
41# endif 41# endif
42#endif 42#endif
43#ifdef HAVE_ZL10353
44# include "zl10353.h"
45#endif
43#ifdef HAVE_CX22702 46#ifdef HAVE_CX22702
44# include "cx22702.h" 47# include "cx22702.h"
45#endif 48#endif
@@ -111,6 +114,21 @@ static struct videobuf_queue_ops dvb_qops = {
111 114
112/* ------------------------------------------------------------------ */ 115/* ------------------------------------------------------------------ */
113 116
117#if defined(HAVE_MT352) || defined(HAVE_ZL10353)
118static int zarlink_pll_set(struct dvb_frontend *fe,
119 struct dvb_frontend_parameters *params,
120 u8 *pllbuf)
121{
122 struct cx8802_dev *dev = fe->dvb->priv;
123
124 pllbuf[0] = dev->core->pll_addr << 1;
125 dvb_pll_configure(dev->core->pll_desc, pllbuf + 1,
126 params->frequency,
127 params->u.ofdm.bandwidth);
128 return 0;
129}
130#endif
131
114#ifdef HAVE_MT352 132#ifdef HAVE_MT352
115static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) 133static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
116{ 134{
@@ -176,35 +194,22 @@ static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe)
176 return 0; 194 return 0;
177} 195}
178 196
179static int mt352_pll_set(struct dvb_frontend* fe,
180 struct dvb_frontend_parameters* params,
181 u8* pllbuf)
182{
183 struct cx8802_dev *dev= fe->dvb->priv;
184
185 pllbuf[0] = dev->core->pll_addr << 1;
186 dvb_pll_configure(dev->core->pll_desc, pllbuf+1,
187 params->frequency,
188 params->u.ofdm.bandwidth);
189 return 0;
190}
191
192static struct mt352_config dvico_fusionhdtv = { 197static struct mt352_config dvico_fusionhdtv = {
193 .demod_address = 0x0F, 198 .demod_address = 0x0F,
194 .demod_init = dvico_fusionhdtv_demod_init, 199 .demod_init = dvico_fusionhdtv_demod_init,
195 .pll_set = mt352_pll_set, 200 .pll_set = zarlink_pll_set,
196}; 201};
197 202
198static struct mt352_config dntv_live_dvbt_config = { 203static struct mt352_config dntv_live_dvbt_config = {
199 .demod_address = 0x0f, 204 .demod_address = 0x0f,
200 .demod_init = dntv_live_dvbt_demod_init, 205 .demod_init = dntv_live_dvbt_demod_init,
201 .pll_set = mt352_pll_set, 206 .pll_set = zarlink_pll_set,
202}; 207};
203 208
204static struct mt352_config dvico_fusionhdtv_dual = { 209static struct mt352_config dvico_fusionhdtv_dual = {
205 .demod_address = 0x0F, 210 .demod_address = 0x0F,
206 .demod_init = dvico_dual_demod_init, 211 .demod_init = dvico_dual_demod_init,
207 .pll_set = mt352_pll_set, 212 .pll_set = zarlink_pll_set,
208}; 213};
209 214
210#ifdef HAVE_VP3054_I2C 215#ifdef HAVE_VP3054_I2C
@@ -294,6 +299,46 @@ static struct mt352_config dntv_live_dvbt_pro_config = {
294#endif 299#endif
295#endif 300#endif
296 301
302#ifdef HAVE_ZL10353
303static int dvico_hybrid_tune_pll(struct dvb_frontend *fe,
304 struct dvb_frontend_parameters *params,
305 u8 *pllbuf)
306{
307 struct cx8802_dev *dev= fe->dvb->priv;
308 struct i2c_msg msg =
309 { .addr = dev->core->pll_addr, .flags = 0,
310 .buf = pllbuf + 1, .len = 4 };
311 int err;
312
313 pllbuf[0] = dev->core->pll_addr << 1;
314 dvb_pll_configure(dev->core->pll_desc, pllbuf + 1,
315 params->frequency,
316 params->u.ofdm.bandwidth);
317
318 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
319 printk(KERN_WARNING "cx88-dvb: %s error "
320 "(addr %02x <- %02x, err = %i)\n",
321 __FUNCTION__, pllbuf[0], pllbuf[1], err);
322 if (err < 0)
323 return err;
324 else
325 return -EREMOTEIO;
326 }
327
328 return 0;
329}
330
331static struct zl10353_config dvico_fusionhdtv_hybrid = {
332 .demod_address = 0x0F,
333 .pll_set = dvico_hybrid_tune_pll,
334};
335
336static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = {
337 .demod_address = 0x0F,
338 .pll_set = zarlink_pll_set,
339};
340#endif
341
297#ifdef HAVE_CX22702 342#ifdef HAVE_CX22702
298static struct cx22702_config connexant_refboard_config = { 343static struct cx22702_config connexant_refboard_config = {
299 .demod_address = 0x43, 344 .demod_address = 0x43,
@@ -500,16 +545,27 @@ static int dvb_register(struct cx8802_dev *dev)
500 &dev->core->i2c_adap); 545 &dev->core->i2c_adap);
501 break; 546 break;
502#endif 547#endif
548#if defined(HAVE_MT352) || defined(HAVE_ZL10353)
549 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
550 dev->core->pll_addr = 0x60;
551 dev->core->pll_desc = &dvb_pll_thomson_dtt7579;
503#ifdef HAVE_MT352 552#ifdef HAVE_MT352
504 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
505 dev->core->pll_addr = 0x61;
506 dev->core->pll_desc = &dvb_pll_lg_z201;
507 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, 553 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
508 &dev->core->i2c_adap); 554 &dev->core->i2c_adap);
555 if (dev->dvb.frontend != NULL)
556 break;
557#endif
558#ifdef HAVE_ZL10353
559 /* ZL10353 replaces MT352 on later cards */
560 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1,
561 &dev->core->i2c_adap);
562#endif
509 break; 563 break;
510 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 564#endif /* HAVE_MT352 || HAVE_ZL10353 */
511 dev->core->pll_addr = 0x60; 565#ifdef HAVE_MT352
512 dev->core->pll_desc = &dvb_pll_thomson_dtt7579; 566 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
567 dev->core->pll_addr = 0x61;
568 dev->core->pll_desc = &dvb_pll_lg_z201;
513 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, 569 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
514 &dev->core->i2c_adap); 570 &dev->core->i2c_adap);
515 break; 571 break;
@@ -540,6 +596,14 @@ static int dvb_register(struct cx8802_dev *dev)
540 &dev->core->i2c_adap); 596 &dev->core->i2c_adap);
541 break; 597 break;
542#endif 598#endif
599#ifdef HAVE_ZL10353
600 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
601 dev->core->pll_addr = 0x61;
602 dev->core->pll_desc = &dvb_pll_unknown_fe6600;
603 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid,
604 &dev->core->i2c_adap);
605 break;
606#endif
543#ifdef HAVE_OR51132 607#ifdef HAVE_OR51132
544 case CX88_BOARD_PCHDTV_HD3000: 608 case CX88_BOARD_PCHDTV_HD3000:
545 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000, 609 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000,
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index a4cf2473eacf..21738b664bc9 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -189,6 +189,7 @@ extern struct sram_channel cx88_sram_channels[];
189#define CX88_BOARD_KWORLD_DVB_T_CX22702 43 189#define CX88_BOARD_KWORLD_DVB_T_CX22702 43
190#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL 44 190#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL 44
191#define CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT 45 191#define CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT 45
192#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID 46
192 193
193enum cx88_itype { 194enum cx88_itype {
194 CX88_VMUX_COMPOSITE1 = 1, 195 CX88_VMUX_COMPOSITE1 = 1,
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c
index 15761dd8607d..d10cfd400f2b 100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
@@ -983,6 +983,22 @@ static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = {
983 }, 983 },
984}; 984};
985 985
986/* ------------ TUNER_FE6600 - DViCO Hybrid PAL ------------ */
987
988static struct tuner_range tuner_fe6600_ranges[] = {
989 { 16 * 160.00 /*MHz*/, 0xfe, 0x11, },
990 { 16 * 442.00 /*MHz*/, 0xf6, 0x12, },
991 { 16 * 999.99 , 0xf6, 0x18, },
992};
993
994static struct tuner_params tuner_fe6600_params[] = {
995 {
996 .type = TUNER_PARAM_TYPE_PAL,
997 .ranges = tuner_fe6600_ranges,
998 .count = ARRAY_SIZE(tuner_fe6600_ranges),
999 },
1000};
1001
986/* --------------------------------------------------------------------- */ 1002/* --------------------------------------------------------------------- */
987 1003
988struct tunertype tuners[] = { 1004struct tunertype tuners[] = {
@@ -1354,6 +1370,10 @@ struct tunertype tuners[] = {
1354 .name = "Xceive xc3028", 1370 .name = "Xceive xc3028",
1355 /* see xc3028.c for details */ 1371 /* see xc3028.c for details */
1356 }, 1372 },
1373 [TUNER_FE6600] = { /* */
1374 .name = "FE6600",
1375 .params = tuner_fe6600_params,
1376 },
1357}; 1377};
1358 1378
1359unsigned const int tuner_count = ARRAY_SIZE(tuners); 1379unsigned const int tuner_count = ARRAY_SIZE(tuners);
diff --git a/include/media/tuner.h b/include/media/tuner.h
index f51759c0d180..039c77e02d34 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -116,9 +116,10 @@
116#define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ 116#define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */
117#define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ 117#define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */
118#define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */ 118#define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */
119
120#define TUNER_XCEIVE_XC3028 71 119#define TUNER_XCEIVE_XC3028 71
121 120
121#define TUNER_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */
122
122/* tv card specific */ 123/* tv card specific */
123#define TDA9887_PRESENT (1<<0) 124#define TDA9887_PRESENT (1<<0)
124#define TDA9887_PORT1_INACTIVE (1<<1) 125#define TDA9887_PORT1_INACTIVE (1<<1)