Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3411424pxf; Mon, 22 Mar 2021 06:00:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn4+/tKDN0+TDXl0DPEfTuBczFYAL7tPDK6waFf+MwS3bEn3XIrkcfp93YSGB6TOPGYdMu X-Received: by 2002:a50:ec07:: with SMTP id g7mr25341355edr.72.1616418011590; Mon, 22 Mar 2021 06:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616418011; cv=none; d=google.com; s=arc-20160816; b=X/h9SnHMZa1ylW5Negtgqf/9gI5VyP7I0jegMn+uWvh858zti3Gw4dkgPs4xG+WWp8 i1kxWH3RYEmFQ4CyW8NXJwRDzCOknC+X38FEk6rX1RSveDwJtfUQZ7q9D+BTPXckiYuj khCDav18TigIcON9gq8DntGocva0aAxlSzmer9SX3i40bj4LjsvL4YJTdf2brF9d5W+Y h0QVO8MIBEl6xWK++GXqWNNk6TgxTwD4pBxl26gEZzGIWadB0w1nofcrZV6REVh5Ah/J eH4Jz3Ci31HRFDwgkmovZtJf7Sbd8EwGwmVH83xDlfdyvMZF/epQw5VeWt5B1CYoIBeW zjJQ== 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=nS169WINNL1poDt1A+ubrisxe1u+CMi07S1RTSL3z1c=; b=R8qcRLSc5f/weEAV+/JVrRHdkgsqZg3jVpWZoldxh1fkHtUol1LD5/pIz8RNl9jC4m Igm/Hbe2/XpMC/Tp5vOmIW6EBZ51s1U4t2kNWg8B0HT4dc0m3RPW4ViLao5zZhPk0sID IyAeINTODXL/TziqsthmwI+g8v7o9v6y9h0Wu/QfjjVo+Q5xhhuD1yMJ5pLt/nZGQrya ZJJUhm6XGYmUwYx3D2/0F/xp/lQ6y/HnPY8enQiU7mulgl73Q59YyKAVg8m/eFNGuHWQ Z4kAGbN9f/ThNqlpndbKFMOD374JwocTzi8QOuh912QstXEIptAGvyBpwd2tw9GZSP0A Ft1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="U/Fo2BIK"; 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 p12si10854780edm.494.2021.03.22.05.59.49; Mon, 22 Mar 2021 06:00:11 -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="U/Fo2BIK"; 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 S231674AbhCVM4y (ORCPT + 99 others); Mon, 22 Mar 2021 08:56:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:42260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbhCVMqI (ORCPT ); Mon, 22 Mar 2021 08:46:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A685E619B5; Mon, 22 Mar 2021 12:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616416948; bh=jFJqKbsTQvjmne1tqqIAsA62LSRo8yDj06WtE6WH3qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U/Fo2BIKiQvtNUHovBdiPAHTA1JpA+33Xb2ws4A78amk419iwh7oPrtjQDbCGXkT7 nrVC8vvuvxkPJKTj7GNFjUp3CM+eyp7kDUCE4mcDC9JeH6hp+WLRETBUsMCZk/uUbS ZcXld2L7CJcpqNhpaK+jKcghDtvJg4TCrzA85WMo= 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.4 05/60] ALSA: hda: generic: Fix the micmute led init state Date: Mon, 22 Mar 2021 13:27:53 +0100 Message-Id: <20210322121922.546414845@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210322121922.372583154@linuxfoundation.org> References: <20210322121922.372583154@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 @@ -4017,7 +4017,7 @@ int snd_hda_gen_add_micmute_led(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->micmute_led.update = hook; spec->cap_sync_hook = update_micmute_led;