Commit 1c9f11ed21816290a7cea36fc2dc3b16d5590340
Committed by
Mauro Carvalho Chehab
1 parent
eb27fafef6
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
[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>
Showing 1 changed file with 4 additions and 9 deletions Side-by-side Diff
drivers/media/radio/radio-aztech.c
... | ... | @@ -94,21 +94,16 @@ |
94 | 94 | return 0; |
95 | 95 | } |
96 | 96 | |
97 | -/* thanks to Michael Dwyer for giving me a dose of clues in | |
98 | - * the signal strength department.. | |
99 | - * | |
100 | - * This card has a stereo bit - bit 0 set = mono, not set = stereo | |
101 | - */ | |
102 | 97 | static u32 aztech_g_rxsubchans(struct radio_isa_card *isa) |
103 | 98 | { |
104 | - if (inb(isa->io) & 1) | |
99 | + if (inb(isa->io) & AZTECH_BIT_MONO) | |
105 | 100 | return V4L2_TUNER_SUB_MONO; |
106 | 101 | return V4L2_TUNER_SUB_STEREO; |
107 | 102 | } |
108 | 103 | |
109 | -static int aztech_s_stereo(struct radio_isa_card *isa, bool stereo) | |
104 | +static u32 aztech_g_signal(struct radio_isa_card *isa) | |
110 | 105 | { |
111 | - return aztech_s_frequency(isa, isa->freq); | |
106 | + return (inb(isa->io) & AZTECH_BIT_NOT_TUNED) ? 0 : 0xffff; | |
112 | 107 | } |
113 | 108 | |
114 | 109 | static int aztech_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol) |
115 | 110 | |
... | ... | @@ -126,8 +121,8 @@ |
126 | 121 | .alloc = aztech_alloc, |
127 | 122 | .s_mute_volume = aztech_s_mute_volume, |
128 | 123 | .s_frequency = aztech_s_frequency, |
129 | - .s_stereo = aztech_s_stereo, | |
130 | 124 | .g_rxsubchans = aztech_g_rxsubchans, |
125 | + .g_signal = aztech_g_signal, | |
131 | 126 | }; |
132 | 127 | |
133 | 128 | static const int aztech_ioports[] = { 0x350, 0x358 }; |