From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Hofman Subject: Re: [PATCH - ice1724 1/4] ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations Date: Mon, 09 Jan 2012 08:36:54 +0100 Message-ID: <4F0A9916.9050606@ivitera.com> References: <1325797318-16333-1-git-send-email-pavel.hofman@ivitera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cable.insite.cz (static-84-242-75-189.net.upcbroadband.cz [84.242.75.189]) by alsa0.perex.cz (Postfix) with ESMTP id 7C97D10394B for ; Mon, 9 Jan 2012 08:36:58 +0100 (CET) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Dne 8.1.2012 10:12, Takashi Iwai napsal(a): > At Thu, 5 Jan 2012 22:01:55 +0100, > pavel.hofman@ivitera.com wrote: >> >> From: Pavel Hofman >> >> Add the capture pcm only if there is at least one ADC configured in >> the SYSCONF register. >> >> Signed-off-by: Pavel Hofman >> >> 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; > > Are you sure that this is correct? I thought the value 0 means 1 ADC, > 1 is two ADCS, etc. > I think it is correct. This is what the datasheet says: CCS04: System Configuration Register bits 3:2 00: one stereo ADC connected 01: two stereo ADCs connected 10: one stereo ADC and a S/PDIF receiver connected 11: No physical inputs I have two soundcards, one with 10 (ADC + SPDIF in), another with 11 (no ADC), the code seems to work fine. Thanks, Pavel.