summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-03-17 22:30:38 +0000
committerHolger Waechtler <devnull@localhost>2003-03-17 22:30:38 +0000
commit8ac97ecd30f3566bd4d477f32aa41068e3fa1d85 (patch)
tree56ffcc5855ea8bd493794b36461256d3c2b79de1 /linux/drivers
parente8d4556487e26de17f3ce4885943a8530db1b9b9 (diff)
downloadmediapointer-dvb-s2-8ac97ecd30f3566bd4d477f32aa41068e3fa1d85.tar.gz
mediapointer-dvb-s2-8ac97ecd30f3566bd4d477f32aa41068e3fa1d85.tar.bz2
set the power bits according to the Alps spec, reported by Ragnar Sundblad <ragge@nada.kth.se>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/frontends/alps_tdlb7.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/frontends/alps_tdlb7.c b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
index 47b480a9c..dbc93ff56 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdlb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
@@ -141,10 +141,21 @@ int sp5659_write (struct dvb_i2c_bus *i2c, u8 data [4])
static
-int sp5659_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq, u8 pwr)
+int sp5659_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
{
u32 div = (freq + 36200000) / 166666;
- u8 buf [4] = { (div >> 8) & 0x7f, div & 0xff, 0x85, (pwr << 6)};
+ u8 buf [4];
+ int pwr;
+
+ if (freq <= 782000000)
+ pwr = 1;
+ else
+ pwr = 2;
+
+ buf[0] = (div >> 8) & 0x7f;
+ buf[1] = div & 0xff;
+ buf[2] = 0x85;
+ buf[3] = pwr << 6;
return sp5659_write (i2c, buf);
}
@@ -345,9 +356,9 @@ int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
// system controller stop
sp8870_writereg(i2c,0x0F00,0x0000);
-
- sp5659_set_tv_freq (i2c, p->frequency, 0);
-
+
+ sp5659_set_tv_freq (i2c, p->frequency);
+
// sample rate correction bit [23..17]
sp8870_writereg(i2c,0x0319,0x000A);