Skip to contentSkip to conversation

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)

PATCH Applied [email protected] 2 participants 2 messages Feb 4, 2010 – Feb 5, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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)

From: Eliot Blennerhassett <[email protected]>

---
 pci/asihpi/asihpi.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
pci/asihpi/asihpi.c +5 -2
index 0c7b4fb..4f82e9f 100644
@@ -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,
Signature · 1 line
1.7.0.rc0.8.ge3f67d
Applied
#1 lore raw

At Fri, 05 Feb 2010 12:50:40 +1300,

Quoted 4 lines · [email protected] wrote:

From: Eliot Blennerhassett <[email protected]>

Thanks, applied now.

Takashi

Quoted 32 lines
---
 pci/asihpi/asihpi.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
pci/asihpi/asihpi.c +5 -2
index 0c7b4fb..4f82e9f 100644
@@ -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,
Signature · 1 line
1.7.0.rc0.8.ge3f67d