All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ALSA: VIA HDA: Fix notify_aa_path_ctls() invalid issue.
@ 2011-04-28  8:03 lydiawang
  2011-04-28  9:36 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: lydiawang @ 2011-04-28  8:03 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, haraldwelte, lydiawang

From: Lydia Wang <lydiawang@viatech.com.cn>
Subject: ALSA: VIA HDA: Fix notify_aa_path_ctls() invalid issue.

In notify_aa_path_ctls(), adds 'rear mic' item and confirms the A-A path control 
existing before notifying card that the A-A path volume is muted if smart5.1 is 
enabled.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Index: sound-2.6/sound/pci/hda/patch_via.c
===================================================================
--- sound-2.6.orig/sound/pci/hda/patch_via.c	2011-04-28 14:26:11.000000000 +0800
+++ sound-2.6/sound/pci/hda/patch_via.c	2011-04-28 14:44:14.000000000 +0800
@@ -844,14 +844,18 @@
 {
 	int i;
 	struct snd_ctl_elem_id id;
-	const char *labels[] = {"Mic", "Front Mic", "Line"};
+	const char *labels[] = {"Mic", "Front Mic", "Line", "Rear Mic"};
+	struct snd_kcontrol *ctl;
 
 	memset(&id, 0, sizeof(id));
 	id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
 	for (i = 0; i < ARRAY_SIZE(labels); i++) {
 		sprintf(id.name, "%s Playback Volume", labels[i]);
-		snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE,
-			       &id);
+		ctl = snd_hda_find_mixer_ctl(codec, id.name);
+		if (ctl)
+			snd_ctl_notify(codec->bus->card,
+					SNDRV_CTL_EVENT_MASK_VALUE,
+					&ctl->id);
 	}
 }
 

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

end of thread, other threads:[~2011-04-28  9:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28  8:03 [PATCH 1/1] ALSA: VIA HDA: Fix notify_aa_path_ctls() invalid issue lydiawang
2011-04-28  9:36 ` 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.