summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
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__);
}