Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3960523pxb; Tue, 2 Nov 2021 01:22:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqjI629EEeJGiKTS71E8B3hA1UBznrOSEbpt1AN7zMYoEVKEm9HEaLR8Egih9somkx5nJu X-Received: by 2002:a05:6602:3156:: with SMTP id m22mr24314426ioy.19.1635841346772; Tue, 02 Nov 2021 01:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635841346; cv=none; d=google.com; s=arc-20160816; b=zr28i3JpnuSHDJPBlIRDJMnVF77jQScF9P9vX6kS1+30I+fEufBPqJhZMjB4M+Eom4 1+pn3UV3fTxGn7PFpojLq24h7/el3oNLYeO2chmM8RCFCiTCiWcNY4XyMF0Vanh5XGZj 2cki//MUocgRgvkSPJMIQ6Fe6QnvgKrF+pYFvy/KwYjSDeaS14wDeC72+8tWghxiZQ/r uIN1oUbgI3NiS4XK4Q/hagBtM9KK5dhlhiUSy8hN60NhO6BSLreZmJzX0QYmTeIHqHmz GnUaDX+NZX9BAg7nFdiK747DA6FFiBIVXXzb8bYmCsbaX6TyI+nDat5wmC53lXQk174j uFZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=9742+b7cYgGp8HGz78oVyltHXm7JrBnwMm8ZZHyByL4=; b=Wx5d0wCvydsUq5egb1xUF4aXh3ItKAbR5d3c/XU9LlCH8OyXJLx+kOLz4ztBYdTkUQ zkdEU220oqCgGe+My/55ByyviR6A0qzL4vYbaPxekbjwnH+BQfy0/J4iONWaZhkg+vJN carTcHjgPoBuodQ7UUFhPJZdQmfPeCDuCet1cmpz3vfvipTE/TdLoI5Bs79G1Gv6alFs YaWdUHVsJdqQuWyzgDWIdMR/rafTKZ7UZY3bVREfxAtKegGOzkKF03JstCk1u6My+K5y xTbRqpski5ewx5+0pKg/hApI0JTwLY7JUJ+yHWf/nTGTRYOlyTolZOrlWrKWBdCfuBKG 1KYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=d+l0GKh4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si20735743ior.71.2021.11.02.01.22.14; Tue, 02 Nov 2021 01:22:26 -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=@suse.de header.s=susede2_rsa header.b=d+l0GKh4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbhKBIWW (ORCPT + 99 others); Tue, 2 Nov 2021 04:22:22 -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