All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH - ice1724 1/4] ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations
@ 2012-01-05 21:01 pavel.hofman
  2012-01-05 21:01 ` [PATCH - ice1724 2/4] ALSA: ice1724 - External clock item only for cards with SPDIF_IN pavel.hofman
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: pavel.hofman @ 2012-01-05 21:01 UTC (permalink / raw)
  To: patch; +Cc: Pavel Hofman, alsa-devel

From: Pavel Hofman <pavel.hofman@ivitera.com>

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>

diff --git a/pci/ice1712/ice1724.c b/pci/ice1712/ice1724.c
index 4353e76..2a0be2c 100644
--- a/pci/ice1712/ice1724.c
+++ b/pci/ice1712/ice1724.c
@@ -1117,14 +1117,18 @@ 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);
+	capt = (~ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_ADC_MASK) ?
+		1 : 0;
+	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;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-01-09  9:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-05 21:01 [PATCH - ice1724 1/4] ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations pavel.hofman
2012-01-05 21:01 ` [PATCH - ice1724 2/4] ALSA: ice1724 - External clock item only for cards with SPDIF_IN pavel.hofman
2012-01-08 13:33   ` Takashi Iwai
2012-01-05 21:01 ` [PATCH - ice1724 3/4] ALSA: ice1724 - Allow card info based on model only pavel.hofman
2012-01-08 13:33   ` Takashi Iwai
2012-01-05 21:01 ` [PATCH - ice1724 4/4] ALSA: ice1724 - Support for ooAoo SQ210a pavel.hofman
2012-01-08  9:13   ` Takashi Iwai
2012-01-09  8:32     ` Pavel Hofman
2012-01-09  9:24       ` Clemens Ladisch
2012-01-09  9:59         ` Pavel Hofman
2012-01-08  9:12 ` [PATCH - ice1724 1/4] ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations Takashi Iwai
2012-01-09  7:36   ` Pavel Hofman
2012-01-09  9:27     ` Takashi Iwai
2012-01-09  9:48       ` Pavel Hofman
2012-01-09  9:51         ` Takashi Iwai
2012-01-09  9:53           ` Pavel Hofman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.