diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-12-13 08:04:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:03:44 -0500 |
commit | 2b03238a79295aff30afc3d9a82afa617fd33971 (patch) | |
tree | b0fbd55c5a2a9c7543d4dde925ef8be8233e4d82 /drivers/media | |
parent | 18ff605a18b29ab1b52d31f96e2ecbaf7a042a3e (diff) |
V4L/DVB (6821): s5h1409: fix IF frequency configuration
On the s5h1409 demod, the IF frequency for VSB is limited to 44 / 5.38 MHz.
Hardcode VSB IF frequency within the driver to 44 / 5.38 MHz.
QAM IF frequency remains configurable via attach-time configuration.
Acked-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/s5h1409.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/s5h1409.h | 4 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 4 |
3 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index 562d9208857a..b80a3ee91ba4 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c | |||
@@ -42,6 +42,7 @@ struct s5h1409_state { | |||
42 | fe_modulation_t current_modulation; | 42 | fe_modulation_t current_modulation; |
43 | 43 | ||
44 | u32 current_frequency; | 44 | u32 current_frequency; |
45 | int if_freq; | ||
45 | 46 | ||
46 | u32 is_qam_locked; | 47 | u32 is_qam_locked; |
47 | u32 qam_state; | 48 | u32 qam_state; |
@@ -348,6 +349,9 @@ static int s5h1409_softreset(struct dvb_frontend* fe) | |||
348 | return 0; | 349 | return 0; |
349 | } | 350 | } |
350 | 351 | ||
352 | #define S5H1409_VSB_IF_FREQ 5380 | ||
353 | #define S5H1409_QAM_IF_FREQ state->config->qam_if | ||
354 | |||
351 | static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz) | 355 | static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz) |
352 | { | 356 | { |
353 | struct s5h1409_state* state = fe->demodulator_priv; | 357 | struct s5h1409_state* state = fe->demodulator_priv; |
@@ -369,6 +373,9 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz) | |||
369 | ret = -1; | 373 | ret = -1; |
370 | } | 374 | } |
371 | 375 | ||
376 | if (0 == ret) | ||
377 | state->if_freq = KHz; | ||
378 | |||
372 | return ret; | 379 | return ret; |
373 | } | 380 | } |
374 | 381 | ||
@@ -394,11 +401,15 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe, | |||
394 | switch(m) { | 401 | switch(m) { |
395 | case VSB_8: | 402 | case VSB_8: |
396 | dprintk("%s() VSB_8\n", __FUNCTION__); | 403 | dprintk("%s() VSB_8\n", __FUNCTION__); |
404 | if (state->if_freq != S5H1409_VSB_IF_FREQ) | ||
405 | s5h1409_set_if_freq(fe, S5H1409_VSB_IF_FREQ); | ||
397 | s5h1409_writereg(state, 0xf4, 0); | 406 | s5h1409_writereg(state, 0xf4, 0); |
398 | break; | 407 | break; |
399 | case QAM_64: | 408 | case QAM_64: |
400 | case QAM_256: | 409 | case QAM_256: |
401 | dprintk("%s() QAM_AUTO (64/256)\n", __FUNCTION__); | 410 | dprintk("%s() QAM_AUTO (64/256)\n", __FUNCTION__); |
411 | if (state->if_freq != S5H1409_QAM_IF_FREQ) | ||
412 | s5h1409_set_if_freq(fe, S5H1409_QAM_IF_FREQ); | ||
402 | s5h1409_writereg(state, 0xf4, 1); | 413 | s5h1409_writereg(state, 0xf4, 1); |
403 | s5h1409_writereg(state, 0x85, 0x110); | 414 | s5h1409_writereg(state, 0x85, 0x110); |
404 | break; | 415 | break; |
@@ -571,7 +582,7 @@ static int s5h1409_init (struct dvb_frontend* fe) | |||
571 | s5h1409_writereg(state, 0xab, 0x0); /* Parallel */ | 582 | s5h1409_writereg(state, 0xab, 0x0); /* Parallel */ |
572 | 583 | ||
573 | s5h1409_set_spectralinversion(fe, state->config->inversion); | 584 | s5h1409_set_spectralinversion(fe, state->config->inversion); |
574 | s5h1409_set_if_freq(fe, state->config->if_freq); | 585 | s5h1409_set_if_freq(fe, state->if_freq); |
575 | s5h1409_set_gpio(fe, state->config->gpio); | 586 | s5h1409_set_gpio(fe, state->config->gpio); |
576 | s5h1409_softreset(fe); | 587 | s5h1409_softreset(fe); |
577 | 588 | ||
@@ -751,6 +762,7 @@ struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, | |||
751 | state->config = config; | 762 | state->config = config; |
752 | state->i2c = i2c; | 763 | state->i2c = i2c; |
753 | state->current_modulation = 0; | 764 | state->current_modulation = 0; |
765 | state->if_freq = S5H1409_VSB_IF_FREQ; | ||
754 | 766 | ||
755 | /* check if the demod exists */ | 767 | /* check if the demod exists */ |
756 | if (s5h1409_readreg(state, 0x04) != 0x0066) | 768 | if (s5h1409_readreg(state, 0x04) != 0x0066) |
diff --git a/drivers/media/dvb/frontends/s5h1409.h b/drivers/media/dvb/frontends/s5h1409.h index 20f9af1af445..b1f433906664 100644 --- a/drivers/media/dvb/frontends/s5h1409.h +++ b/drivers/media/dvb/frontends/s5h1409.h | |||
@@ -39,8 +39,8 @@ struct s5h1409_config | |||
39 | #define S5H1409_GPIO_ON 1 | 39 | #define S5H1409_GPIO_ON 1 |
40 | u8 gpio; | 40 | u8 gpio; |
41 | 41 | ||
42 | /* IF Freq in KHz */ | 42 | /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */ |
43 | u16 if_freq; | 43 | u16 qam_if; |
44 | 44 | ||
45 | /* Spectral Inversion */ | 45 | /* Spectral Inversion */ |
46 | #define S5H1409_INVERSION_OFF 0 | 46 | #define S5H1409_INVERSION_OFF 0 |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index eda8c05d0931..96d732098a0d 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -85,7 +85,7 @@ static struct s5h1409_config hauppauge_generic_config = { | |||
85 | .demod_address = 0x32 >> 1, | 85 | .demod_address = 0x32 >> 1, |
86 | .output_mode = S5H1409_SERIAL_OUTPUT, | 86 | .output_mode = S5H1409_SERIAL_OUTPUT, |
87 | .gpio = S5H1409_GPIO_ON, | 87 | .gpio = S5H1409_GPIO_ON, |
88 | .if_freq = 44000, | 88 | .qam_if = 44000, |
89 | .inversion = S5H1409_INVERSION_OFF, | 89 | .inversion = S5H1409_INVERSION_OFF, |
90 | .status_mode = S5H1409_DEMODLOCKING | 90 | .status_mode = S5H1409_DEMODLOCKING |
91 | }; | 91 | }; |
@@ -94,7 +94,7 @@ static struct s5h1409_config hauppauge_hvr1800lp_config = { | |||
94 | .demod_address = 0x32 >> 1, | 94 | .demod_address = 0x32 >> 1, |
95 | .output_mode = S5H1409_SERIAL_OUTPUT, | 95 | .output_mode = S5H1409_SERIAL_OUTPUT, |
96 | .gpio = S5H1409_GPIO_OFF, | 96 | .gpio = S5H1409_GPIO_OFF, |
97 | .if_freq = 44000, | 97 | .qam_if = 44000, |
98 | .inversion = S5H1409_INVERSION_OFF, | 98 | .inversion = S5H1409_INVERSION_OFF, |
99 | .status_mode = S5H1409_DEMODLOCKING | 99 | .status_mode = S5H1409_DEMODLOCKING |
100 | }; | 100 | }; |