[DVB patch 08/48] ves1x93: invert_pwm fix

Johannes Stezenbach
2005-03-22T02:21:34Z

[-- Attachment #1: dvb-frontends-ves1x93-invert-pwm.patch --]
[-- Type: text/plain, Size: 1317 bytes --]

fix unhandled invert_pwm option (needed on dbox2 hardware)
submitted by Carsten Juttner

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

ves1x93.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)

Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/frontends/ves1x93.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/frontends/ves1x93.c 2005-03-21 23:27:59.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/frontends/ves1x93.c 2005-03-22 00:15:00.000000000 +0100
@@ -175,7 +175,7 @@ static int ves1x93_set_symbolrate (struc
{
u32 BDR;
u32 ratio;
- u8 ADCONF, FCONF, FNR;
+ u8 ADCONF, FCONF, FNR, AGCR;
u32 BDRI;
u32 tmp;
u32 FIN;
@@ -243,10 +243,16 @@ static int ves1x93_set_symbolrate (struc
ves1x93_writereg (state, 0x20, ADCONF);
ves1x93_writereg (state, 0x21, FCONF);

+ AGCR = state->init_1x93_tab[0x05];
+ if (state->config->invert_pwm)
+ AGCR |= 0x20;
+
if (srate < 6000000)
- ves1x93_writereg (state, 0x05, state->init_1x93_tab[0x05] | 0x80);
+ AGCR |= 0x80;
else
- ves1x93_writereg (state, 0x05, state->init_1x93_tab[0x05] & 0x7f);
+ AGCR &= ~0x80;
+
+ ves1x93_writereg (state, 0x05, AGCR);

/* ves1993 hates this, will lose lock */
if (state->demod_type != DEMOD_VES1993)

--