From: Takashi Iwai <tiwai@suse.de>
To: Jonathan Clarke <jonathan.a.clarke@gmail.com>
Cc: linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
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
Date: Sat, 30 Oct 2021 12:01:03 +0200 [thread overview]
Message-ID: <s5h35oisug0.wl-tiwai@suse.de> (raw)
In-Reply-To: <20211029154313.1005394-1-jonathan.a.clarke@gmail.com>
On Fri, 29 Oct 2021 17:43:13 +0200,
Jonathan Clarke wrote:
>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210633
> Signed-off-by: Jonathan Clarke <jonathan.a.clarke@gmail.com>
Could you give more descriptions? The patch isn't trivial at all, and
it needs more explanations.
> ---
> sound/pci/hda/patch_realtek.c | 46 +++++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index 22d27b12c..e3c6d17ea 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -4409,6 +4409,13 @@ static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
> case HDA_FIXUP_ACT_PRE_PROBE:
> spec->gpio_mask |= 0x01;
> spec->gpio_dir |= 0x01;
> +
> + /* use only amp at 0x02 for bottom(front) speaker,
> + * otherwise it is set to use 0x02,0x03,0x06 and when used in conjunction
> + * with top(rear) speaker 0x14, gets locked at full volume */
> + static const hda_nid_t conn1[] = { 0x02 };
> + snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
> +
> break;
> case HDA_FIXUP_ACT_INIT:
> /* need to toggle GPIO to enable the amp */
> @@ -4503,6 +4510,26 @@ static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
> }
> }
>
> +static void alc245_fixup_hp_x360_mute_leds(struct hda_codec *codec,
> + const struct hda_fixup *fix, int action)
> +{
> + struct alc_spec *spec = codec->spec;
> + if (action == HDA_FIXUP_ACT_PRE_PROBE) {
> + /* mic mute is set via gpio 0x04 */
> + spec->micmute_led_polarity = 1;
> + codec->power_filter = led_power_filter;
> + alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
> +
> + /* 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,
Takashi
next prev parent reply other threads:[~2021-10-30 10:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 15:43 [PATCH] Make top/rear speaker, mute and micmute leds work on HP x360 14-ea000 laptops that use Realtek 245 codec Jonathan Clarke
2021-10-30 10:01 ` Takashi Iwai [this message]
2021-11-01 10:34 ` Jonathan Clarke
2021-11-02 8:19 ` Takashi Iwai
2021-11-02 12:45 ` Jonathan Clarke
2021-10-31 3:33 ` kernel test robot
2021-10-31 17:23 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5h35oisug0.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=jonathan.a.clarke@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox