From: Takashi Iwai Subject: Re: [PATCH 1/1] ALSA: VIA HDA: Fix notify_aa_path_ctls() invalid issue. Date: Thu, 28 Apr 2011 11:36:46 +0200 Message-ID: References: <4DB91F5B.50306@viatech.com.cn> 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 CCD8A24343 for ; Thu, 28 Apr 2011 11:36:49 +0200 (CEST) In-Reply-To: <4DB91F5B.50306@viatech.com.cn> 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: lydiawang Cc: alsa-devel@alsa-project.org, haraldwelte@viatech.com List-Id: alsa-devel@alsa-project.org At Thu, 28 Apr 2011 16:03:39 +0800, lydiawang wrote: > > From: Lydia Wang > 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 Applied now. Thanks. Takashi > 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); > } > } > >