summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2002-11-20 19:05:48 +0000
committerHolger Waechtler <devnull@localhost>2002-11-20 19:05:48 +0000
commit53c4b9cd3c7f3122090bf249005873ec11fd642f (patch)
tree8f19f14abb954c538d67b9581c31d1d2eed77d59 /linux/drivers/media/dvb
parent35c8ad22537cee1dd85f275ca04ccb5dcfc7cd33 (diff)
downloadmediapointer-dvb-s2-53c4b9cd3c7f3122090bf249005873ec11fd642f.tar.gz
mediapointer-dvb-s2-53c4b9cd3c7f3122090bf249005873ec11fd642f.tar.bz2
applied patch by Juergen Peitz <peitz@snafu.de>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/frontends/alps_tdlb7.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/frontends/alps_tdlb7.c b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
index 732fdffed..01369c615 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdlb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
@@ -269,6 +269,7 @@ int sp8870_reset (struct dvb_i2c_bus *i2c)
return 0;
}
+
static
int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
@@ -283,10 +284,10 @@ int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
fe_status_t *status = arg;
int sync = sp8870_readreg (i2c, 0x0200);
+ int signal = 0xff-sp8870_readreg (i2c, 0x303);
*status=0;
-
- if (sync&0x04) // FIXME: find criteria for having signal
+ if (signal>10) // FIXME: is 10 the right value ?
*status |= FE_HAS_SIGNAL;
if (sync&0x04) // FIXME: find criteria
@@ -312,10 +313,9 @@ int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
}
- case FE_READ_SIGNAL_STRENGTH: // not supported by hardware?
+ case FE_READ_SIGNAL_STRENGTH: // FIXME: correct registers ?
{
- s32 *signal=(s32 *) arg;
- *signal=0;
+ *((u16*) arg) = 0xffff-((sp8870_readreg (i2c, 0x306) << 8) | sp8870_readreg (i2c, 0x303));
break;
}
@@ -337,9 +337,8 @@ int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct dvb_frontend_parameters *p = arg;
sp5659_set_tv_freq (i2c, p->frequency, 0);
- // all other parameters are set by the on card
- // system controller. Don't know how to pass
- // distinct values to the card.
+ sp8870_reset (i2c); // reset default values and restart system controller
+ // parameters are calculated by system controller
break;
}
@@ -380,7 +379,7 @@ int tdlb7_attach (struct dvb_i2c_bus *i2c)
dprintk("%s: loading mcfile '%s' !\n", __FUNCTION__, mcfile);
if (sp8870_load_code(i2c)==0)
dprintk("%s: microcode loaded!\n", __FUNCTION__);
- } else {
+ }else{
dprintk("%s: without loading mcfile!\n", __FUNCTION__);
}