diff options
author | Tobias Lorenz <tobias.lorenz@gmx.net> | 2009-02-12 18:56:10 +0100 |
---|---|---|
committer | Tobias Lorenz <tobias.lorenz@gmx.net> | 2009-02-12 18:56:10 +0100 |
commit | 30db0e876957f7d463bc717f76c73b9e34aa9e92 (patch) | |
tree | 1734acf5955a2a3a3f24bdc6f7ae064f61b4865e /linux/drivers/media/radio/radio-si470x.c | |
parent | d0578265f7ee9cfe91ebb445d025f67987b7aaed (diff) | |
download | mediapointer-dvb-s2-30db0e876957f7d463bc717f76c73b9e34aa9e92.tar.gz mediapointer-dvb-s2-30db0e876957f7d463bc717f76c73b9e34aa9e92.tar.bz2 |
Correction of Stereo detection/setting and signal strength indication
From: Tobias Lorenz <tobias.lorenz@gmx.net>
Thanks to Bob Ross <pigiron@gmx.com>
- correction of stereo detection/setting
- correction of signal strength indicator scaling
Priority: normal
Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Diffstat (limited to 'linux/drivers/media/radio/radio-si470x.c')
-rw-r--r-- | linux/drivers/media/radio/radio-si470x.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/linux/drivers/media/radio/radio-si470x.c b/linux/drivers/media/radio/radio-si470x.c index 49317f91f..d211d5176 100644 --- a/linux/drivers/media/radio/radio-si470x.c +++ b/linux/drivers/media/radio/radio-si470x.c @@ -99,6 +99,9 @@ * - blacklisted KWorld radio in hid-core.c and hid-ids.h * 2008-12-03 Mark Lord <mlord@pobox.com> * - add support for DealExtreme USB Radio + * 2009-01-31 Bob Ross <pigiron@gmx.com> + * - correction of stereo detection/setting + * - correction of signal strength indicator scaling * * ToDo: * - add firmware download/update support @@ -1405,20 +1408,22 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, }; /* stereo indicator == stereo (instead of mono) */ - if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 1) - tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; - else + if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 0) tuner->rxsubchans = V4L2_TUNER_SUB_MONO; + else + tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; /* mono/stereo selector */ - if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 1) - tuner->audmode = V4L2_TUNER_MODE_MONO; - else + if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0) tuner->audmode = V4L2_TUNER_MODE_STEREO; + else + tuner->audmode = V4L2_TUNER_MODE_MONO; /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */ - tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI) - * 0x0101; + /* measured in units of dbµV in 1 db increments (max at ~75 dbµV) */ + tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI); + /* the ideal factor is 0xffff/75 = 873,8 */ + tuner->signal = (tuner->signal * 873) + (8 * tuner->signal / 10); /* automatic frequency control: -1: freq to low, 1 freq to high */ /* AFCRL does only indicate that freq. differs, not if too low/high */ |