Commit d807dec5 authored by Tobias Lorenz's avatar Tobias Lorenz Committed by Mauro Carvalho Chehab

V4L/DVB (10532): Correction of Stereo detection/setting and signal strength indication

Thanks to Bob Ross <pigiron@gmx.com>
- correction of stereo detection/setting
- correction of signal strength indicator scaling
Signed-off-by: default avatarTobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ef88f2b5
...@@ -98,6 +98,9 @@ ...@@ -98,6 +98,9 @@
* - blacklisted KWorld radio in hid-core.c and hid-ids.h * - blacklisted KWorld radio in hid-core.c and hid-ids.h
* 2008-12-03 Mark Lord <mlord@pobox.com> * 2008-12-03 Mark Lord <mlord@pobox.com>
* - add support for DealExtreme USB Radio * - 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: * ToDo:
* - add firmware download/update support * - add firmware download/update support
...@@ -1385,20 +1388,22 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, ...@@ -1385,20 +1388,22 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
}; };
/* stereo indicator == stereo (instead of mono) */ /* stereo indicator == stereo (instead of mono) */
if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 1) if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 0)
tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
else
tuner->rxsubchans = V4L2_TUNER_SUB_MONO; tuner->rxsubchans = V4L2_TUNER_SUB_MONO;
else
tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
/* mono/stereo selector */ /* mono/stereo selector */
if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 1) if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
tuner->audmode = V4L2_TUNER_MODE_MONO;
else
tuner->audmode = V4L2_TUNER_MODE_STEREO; 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 */ /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */
tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI) /* measured in units of dbµV in 1 db increments (max at ~75 dbµV) */
* 0x0101; 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 */ /* automatic frequency control: -1: freq to low, 1 freq to high */
/* AFCRL does only indicate that freq. differs, not if too low/high */ /* AFCRL does only indicate that freq. differs, not if too low/high */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment