alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Mark Goldstein <goldstein.mark@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: [PATCH] ALSA: HDA: Fix mic initialization in VIA auto parser (was: pci/hda/patch_via.c - broken between 2.6.36 and 2.6.37 (bisected))
Date: Mon, 21 Feb 2011 10:29:50 +0100	[thread overview]
Message-ID: <4D62308E.8070606@canonical.com> (raw)
In-Reply-To: <AANLkTinDJ7k3pXqg7ZP5pcGVXUt+xWYRTv-pa4_=J15b@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

On 2011-02-21 09:43, Mark Goldstein wrote:
> On Mon, Feb 21, 2011 at 10:35 AM, David Henningsson
> <david.henningsson@canonical.com>  wrote:
>> On 2011-02-20 12:06, Mark Goldstein wrote:
>>>
>>> I think the Mic part might be the same problem I had. I found out that
>>> the following code:
>>>
>>> static void via_auto_init_analog_input(struct hda_codec *codec)
>>> {
>>>         struct via_spec *spec = codec->spec;
>>>         const struct auto_pin_cfg *cfg =&spec->autocfg;
>>>         unsigned int ctl;
>>>         int i;
>>>
>>>         for (i = 0; i<    cfg->num_inputs; i++) {
>>>                 hda_nid_t nid = cfg->inputs[i].pin;
>>>                 if (spec->smart51_enabled&&    is_smart51_pins(spec, nid))
>>>                         ctl = PIN_OUT;
>>>                 else if (i == AUTO_PIN_MIC)
>>>                           ^^^^^^^^^^^^^^^^^^^^^^^^^
>>>                         ctl = PIN_VREF50;
>>>                 else
>>>                         ctl = PIN_IN;
>>>                 snd_hda_codec_write(codec, nid, 0,
>>>                                     AC_VERB_SET_PIN_WIDGET_CONTROL, ctl);
>>>         }
>>> }
>>>
>>> configures correctly only the first MIC (in my case it was Rear MIC).
>>> Front Mic pin was configured as HiZ.
>>> Changing the underlined condition to
>>>
>>> else if (cfg->input[i].type == AUTO_PIN_MIC)
>>>
>>> resolved the issue for me. (In alsa driver 1.0.23 this code was
>>> different, it checked that i<= FRONT_MIC index).
>>>
>>> I'm also just the user of alsa driver, so can't decide whether this is
>>> the proper fix. Maybe someone of knowledgeable developers could check
>>> it.
>>
>> It looks like the proper fix to me. If you like the fame and fortune ;-) of
>> having a commits in the kernel, I encourage you to submit a patch. Remember
>> to have proper "Cc: stable@kernel.org" and "Signed-off-by" lines in the the
>> patch header, and to cc Takashi on the resulting email.
>>
>> If not, I'll be happy to do it for you. It seems like an important fix to
>> me.
>>
>> --
>> David Henningsson, Canonical Ltd.
>> http://launchpad.net/~diwic
>>
>
> David,
>
> I've never dealt with submitting patches, so probably it'll be better
> (and definitely faster) if you could do it.
>
> Thank you,

Ok, here comes the patch!

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

[-- Attachment #2: 0001-ALSA-HDA-Fix-mic-initialization-in-VIA-auto-parser.patch --]
[-- Type: text/x-patch, Size: 1065 bytes --]

>From a28dd20815b47134bc342a6ec9b9da6e80f59837 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Mon, 21 Feb 2011 10:23:18 +0100
Subject: [PATCH] ALSA: HDA: Fix mic initialization in VIA auto parser

This typo caused some microphone inputs not to be correctly
initialized on VIA codecs.

Reported-By: Mark Goldstein <goldstein.mark@gmail.com>
Cc: stable@kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_via.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index a76c326..63b0054 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -567,7 +567,7 @@ static void via_auto_init_analog_input(struct hda_codec *codec)
 		hda_nid_t nid = cfg->inputs[i].pin;
 		if (spec->smart51_enabled && is_smart51_pins(spec, nid))
 			ctl = PIN_OUT;
-		else if (i == AUTO_PIN_MIC)
+		else if (cfg->inputs[i].type == AUTO_PIN_MIC)
 			ctl = PIN_VREF50;
 		else
 			ctl = PIN_IN;
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2011-02-21  9:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 10:50 pci/hda/patch_via.c - broken between 2.6.36 and 2.6.37 (bisected) Wolfgang Scheicher
2011-02-20 11:06 ` Mark Goldstein
2011-02-21  3:01   ` Raymond Yau
2011-02-21  6:55     ` Mark Goldstein
2011-02-21  8:26       ` Raymond Yau
2011-02-21  8:35   ` David Henningsson
2011-02-21  8:43     ` Mark Goldstein
2011-02-21  9:29       ` David Henningsson [this message]
2011-02-22 11:20         ` [PATCH] ALSA: HDA: Fix mic initialization in VIA auto parser (was: pci/hda/patch_via.c - broken between 2.6.36 and 2.6.37 (bisected)) Wolfgang Scheicher
2011-02-22 12:13           ` Raymond Yau
2011-03-23 10:41           ` Wolfgang Scheicher
2011-03-23 10:58             ` Mark Goldstein
2011-03-23 11:25               ` Wolfgang Scheicher
2011-02-22 13:03         ` Takashi Iwai
     [not found] ` <AANLkTim-SMpK7ZFV1dn99v_KFeGYy2xNzLyzGzBuG-XC@mail.gmail.com>
     [not found]   ` <201102201439.54277.wolfgang.scheicher@gmail.com>
2011-02-20 23:39     ` pci/hda/patch_via.c - broken between 2.6.36 and 2.6.37 (bisected) Raymond Yau
2011-02-21  0:24     ` Raymond Yau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D62308E.8070606@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=goldstein.mark@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).