Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C0C2C43461 for ; Mon, 7 Sep 2020 07:04:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1150E206D4 for ; Mon, 7 Sep 2020 07:04:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SzckMFi+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1150E206D4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 13995179C; Mon, 7 Sep 2020 09:03:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 13995179C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1599462250; bh=th2YrTSomkJlK75/Hz54rqyCqUsUC7qQs4EsvruKWZY=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SzckMFi+k/rXWs4ofNt1lXuVvTwZrltGd9hIXECiYy8WkObuBm2GhgzHBS0IZ2PcL i7lFz9nLIHCMWKobHiArlJkL5EWXJchXZS35ke8WMnFfR2zAR3doGImmUM8buOG/qa UtGLQSaaARcxEbfCa2VFwNtSV8EccvAcTvajCvhw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9FDF8F8021C; Mon, 7 Sep 2020 09:03:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A0F9F80227; Mon, 7 Sep 2020 09:03:18 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 261C2F800FD for ; Mon, 7 Sep 2020 09:03:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 261C2F800FD X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 40080AA55; Mon, 7 Sep 2020 07:03:06 +0000 (UTC) Date: Mon, 07 Sep 2020 09:03:05 +0200 Message-ID: From: Takashi Iwai To: Luke Jones Subject: Re: [PATCH] ALSA: hda: fixup headset for ASUS GX502 laptop In-Reply-To: <20200906082507.38091-1-luke@ljones.dev> References: <20200906082507.38091-1-luke@ljones.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: hui.wang@canonical.com, alsa-devel@alsa-project.org, kailang@realtek.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Sun, 06 Sep 2020 10:25:07 +0200, Luke Jones wrote: > > From: Luke D Jones > > The GX502 requires a few steps to enable the headset i/o: pincfg, > verbs to enable and unmute the amp used for headpone out, and > a jacksense callback to toggle output via internal or jack using > a verb. Thanks for the patch. The code changes look mostly good, but a few minor coding problems (mostly coding style) are seen. Could you resubmit with fixes? > Signed-off-by: Luke Jones The SOB doesn't match with From line. Is it intentional? .... > --- a/sound/pci/hda/patch_realtek.c > +++ b/sound/pci/hda/patch_realtek.c > @@ -5424,7 +5424,7 @@ static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, > struct alc_spec *spec = codec->spec; > spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; > alc255_set_default_jack_type(codec); > - } > + } > else > alc_fixup_headset_mode(codec, fix, action); > } Please drop the unrelated change. .... > +static void alc294_gx502_toggle_output(struct hda_codec *codec, > + struct hda_jack_callback *cb) > +{ > + /* The Windows driver sets the codec up in a very different way where > + * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it > + */ > + if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) { > + alc_write_coef_idx(codec, 0x10, 0x8a20); > + } else { > + alc_write_coef_idx(codec, 0x10, 0x0a20); > + } Remove braces for a single if line. Checkpatch would suggest it, too. .... > @@ -7338,6 +7376,35 @@ static const struct hda_fixup alc269_fixups[] = { > .chained = true, > .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC > }, > + [ALC294_FIXUP_ASUS_GX502_PINS] = { > + .type = HDA_FIXUP_PINS, > + .v.pins = (const struct hda_pintbl[]) { > + { 0x19, 0x03a11050 }, /* front HP mic */ > + { 0x1a, 0x01a11830 }, //0x00a11030 }, /* rear external mic */ The doubly comments look awkward. Please reformat it. .... > + [ALC294_FIXUP_ASUS_GX502_VERBS] = { > + .type = HDA_FIXUP_VERBS, > + .v.verbs = (const struct hda_verb[]) { > + /* set 0x15 to HP-OUT ctrl */ Please align the comment at the right tab. > + { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, > + /* unmute the 0x15 amp */ > + { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, > + /* set 0x0a input converter to digital */ > + { 0x0a, 0x70d, 0x01 }, Use AC_VERB_SET_DIGI_CONVERT_1. And, how is this related with the headset fix? Is this really mandatory? If this widget is really wired, usually the digital I/O is controlled via IEC9158 status mixer. thanks, Takashi