From patchwork Thu Aug 15 01:38:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jer=C3=B3nimo_Borque?= X-Patchwork-Id: 11094849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60CD913B1 for ; Thu, 15 Aug 2019 01:40:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44A6F205A8 for ; Thu, 15 Aug 2019 01:40:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32CE12880A; Thu, 15 Aug 2019 01:40:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F309F205A8 for ; Thu, 15 Aug 2019 01:40:21 +0000 (UTC) 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 1E89084F; Thu, 15 Aug 2019 03:39:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1E89084F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565833219; bh=CCsIWLS0ro79akA2mzaoOHx2YOBnFnHHH2JC5eJyoOc=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=S/TFjdkKNyYQG3lf1o9nibX6puoQtCX3kveF+Oo0MfWScI2S+DMsmfqjoDJ4t7AKt 9T/fs2wnOrSfNu6fGvI7e7waQV5IyX1Frruv2SR5XpUr75yN3oIT6xjZ19MWFETxY0 5KrorKlLlhNn1P4bwpJVUJts7Fq5zGw/LSkbRpA8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 934E4F80273; Thu, 15 Aug 2019 03:39:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60153F80274; Thu, 15 Aug 2019 03:39:27 +0200 (CEST) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 34755F801DF for ; Thu, 15 Aug 2019 03:39:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 34755F801DF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="toTz6YY7" Received: by mail-qt1-x844.google.com with SMTP id q4so881231qtp.1 for ; Wed, 14 Aug 2019 18:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wA/x2dxQiMMNel8N2gzBx4H/5a7KjXK2r7iTD3skvIw=; b=toTz6YY7YDeI15z/wT+hpufnCF9jKWZay51h+4g/DZRU5ZAP0mTqwepTHwZzinBlDD BoWWIqqkD812x+Njm+uHnERbySfDWLB0Y75klSeWrUn8Yj1Y5t3vNBAkQRZHkLMxGLw7 vGtzqKbKK7jjFZwx4uPgP9KA3g1m9w6jDLIUEXilbDMcftq42yZ3w8RkKp2mNkkDDauf iUi0ecCXbADeB7w3ORk0t0hcHXHTz3n6nkjl5lSHrKEdL/FX3S1NleL39hXpobupyj9j oddKc/SEqFYZM+Fg4ote8hI5lZUsG9SJW0hE+ER61uMwN5U9XzX8h+0LOqb2q0AU0tpx zwBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=wA/x2dxQiMMNel8N2gzBx4H/5a7KjXK2r7iTD3skvIw=; b=qTrbeZ/BqGjmiiCOs9z/uTWz2g3d3hPO1yWrRGz9hyB6NvOppszV9YgkUIZ3QFBOpi harnhVbYJwGgOom9oeCBYMekd0iC89l8MBwsaFJTicpfuBFgRWvF7M2HasQm9gfRvtYz 1pJovmXvnhS+CiIoad/PtKB8OgpwieDd62K7vuTk7d+xqFnd39/FZWc4DV4qNCNlcJPW 6ydvbkTOJHqgBeX7H+Uu72I2GFxw86lVZSNcOhgFIJuJnl//iWWbL0/WV7YFbk8SzA6n SMEBsyYW8hXePgnRqcxmIFp5nk0QxqqB3brwHar14T+NtBkxlOTqwBChe91hyPV/LkRZ Oyug== X-Gm-Message-State: APjAAAWON1sqEFfVjFU7cDwlzYJ04cWly2AuD10DHpPuS9fbJndKG8zF y3tFmjAq48Zg/kGV2q5UAf2U73pJ00Pn/w== X-Google-Smtp-Source: APXvYqx52FBhH4l6T6zyAIzkFO4zXYA90kTDapp+duzMBf0SMefRrLcIAxFLtYcVHb4TUd/DdVqYUg== X-Received: by 2002:aed:2d67:: with SMTP id h94mr1954587qtd.154.1565833162053; Wed, 14 Aug 2019 18:39:22 -0700 (PDT) Received: from billcipher.cpe.telecentro.net.ar ([181.47.97.137]) by smtp.gmail.com with ESMTPSA id m194sm725575qke.123.2019.08.14.18.39.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 18:39:21 -0700 (PDT) From: jeronimo@borque.com.ar To: alsa-devel@alsa-project.org Date: Wed, 14 Aug 2019 22:38:24 -0300 Message-Id: <20190815013824.13373-1-jeronimo@borque.com.ar> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Cc: Jeronimo Borque , Takashi Iwai Subject: [alsa-devel] [PATCH] ALSA: hda - Fixes inverted Conexant GPIO mic mute led 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Jeronimo Borque "enabled" parameter historically referred to the device input or output, not to the led indicator. After the changes added with the led helper functions the mic mute led logic refers to the led and not to the mic input which caused led indicator to be negated (Mic mute led was on when the input enabled) Fixing it in the call to cxt_update_gpio_led at the cxt_gpio_micmute_update hook. Maybe more changes are required to be consistent everywhere. Signed-off-by: Jeronimo Borque --- sound/pci/hda/patch_conexant.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index f299f137eaea..8edf0d1290b5 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -636,6 +636,10 @@ static void cxt_update_gpio_led(struct hda_codec *codec, unsigned int mask, spec->gpio_led &= ~mask; else spec->gpio_led |= mask; + + codec_dbg(codec, "mask:%d enabled:%d gpio_led:%d\n", + mask, enabled, spec->gpio_led); + if (spec->gpio_led != oldval) snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, spec->gpio_led); @@ -656,7 +660,7 @@ static void cxt_gpio_micmute_update(struct hda_codec *codec) struct conexant_spec *spec = codec->spec; cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, - spec->gen.micmute_led.led_value); + !spec->gen.micmute_led.led_value); } @@ -669,7 +673,6 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03 }, {} }; - codec_info(codec, "action: %d gpio_led: %d\n", action, spec->gpio_led); if (action == HDA_FIXUP_ACT_PRE_PROBE) { spec->gen.vmaster_mute.hook = cxt_fixup_gpio_mute_hook;