From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CC0BC433F5 for ; Tue, 2 Nov 2021 08:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2629060F56 for ; Tue, 2 Nov 2021 08:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbhKBIW2 (ORCPT ); Tue, 2 Nov 2021 04:22:28 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:53844 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbhKBIWA (ORCPT ); Tue, 2 Nov 2021 04:22:00 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 60A5D218A4; Tue, 2 Nov 2021 08:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1635841165; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9742+b7cYgGp8HGz78oVyltHXm7JrBnwMm8ZZHyByL4=; b=d+l0GKh4GG4TgAYkt6HJZQPwte1Wubnj0zWF/cCNtH1/Enssnn8ZHpJltWKk2x6sA23ZjV 0xTKW2+tgieXJWrbwa8h/FpOWl92+m6t5tVkrWA53sW7B5E37rdQgJp2k3vHpE+Jg843zu IYHzdqYlEApm58fxmPxPr4L+V7lYCKU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1635841165; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9742+b7cYgGp8HGz78oVyltHXm7JrBnwMm8ZZHyByL4=; b=fPUBajXwl8ZCdrL4qcZQaf+Ykyp0o+b6IVSkmB/SbefYDObg20aa0TQQLCfaAOYvaHcovK p4BPT0X0gAqnzHDA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 594B9A3B8C; Tue, 2 Nov 2021 08:19:25 +0000 (UTC) Date: Tue, 02 Nov 2021 09:19:25 +0100 Message-ID: From: Takashi Iwai To: Jonathan Clarke Cc: linux-kernel@vger.kernel.org, Takashi Iwai , alsa-devel@alsa-project.org Subject: Re: [PATCH] Make top/rear speaker, mute and micmute leds work on HP x360 14-ea000 laptops that use Realtek 245 codec In-Reply-To: <20211101103445.GA1064130@rampage-hp2> References: <20211029154313.1005394-1-jonathan.a.clarke@gmail.com> <20211101103445.GA1064130@rampage-hp2> 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: linux-kernel@vger.kernel.org On Mon, 01 Nov 2021 11:34:45 +0100, Jonathan Clarke wrote: > > Thanks for taking a look at this patch so quickly, Takashi. > > On Sat, Oct 30, 2021 at 12:01:03PM +0200, Takashi Iwai wrote: > > Could you give more descriptions? The patch isn't trivial at all, and > > it needs more explanations. > > Yes, will do. > > > > + /* output mute is set via SET_COEF_INDEX,SET_PROC_COEF */ > > > + spec->mute_led_polarity = 0; > > > + spec->mute_led_coef.idx = 0x0b; > > > + spec->mute_led_coef.mask = 0xffff; > > > + spec->mute_led_coef.on = 0xa02f; > > > + spec->mute_led_coef.off = 0x7774; > > > + snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); > > > > I guess this COEF isn't only about mute-LED but actually does mute the > > output? IIRC, the bit 0x08 corresponds to the LED. If so, it's > > better to split. Basically this snd_hda_gen_add_mute_led_cdev() and > > mute_led_coef stuff are only for the mute LED control. e.g. you can > > change the mute LED independently via sysfs. > > Thanks for suggesting this. > > Having tested, I can confirm that setting this coef only affects > the output mute LED, and does not affect output. > > I will therefore assume that current implementation in my patch is OK, > but let me know if it still needs changing (maybe I've misunderstood). > > For reference to other users, the commands to test are: > # output LED on > hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x0b > hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0xa02f > > # output LED off > hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x0b > hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x7774 Could you try just to flip the bit 0x08? At LED off state? % hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x0b % hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x77f4 That is, the implementation in alc286_fixup_hp_mute_led_coefbit(), which is used by many other HP laptops. Takashi