Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3402763pxf; Mon, 22 Mar 2021 05:46:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSn6AgXyDzbOmqHTWD5TWK0TbKFVzVlcjpp8arUAW0WkuypB8p4xrD5M5jIq2sOXNTdPsz X-Received: by 2002:a05:6402:22b5:: with SMTP id cx21mr25610950edb.27.1616417170067; Mon, 22 Mar 2021 05:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616417170; cv=none; d=google.com; s=arc-20160816; b=LYirbmQI7A78zmdvEXLTBu/WR0ewUD1htOwaShIfdHAFhSkngbtGPoi47NEqbxC4tv z6iPOOHlxpzhp8NCHXmr4ze0qGyIYR5EhjKnp+/0sPcUvk4Yap0mDUh0rzxwx1a7q8JF 6p/uOMpufdZaQSJB27sNmtNOTpxpMY8Ge8tHWwBo7RbaVzdLDn0TTLOyxLFMGnXAfN+d aJ+zYawd7uvM0L7BOyFxYi+9f13b8Qb4vv9OkvNS9dz4sRFaTPTxsHd6WFNp/A2qYbeI jjro56PIA0qGMX2UtO1OK13Ycjrnw0fceYJI8hUewWAzvSNpQLYfDV9TNFjzQ0I/+cWP /9wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U444XxCaOCZ54DcegFyREn99i40KRg5bwjPDWrG3vmE=; b=sy/BrwHh/uCJLNU8SXu0QF8q0zQnWkc0a2efvCC4gF7ckpmB9gj9VDNFK4ncLm+RzW MTgWf8JQFioGEQGHFqy267htpsn4rqKDnImJVxi8cVMI8hz8IiyYcqyAw6VgNBxBchO9 EBnR6WUV2TWVwxKLtPUam6xMAUArOrgIWJFAF1CMgyVeG700So3h+ynM3BqvaWyMu+Ql SNt1aY1OgsCDdLpl6PXXfY1hV0bawUyuOLH1N7fdjngmS6CpQTxF96rWEBRVwDcm3dfy T2ujPpyHbrbXcCDAAwV8pFQn3Fil4TgyoK86UV3gv1XdTJBPZmdXj8JbCDtKuxXBf2g9 9QAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vMtoOrDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si10827376edd.382.2021.03.22.05.45.46; Mon, 22 Mar 2021 05:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vMtoOrDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbhCVMmE (ORCPT + 99 others); Mon, 22 Mar 2021 08:42:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhCVMgO (ORCPT ); Mon, 22 Mar 2021 08:36:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9A4B61992; Mon, 22 Mar 2021 12:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616416560; bh=6Odjv0BGUfVmqIuSNmD1m0vv9DcjMHPVid+ivTgBQ60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vMtoOrDgz4lIyZ81fe92yQRpjCNPsXw8E0+xYD48F0CEJMZzvxQIsib0Jjs6C7L2H s3DepzulnXMv28uu8T/0Va77tZmXL36iDiLFCbKn55Vv6gtzg/eRmb9cLbXdstmIxV RWPqRjjY6nqCF/ynDH01sUeKmmz2fDgy/zrgLgJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai Subject: [PATCH 5.10 006/157] ALSA: hda: generic: Fix the micmute led init state Date: Mon, 22 Mar 2021 13:26:03 +0100 Message-Id: <20210322121933.967583124@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210322121933.746237845@linuxfoundation.org> References: <20210322121933.746237845@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang commit 2bf44e0ee95f39cc54ea1b942f0a027e0181ca4e upstream. Recently we found the micmute led init state is not correct after freshly installing the ubuntu linux on a Lenovo AIO machine. The internal mic is not muted, but the micmute led is on and led mode is 'follow mute'. If we mute internal mic, the led is keeping on, then unmute the internal mic, the led is off. And from then on, the micmute led will work correctly. So the micmute led init state is not correct. The led is controlled by codec gpio (ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), in the patch_realtek, the gpio data is set to 0x4 initially and the led is on with this data. In the hda_generic, the led_value is set to 0 initially, suppose users set the 'capture switch' to on from user space and the micmute led should change to be off with this operation, but the check "if (val == spec->micmute_led.led_value)" in the call_micmute_led_update() will skip the led setting. To guarantee the led state will be set by the 1st time of changing "Capture Switch", set -1 to the init led_value. Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20210312041408.3776-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -4065,7 +4065,7 @@ static int add_micmute_led_hook(struct h spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE; spec->micmute_led.capture = 0; - spec->micmute_led.led_value = 0; + spec->micmute_led.led_value = -1; spec->micmute_led.old_hook = spec->cap_sync_hook; spec->cap_sync_hook = update_micmute_led; if (!snd_hda_gen_add_kctl(spec, NULL, &micmute_led_mode_ctl))