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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 D994FC433DB for ; Fri, 12 Mar 2021 13:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3CA364FEE for ; Fri, 12 Mar 2021 13:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231657AbhCLNMn (ORCPT ); Fri, 12 Mar 2021 08:12:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:33964 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbhCLNMl (ORCPT ); Fri, 12 Mar 2021 08:12:41 -0500 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 EF475B01F; Fri, 12 Mar 2021 13:12:39 +0000 (UTC) Date: Fri, 12 Mar 2021 14:12:39 +0100 Message-ID: From: Takashi Iwai To: Hui Wang Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: Re: [PATCH] ALSA: hda: generic: Fix the micmute led init state In-Reply-To: <20210312041408.3776-1-hui.wang@canonical.com> References: <20210312041408.3776-1-hui.wang@canonical.com> 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 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, 12 Mar 2021 05:14:08 +0100, Hui Wang wrote: > > 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 Applied, thanks. Takashi