diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-05-28 10:10:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-05 15:17:03 -0500 |
commit | 9bbc5820ffe1675c923ed0b82952cc64a610bd5d (patch) | |
tree | d2ffbd89d995a308431523a49846b5fed6f70857 | |
parent | f5e7cc4af36c631edf7dc73111d80af975f526a6 (diff) |
[media] radio-miropcm20: fix signal and stereo indication
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/radio/radio-miropcm20.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c index eb6cd86337a8..3d0ff4404d12 100644 --- a/drivers/media/radio/radio-miropcm20.c +++ b/drivers/media/radio/radio-miropcm20.c | |||
@@ -82,6 +82,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
82 | struct v4l2_tuner *v) | 82 | struct v4l2_tuner *v) |
83 | { | 83 | { |
84 | struct pcm20 *dev = video_drvdata(file); | 84 | struct pcm20 *dev = video_drvdata(file); |
85 | int res; | ||
85 | 86 | ||
86 | if (v->index) | 87 | if (v->index) |
87 | return -EINVAL; | 88 | return -EINVAL; |
@@ -89,8 +90,13 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
89 | v->type = V4L2_TUNER_RADIO; | 90 | v->type = V4L2_TUNER_RADIO; |
90 | v->rangelow = 87*16000; | 91 | v->rangelow = 87*16000; |
91 | v->rangehigh = 108*16000; | 92 | v->rangehigh = 108*16000; |
92 | v->signal = 0xffff; | 93 | res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTATION, -1, -1); |
93 | v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; | 94 | v->signal = (res & 0x80) ? 0 : 0xffff; |
95 | /* Note: stereo detection does not work if the audio is muted, | ||
96 | it will default to mono in that case. */ | ||
97 | res = snd_aci_cmd(dev->aci, ACI_READ_TUNERSTEREO, -1, -1); | ||
98 | v->rxsubchans = (res & 0x40) ? V4L2_TUNER_SUB_MONO : | ||
99 | V4L2_TUNER_SUB_STEREO; | ||
94 | v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | 100 | v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; |
95 | v->audmode = dev->audmode; | 101 | v->audmode = dev->audmode; |
96 | return 0; | 102 | return 0; |