aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTobias Lorenz <tobias.lorenz@gmx.net>2009-02-12 12:56:10 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-02-17 07:43:09 -0500
commitd807dec59d3c850b332b5bf95fe33f18def00068 (patch)
tree4f40e2b7d5d3a8b31534288daa9165158e52eba0 /drivers/media
parentef88f2b563275d156beebc9f76ed134f3f90f210 (diff)
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: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/radio-si470x.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 67cbce82cb91..fd81a97a0fdb 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -98,6 +98,9 @@
98 * - blacklisted KWorld radio in hid-core.c and hid-ids.h 98 * - blacklisted KWorld radio in hid-core.c and hid-ids.h
99 * 2008-12-03 Mark Lord <mlord@pobox.com> 99 * 2008-12-03 Mark Lord <mlord@pobox.com>
100 * - add support for DealExtreme USB Radio 100 * - add support for DealExtreme USB Radio
101 * 2009-01-31 Bob Ross <pigiron@gmx.com>
102 * - correction of stereo detection/setting
103 * - correction of signal strength indicator scaling
101 * 104 *
102 * ToDo: 105 * ToDo:
103 * - add firmware download/update support 106 * - add firmware download/update support
@@ -1385,20 +1388,22 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
1385 }; 1388 };
1386 1389
1387 /* stereo indicator == stereo (instead of mono) */ 1390 /* stereo indicator == stereo (instead of mono) */
1388 if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 1) 1391 if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 0)
1389 tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
1390 else
1391 tuner->rxsubchans = V4L2_TUNER_SUB_MONO; 1392 tuner->rxsubchans = V4L2_TUNER_SUB_MONO;
1393 else
1394 tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
1392 1395
1393 /* mono/stereo selector */ 1396 /* mono/stereo selector */
1394 if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 1) 1397 if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
1395 tuner->audmode = V4L2_TUNER_MODE_MONO;
1396 else
1397 tuner->audmode = V4L2_TUNER_MODE_STEREO; 1398 tuner->audmode = V4L2_TUNER_MODE_STEREO;
1399 else
1400 tuner->audmode = V4L2_TUNER_MODE_MONO;
1398 1401
1399 /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */ 1402 /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */
1400 tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI) 1403 /* measured in units of dbµV in 1 db increments (max at ~75 dbµV) */
1401 * 0x0101; 1404 tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI);
1405 /* the ideal factor is 0xffff/75 = 873,8 */
1406 tuner->signal = (tuner->signal * 873) + (8 * tuner->signal / 10);
1402 1407
1403 /* automatic frequency control: -1: freq to low, 1 freq to high */ 1408 /* automatic frequency control: -1: freq to low, 1 freq to high */
1404 /* AFCRL does only indicate that freq. differs, not if too low/high */ 1409 /* AFCRL does only indicate that freq. differs, not if too low/high */