From: Takashi Iwai Subject: Re: [PATCH] Allow mux to have up to 256 sources. Log warning and return index 0 rather than error if DSP returns invalid value. (amixer fails if error returned on get) Date: Fri, 05 Feb 2010 08:52:28 +0100 Message-ID: References: <1265327440-6672-1-git-send-email-linux@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id A62FF2442E for ; Fri, 5 Feb 2010 08:52:29 +0100 (CET) In-Reply-To: <1265327440-6672-1-git-send-email-linux@audioscience.com> 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: linux@audioscience.com Cc: Eliot Blennerhassett , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 05 Feb 2010 12:50:40 +1300, linux@audioscience.com wrote: > > From: Eliot Blennerhassett > > Signed-off-by: Eliot Blennerhassett Thanks, applied now. Takashi > --- > pci/asihpi/asihpi.c | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c > index 0c7b4fb..4f82e9f 100644 > --- a/pci/asihpi/asihpi.c > +++ b/pci/asihpi/asihpi.c > @@ -2187,7 +2187,7 @@ static int snd_asihpi_mux_get(struct snd_kcontrol *kcontrol, > HPI_HandleError(HPI_Multiplexer_GetSource(phSubSys, hControl, > &wSourceType, &wSourceIndex)); > /* Should cache this search result! */ > - for (s = 0; s < 16; s++) { > + for (s = 0; s < 256; s++) { > if (HPI_Multiplexer_QuerySource(phSubSys, hControl, s, > &wSrcNodeType, &wSrcNodeIndex)) > break; > @@ -2198,7 +2198,10 @@ static int snd_asihpi_mux_get(struct snd_kcontrol *kcontrol, > return 0; > } > } > - return -EINVAL; > + snd_printd(KERN_WARNING "Control %x failed to match mux source %hu %hu\n", > + hControl, wSourceType, wSourceIndex); > + ucontrol->value.enumerated.item[0] = 0; > + return 0; > } > > static int snd_asihpi_mux_put(struct snd_kcontrol *kcontrol, > -- > 1.7.0.rc0.8.ge3f67d >