From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762963AbYBVRpq (ORCPT ); Fri, 22 Feb 2008 12:45:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757400AbYBVRpd (ORCPT ); Fri, 22 Feb 2008 12:45:33 -0500 Received: from ns2.suse.de ([195.135.220.15]:49060 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754017AbYBVRpc (ORCPT ); Fri, 22 Feb 2008 12:45:32 -0500 Date: Fri, 22 Feb 2008 18:45:30 +0100 Message-ID: From: Takashi Iwai To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: [PATCH 12/16] [ALSA] hda-codec - Fix ALC882 capture source selection In-Reply-To: References: User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (+CVS-20070806) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The capture source selection for ADC list with two elements is buggy becaues of a wrong capture mux list. This patch fixes the starting index based on spec->num_adc_nids. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2a463c9..777f8c0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5227,10 +5227,14 @@ static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol, const struct hda_input_mux *imux = spec->input_mux; unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); static hda_nid_t capture_mixers[3] = { 0x24, 0x23, 0x22 }; - hda_nid_t nid = capture_mixers[adc_idx]; + hda_nid_t nid; unsigned int *cur_val = &spec->cur_mux[adc_idx]; unsigned int i, idx; + if (spec->num_adc_nids < 3) + nid = capture_mixers[adc_idx + 1]; + else + nid = capture_mixers[adc_idx]; idx = ucontrol->value.enumerated.item[0]; if (idx >= imux->num_items) idx = imux->num_items - 1; -- 1.5.3.8