diff options
author | Pavel Hofman <pavel.hofman@ivitera.com> | 2012-01-10 14:45:28 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-11 02:56:59 -0500 |
commit | ffd364ddd3090e2ef0d4882970c1e342db8b482f (patch) | |
tree | e5a79a085725f3c3fea5a4465f5e6c33fdc2dffc /sound/pci/ice1712 | |
parent | f7de8ba3fcf19487d2f0af9aee0c510fc79efa15 (diff) |
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')
-rw-r--r-- | sound/pci/ice1712/envy24ht.h | 1 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h index a0c5e009bb4a..4ca33a800bc8 100644 --- a/sound/pci/ice1712/envy24ht.h +++ b/sound/pci/ice1712/envy24ht.h | |||
@@ -66,6 +66,7 @@ enum { | |||
66 | #define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */ | 66 | #define VT1724_CFG_CLOCK384 0x40 /* 16.9344Mhz, 44.1kHz*384 */ |
67 | #define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */ | 67 | #define VT1724_CFG_MPU401 0x20 /* MPU401 UARTs */ |
68 | #define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */ | 68 | #define VT1724_CFG_ADC_MASK 0x0c /* one, two or one and S/PDIF, stereo ADCs */ |
69 | #define VT1724_CFG_ADC_NONE 0x0c /* no ADCs */ | ||
69 | #define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */ | 70 | #define VT1724_CFG_DAC_MASK 0x03 /* one, two, three, four stereo DACs */ |
70 | 71 | ||
71 | #define VT1724_REG_AC97_CFG 0x05 /* byte */ | 72 | #define VT1724_REG_AC97_CFG 0x05 /* byte */ |
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 = { | |||
1117 | static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) | 1117 | static int __devinit snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) |
1118 | { | 1118 | { |
1119 | struct snd_pcm *pcm; | 1119 | struct snd_pcm *pcm; |
1120 | int err; | 1120 | int capt, err; |
1121 | 1121 | ||
1122 | err = snd_pcm_new(ice->card, "ICE1724", device, 1, 1, &pcm); | 1122 | if ((ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) == |
1123 | VT1724_CFG_ADC_NONE) | ||
1124 | capt = 0; | ||
1125 | else | ||
1126 | capt = 1; | ||
1127 | err = snd_pcm_new(ice->card, "ICE1724", device, 1, capt, &pcm); | ||
1123 | if (err < 0) | 1128 | if (err < 0) |
1124 | return err; | 1129 | return err; |
1125 | 1130 | ||
1126 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops); | 1131 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_vt1724_playback_pro_ops); |
1127 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_vt1724_capture_pro_ops); | 1132 | if (capt) |
1133 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, | ||
1134 | &snd_vt1724_capture_pro_ops); | ||
1128 | 1135 | ||
1129 | pcm->private_data = ice; | 1136 | pcm->private_data = ice; |
1130 | pcm->info_flags = 0; | 1137 | pcm->info_flags = 0; |