From: Takashi Iwai Subject: Re: First test of the hda-jack branch Date: Fri, 11 Nov 2011 17:52:06 +0100 Message-ID: References: <4EBD4C04.3090406@canonical.com> 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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 3040C103838 for ; Fri, 11 Nov 2011 17:52:07 +0100 (CET) In-Reply-To: <4EBD4C04.3090406@canonical.com> 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: David Henningsson Cc: ALSA Development Mailing List List-Id: alsa-devel@alsa-project.org At Fri, 11 Nov 2011 17:23:32 +0100, David Henningsson wrote: > > Hi Takashi, > > After having some troubles with the kernel scripts (on the Ubuntu side) > I've managed to try out your test/hda-jack branch. I'm attaching a patch > I had to apply to make the modules load properly. > > After having applied the attached patch, I get stuck at an OOPS, which I > don't have time to troubleshoot further today. I'm attaching the OOPS > log as well (alsa-info for the system I'm testing on is the same as I > sent you a few days ago). Thanks for testing! I obviously didn't test the recent version :-< Try the patch below. Takashi --- diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c index 1389958..05489dc 100644 --- a/sound/pci/hda/hda_jack.c +++ b/sound/pci/hda/hda_jack.c @@ -193,6 +193,8 @@ void snd_hda_jack_report_sync(struct hda_codec *codec) for (i = 0; i < codec->jacktbl.used; i++, jack++) if (jack->nid) { jack_detect_update(codec, jack); + if (!jack->kctl) + continue; state = get_jack_plug_state(jack->pin_sense); snd_kctl_jack_report(codec->bus->card, jack->kctl, state); } @@ -341,6 +343,7 @@ int snd_hda_input_jack_add(struct hda_codec *codec, hda_nid_t nid, int type, err = snd_jack_new(codec->bus->card, name, type, &jack->jack); if (err < 0) return err; + jack->type = type; jack->jack->private_data = jack; jack->jack->private_free = hda_free_jack_priv; return 0; @@ -354,7 +357,7 @@ void snd_hda_input_jack_report(struct hda_codec *codec, hda_nid_t nid) unsigned int present; int type; - if (!jack) + if (!jack || !jack->jack) return; present = snd_hda_jack_detect(codec, nid);