aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/ice1712/ice1724.c
diff options
context:
space:
mode:
authorPavel Hofman <pavel.hofman@ivitera.com>2012-01-10 20:45:28 +0100
committerTakashi Iwai <tiwai@suse.de>2012-01-11 08:56:59 +0100
commitffd364ddd3090e2ef0d4882970c1e342db8b482f (patch)
treee5a79a085725f3c3fea5a4465f5e6c33fdc2dffc /sound/pci/ice1712/ice1724.c
parentf7de8ba3fcf19487d2f0af9aee0c510fc79efa15 (diff)
downloadlinux-stericsson-ffd364ddd3090e2ef0d4882970c1e342db8b482f.tar.gz
ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations
Add the capture pcm only if there is at least one ADC configured in the SYSCONF register. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r--sound/pci/ice1712/ice1724.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 9e18d3a3f038..e797823ddc3a 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1117,14 +1117,21 @@ static struct snd_pcm_ops snd_vt1724_capture_pro_ops = {
static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device)
{
struct snd_pcm *pcm;
- int err;
+ int capt, err;
- err = snd_pcm_new(ice->card, "ICE1724", device, 1, 1, &pcm);
+ if ((ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) ==
+ VT1724_CFG_ADC_NONE)
+ capt = 0;
+ else
+ capt = 1;
+ err = snd_pcm_new(ice->card, "ICE1724", device, 1, capt, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops);
- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_vt1724_capture_pro_ops);
+ if (capt)
+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
+ &snd_vt1724_capture_pro_ops);
pcm->private_data = ice;
pcm->info_flags = 0;