aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-04-22 14:38:26 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:45 -0400
commit6676237398d0c2e61e5a3a27e0951f60d6ef6fe3 (patch)
treea28bd067f19c707b6658a1526a3984b16a0ea9e4
parenta38d6e37c0bc073bae5eff37c939978974ea9712 (diff)
V4L/DVB (7673): cx23885: Add support for the Hauppauge HVR1400
DVB-T mode is now supported using the DiBcom dib7000p demodulator and the Xceive xc3028L silicon tuner. Analog mode is not supported. Signed-off-by: Steven Toth <stoth@hauppauge.com> Reviewed-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--Documentation/video4linux/CARDLIST.cx238851
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c26
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c113
-rw-r--r--drivers/media/video/cx23885/cx23885-i2c.c4
-rw-r--r--drivers/media/video/cx23885/cx23885.h1
5 files changed, 144 insertions, 1 deletions
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index b057a3c9f8f..929b90c8387 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -7,3 +7,4 @@
7 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717] 7 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717]
8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1] 8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1]
9 8 -> Hauppauge WinTV-HVR1700 [0070:8101] 9 8 -> Hauppauge WinTV-HVR1700 [0070:8101]
10 9 -> Hauppauge WinTV-HVR1400 [0070:8010]
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index 859510f7469..0f4b325f2d8 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -138,6 +138,10 @@ struct cx23885_board cx23885_boards[] = {
138 .name = "Hauppauge WinTV-HVR1700", 138 .name = "Hauppauge WinTV-HVR1700",
139 .portc = CX23885_MPEG_DVB, 139 .portc = CX23885_MPEG_DVB,
140 }, 140 },
141 [CX23885_BOARD_HAUPPAUGE_HVR1400] = {
142 .name = "Hauppauge WinTV-HVR1400",
143 .portc = CX23885_MPEG_DVB,
144 },
141}; 145};
142const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); 146const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
143 147
@@ -197,6 +201,10 @@ struct cx23885_subid cx23885_subids[] = {
197 .subvendor = 0x0070, 201 .subvendor = 0x0070,
198 .subdevice = 0x8101, 202 .subdevice = 0x8101,
199 .card = CX23885_BOARD_HAUPPAUGE_HVR1700, 203 .card = CX23885_BOARD_HAUPPAUGE_HVR1700,
204 }, {
205 .subvendor = 0x0070,
206 .subdevice = 0x8010,
207 .card = CX23885_BOARD_HAUPPAUGE_HVR1400,
200 }, 208 },
201}; 209};
202const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); 210const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -251,6 +259,9 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
251 case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ 259 case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
252 case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ 260 case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */
253 case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ 261 case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
262 case 80019:
263 /* WinTV-HVR1400 (Express Card, Retail, IR,
264 * DVB-T and Basic analog */
254 case 81519: 265 case 81519:
255 /* WinTV-HVR1700 (PCIe, Retail, No IR, half height, 266 /* WinTV-HVR1700 (PCIe, Retail, No IR, half height,
256 * DVB-T and MPEG2 HW Encoder */ 267 * DVB-T and MPEG2 HW Encoder */
@@ -365,6 +376,18 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
365 mdelay(20); 376 mdelay(20);
366 cx_set(GP0_IO, 0x00050005); 377 cx_set(GP0_IO, 0x00050005);
367 break; 378 break;
379 case CX23885_BOARD_HAUPPAUGE_HVR1400:
380 /* GPIO-0 Dibcom7000p demodulator reset */
381 /* GPIO-2 xc3028L tuner reset */
382 /* GPIO-13 LED */
383
384 /* Put the parts into reset and back */
385 cx_set(GP0_IO, 0x00050000);
386 mdelay(20);
387 cx_clear(GP0_IO, 0x00000005);
388 mdelay(20);
389 cx_set(GP0_IO, 0x00050005);
390 break;
368 } 391 }
369} 392}
370 393
@@ -376,6 +399,7 @@ int cx23885_ir_init(struct cx23885_dev *dev)
376 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 399 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
377 case CX23885_BOARD_HAUPPAUGE_HVR1800: 400 case CX23885_BOARD_HAUPPAUGE_HVR1800:
378 case CX23885_BOARD_HAUPPAUGE_HVR1200: 401 case CX23885_BOARD_HAUPPAUGE_HVR1200:
402 case CX23885_BOARD_HAUPPAUGE_HVR1400:
379 /* FIXME: Implement me */ 403 /* FIXME: Implement me */
380 break; 404 break;
381 } 405 }
@@ -400,6 +424,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
400 case CX23885_BOARD_HAUPPAUGE_HVR1250: 424 case CX23885_BOARD_HAUPPAUGE_HVR1250:
401 case CX23885_BOARD_HAUPPAUGE_HVR1500: 425 case CX23885_BOARD_HAUPPAUGE_HVR1500:
402 case CX23885_BOARD_HAUPPAUGE_HVR1500Q: 426 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
427 case CX23885_BOARD_HAUPPAUGE_HVR1400:
403 if (dev->i2c_bus[0].i2c_rc == 0) 428 if (dev->i2c_bus[0].i2c_rc == 0)
404 hauppauge_eeprom(dev, eeprom+0x80); 429 hauppauge_eeprom(dev, eeprom+0x80);
405 break; 430 break;
@@ -425,6 +450,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
425 case CX23885_BOARD_HAUPPAUGE_HVR1800lp: 450 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
426 case CX23885_BOARD_HAUPPAUGE_HVR1200: 451 case CX23885_BOARD_HAUPPAUGE_HVR1200:
427 case CX23885_BOARD_HAUPPAUGE_HVR1700: 452 case CX23885_BOARD_HAUPPAUGE_HVR1700:
453 case CX23885_BOARD_HAUPPAUGE_HVR1400:
428 default: 454 default:
429 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */ 455 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
430 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ 456 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 1b9a85e43d4..870d6e197d6 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -40,6 +40,8 @@
40#include "dvb-pll.h" 40#include "dvb-pll.h"
41#include "tuner-xc2028.h" 41#include "tuner-xc2028.h"
42#include "tuner-simple.h" 42#include "tuner-simple.h"
43#include "dib7000p.h"
44#include "dibx000_common.h"
43 45
44static unsigned int debug; 46static unsigned int debug;
45 47
@@ -189,6 +191,92 @@ static struct tda18271_config hauppauge_hvr1200_tuner_config = {
189 .gate = TDA18271_GATE_ANALOG, 191 .gate = TDA18271_GATE_ANALOG,
190}; 192};
191 193
194struct dibx000_agc_config xc3028_agc_config = {
195 BAND_VHF | BAND_UHF, /* band_caps */
196
197 /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0,
198 * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
199 * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0,
200 * P_agc_nb_est=2, P_agc_write=0
201 */
202 (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) |
203 (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */
204
205 712, /* inv_gain */
206 21, /* time_stabiliz */
207
208 0, /* alpha_level */
209 118, /* thlock */
210
211 0, /* wbd_inv */
212 2867, /* wbd_ref */
213 0, /* wbd_sel */
214 2, /* wbd_alpha */
215
216 0, /* agc1_max */
217 0, /* agc1_min */
218 39718, /* agc2_max */
219 9930, /* agc2_min */
220 0, /* agc1_pt1 */
221 0, /* agc1_pt2 */
222 0, /* agc1_pt3 */
223 0, /* agc1_slope1 */
224 0, /* agc1_slope2 */
225 0, /* agc2_pt1 */
226 128, /* agc2_pt2 */
227 29, /* agc2_slope1 */
228 29, /* agc2_slope2 */
229
230 17, /* alpha_mant */
231 27, /* alpha_exp */
232 23, /* beta_mant */
233 51, /* beta_exp */
234
235 1, /* perform_agc_softsplit */
236};
237
238/* PLL Configuration for COFDM BW_MHz = 8.000000
239 * With external clock = 30.000000 */
240struct dibx000_bandwidth_config xc3028_bw_config = {
241 60000, /* internal */
242 30000, /* sampling */
243 1, /* pll_cfg: prediv */
244 8, /* pll_cfg: ratio */
245 3, /* pll_cfg: range */
246 1, /* pll_cfg: reset */
247 0, /* pll_cfg: bypass */
248 0, /* misc: refdiv */
249 0, /* misc: bypclk_div */
250 1, /* misc: IO_CLK_en_core */
251 1, /* misc: ADClkSrc */
252 0, /* misc: modulo */
253 (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */
254 (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */
255 20452225, /* timf */
256 30000000 /* xtal_hz */
257};
258
259static struct dib7000p_config hauppauge_hvr1400_dib7000_config = {
260 .output_mpeg2_in_188_bytes = 1,
261 .hostbus_diversity = 1,
262 .tuner_is_baseband = 0,
263 .update_lna = NULL,
264
265 .agc_config_count = 1,
266 .agc = &xc3028_agc_config,
267 .bw = &xc3028_bw_config,
268
269 .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS,
270 .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES,
271 .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS,
272
273 .pwm_freq_div = 0,
274 .agc_control = NULL,
275 .spur_protect = 0,
276
277 .output_mode = OUTMODE_MPEG2_SERIAL,
278};
279
192static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) 280static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg)
193{ 281{
194 struct cx23885_tsport *port = ptr; 282 struct cx23885_tsport *port = ptr;
@@ -343,6 +431,31 @@ static int dvb_register(struct cx23885_tsport *port)
343 &hauppauge_hvr1200_tuner_config); 431 &hauppauge_hvr1200_tuner_config);
344 } 432 }
345 break; 433 break;
434 case CX23885_BOARD_HAUPPAUGE_HVR1400:
435 i2c_bus = &dev->i2c_bus[0];
436 port->dvb.frontend = dvb_attach(dib7000p_attach,
437 &i2c_bus->i2c_adap,
438 0x12, &hauppauge_hvr1400_dib7000_config);
439 if (port->dvb.frontend != NULL) {
440 struct dvb_frontend *fe;
441 struct xc2028_config cfg = {
442 .i2c_adap = &dev->i2c_bus[1].i2c_adap,
443 .i2c_addr = 0x64,
444 .callback = cx23885_hvr1500_xc3028_callback,
445 };
446 static struct xc2028_ctrl ctl = {
447 .fname = "xc3028L-v36.fw",
448 .max_len = 64,
449 .demod = 5000,
450 .d2633 = 1
451 };
452
453 fe = dvb_attach(xc2028_attach,
454 port->dvb.frontend, &cfg);
455 if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
456 fe->ops.tuner_ops.set_config(fe, &ctl);
457 }
458 break;
346 default: 459 default:
347 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", 460 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
348 dev->name); 461 dev->name);
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c
index 85f9d5ef17d..3928945df5f 100644
--- a/drivers/media/video/cx23885/cx23885-i2c.c
+++ b/drivers/media/video/cx23885/cx23885-i2c.c
@@ -354,6 +354,7 @@ static struct i2c_client cx23885_i2c_client_template = {
354 354
355static char *i2c_devs[128] = { 355static char *i2c_devs[128] = {
356 [0x10 >> 1] = "tda10048", 356 [0x10 >> 1] = "tda10048",
357 [0x12 >> 1] = "dib7000pc",
357 [ 0x1c >> 1 ] = "lgdt3303", 358 [ 0x1c >> 1 ] = "lgdt3303",
358 [ 0x86 >> 1 ] = "tda9887", 359 [ 0x86 >> 1 ] = "tda9887",
359 [ 0x32 >> 1 ] = "cx24227", 360 [ 0x32 >> 1 ] = "cx24227",
@@ -361,7 +362,8 @@ static char *i2c_devs[128] = {
361 [ 0x84 >> 1 ] = "tda8295", 362 [ 0x84 >> 1 ] = "tda8295",
362 [ 0xa0 >> 1 ] = "eeprom", 363 [ 0xa0 >> 1 ] = "eeprom",
363 [ 0xc0 >> 1 ] = "tuner/mt2131/tda8275", 364 [ 0xc0 >> 1 ] = "tuner/mt2131/tda8275",
364 [ 0xc2 >> 1 ] = "tuner/mt2131/tda8275/xc5000", 365 [0xc2 >> 1] = "tuner/mt2131/tda8275/xc5000/xc3028",
366 [0xc8 >> 1] = "tuner/xc3028L",
365}; 367};
366 368
367static void do_i2c_scan(char *name, struct i2c_client *c) 369static void do_i2c_scan(char *name, struct i2c_client *c)
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h
index c5496e08c94..3705e6019ce 100644
--- a/drivers/media/video/cx23885/cx23885.h
+++ b/drivers/media/video/cx23885/cx23885.h
@@ -61,6 +61,7 @@
61#define CX23885_BOARD_HAUPPAUGE_HVR1500 6 61#define CX23885_BOARD_HAUPPAUGE_HVR1500 6
62#define CX23885_BOARD_HAUPPAUGE_HVR1200 7 62#define CX23885_BOARD_HAUPPAUGE_HVR1200 7
63#define CX23885_BOARD_HAUPPAUGE_HVR1700 8 63#define CX23885_BOARD_HAUPPAUGE_HVR1700 8
64#define CX23885_BOARD_HAUPPAUGE_HVR1400 9
64 65
65/* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */ 66/* Currently unsupported by the driver: PAL/H, NTSC/Kr, SECAM B/G/H/LC */
66#define CX23885_NORMS (\ 67#define CX23885_NORMS (\