summaryrefslogtreecommitdiff
path: root/drivers/media/radio/radio-aztech.c
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2013-07-19 13:46:18 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-07-26 13:34:09 -0300
commit1c9f11ed21816290a7cea36fc2dc3b16d5590340 (patch)
tree10f861bb1121715e5c1148c8c3b022850a309f70 /drivers/media/radio/radio-aztech.c
parenteb27fafef69568a82c46c27a1761f037e4272b87 (diff)
downloadlinux-rt-1c9f11ed21816290a7cea36fc2dc3b16d5590340.tar.gz
[media] radio-aztech: Implement signal strength detection and fix stereo detection
Current stereo detection code is wrong - it reads TUNED bit instead of STEREO bit. Fix that and implement signal strength detection too. Also remove useless s_stereo functionn. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/radio/radio-aztech.c')
-rw-r--r--drivers/media/radio/radio-aztech.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c
index 2f5671f2e17e..705dd6f9162c 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -94,21 +94,16 @@ static int aztech_s_frequency(struct radio_isa_card *isa, u32 freq)
return 0;
}
-/* thanks to Michael Dwyer for giving me a dose of clues in
- * the signal strength department..
- *
- * This card has a stereo bit - bit 0 set = mono, not set = stereo
- */
static u32 aztech_g_rxsubchans(struct radio_isa_card *isa)
{
- if (inb(isa->io) & 1)
+ if (inb(isa->io) & AZTECH_BIT_MONO)
return V4L2_TUNER_SUB_MONO;
return V4L2_TUNER_SUB_STEREO;
}
-static int aztech_s_stereo(struct radio_isa_card *isa, bool stereo)
+static u32 aztech_g_signal(struct radio_isa_card *isa)
{
- return aztech_s_frequency(isa, isa->freq);
+ return (inb(isa->io) & AZTECH_BIT_NOT_TUNED) ? 0 : 0xffff;
}
static int aztech_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol)
@@ -126,8 +121,8 @@ static const struct radio_isa_ops aztech_ops = {
.alloc = aztech_alloc,
.s_mute_volume = aztech_s_mute_volume,
.s_frequency = aztech_s_frequency,
- .s_stereo = aztech_s_stereo,
.g_rxsubchans = aztech_g_rxsubchans,
+ .g_signal = aztech_g_signal,
};
static const int aztech_ioports[] = { 0x350, 0x358 };