From: Takashi Iwai <tiwai@suse.de>
To: Stefan Binding <sbinding@opensource.cirrus.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>,
Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Subject: Re: [PATCH v3 1/2] ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA
Date: Wed, 20 Sep 2023 08:58:16 +0200 [thread overview]
Message-ID: <8734z9wctz.wl-tiwai@suse.de> (raw)
In-Reply-To: <20230919142240.467682-2-sbinding@opensource.cirrus.com>
On Tue, 19 Sep 2023 16:22:39 +0200,
Stefan Binding wrote:
>
> From: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
>
> Some laptops require a hardware based mute system, where when a hotkey
> is pressed, it forces the amp to be muted.
>
> For CS35L41, when the hotkey is pressed, an acpi notification is sent
> to the CS35L41 Device Node. The driver needs to handle this notification
> and call a _DSM function to retrieve the mute state.
>
> Since the amp is only muted during playback, the driver will only mute
> or unmute if playback is occurring, otherwise it will save the mute
> state for when playback starts.
>
> Only one handler can be registered for the acpi notification, but all
> amps need to receive that notification, we can register a single handler
> inside the Realtek HDA driver, so that it can then notify through the
> component framework.
>
> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
The patch is a bit lengthy. I'd split the binding of patch_realtek.c
into another patch. That part is fairly generic.
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
(snip)
> +static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
> +{
> + struct hda_codec *cdc = data;
> + struct alc_spec *spec = cdc->spec;
> + int i;
> +
> + codec_info(cdc, "ACPI Notification %d\n", event);
> +
> + for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
> + if (spec->comps[i].dev && spec->comps[i].acpi_notify)
> + spec->comps[i].acpi_notify(acpi_device_handle(spec->comps[i].adev), event,
> + spec->comps[i].dev);
> + }
> +}
This function should be in #ifdef CONFIG_ACPI, too.
thanks,
Takashi
next prev parent reply other threads:[~2023-09-20 6:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 14:22 [PATCH v3 0/2] Support mute notifications for CS35L41 HDA Stefan Binding
2023-09-19 14:22 ` [PATCH v3 1/2] ALSA: hda: cs35l41: " Stefan Binding
2023-09-19 18:18 ` kernel test robot
2023-09-20 6:58 ` Takashi Iwai [this message]
2023-09-19 14:22 ` [PATCH v3 2/2] ALSA: hda: cs35l41: Add read-only ALSA control for forced mute Stefan Binding
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=8734z9wctz.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=sbinding@opensource.cirrus.com \
--cc=tiwai@suse.com \
--cc=vitalyr@opensource.cirrus.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