* [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)
@ 2010-02-04 23:50 linux
2010-02-05 7:52 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: linux @ 2010-02-04 23:50 UTC (permalink / raw)
To: patch; +Cc: Eliot Blennerhassett, alsa-devel
From: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* 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)
2010-02-04 23:50 [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) linux
@ 2010-02-05 7:52 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2010-02-05 7:52 UTC (permalink / raw)
To: linux; +Cc: Eliot Blennerhassett, alsa-devel
At Fri, 05 Feb 2010 12:50:40 +1300,
linux@audioscience.com wrote:
>
> From: Eliot Blennerhassett <eblennerhassett@audioscience.com>
>
> Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-05 7:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 23:50 [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) linux
2010-02-05 7:52 ` Takashi Iwai
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.