alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack
       [not found] <20230325142142.24337-1-me@dylanvanassche.be>
@ 2023-03-25 14:21 ` Dylan Van Assche via Alsa-devel
  2023-03-25 18:02 ` [PATCH v3 0/1] Expose " Mark Brown
       [not found] ` <20230325142142.24337-2-me@dylanvanassche.be>
  2 siblings, 0 replies; 3+ messages in thread
From: Dylan Van Assche via Alsa-devel @ 2023-03-25 14:21 UTC (permalink / raw)
  To: Banajit Goswami, Jaroslav Kysela, Takashi Iwai
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, alsa-devel,
	linux-kernel, ~postmarketos/upstreaming, phone-devel,
	Dylan Van Assche, Joel Selvaraj, Caleb Connolly


[-- Attachment #0: Type: message/rfc822, Size: 5485 bytes --]

From: Dylan Van Assche <me@dylanvanassche.be>
To: Banajit Goswami <bgoswami@quicinc.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Dylan Van Assche <me@dylanvanassche.be>, Joel Selvaraj <joelselvaraj.oss@gmail.com>, Caleb Connolly <caleb@connolly.tech>
Subject: [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack
Date: Sat, 25 Mar 2023 15:21:42 +0100
Message-ID: <20230325142142.24337-2-me@dylanvanassche.be>

Jack detection is currently fully functional via the input
interface together with multimedia buttons, but is not exposed
as an ALSA control. Therefore, ALSA clients such as PulseAudio
do not pick up the jack detection events as they only support
one of the possible interface (ALSA control or input interface,
but not both). Expose the jack events as an ALSA control and input
interface to provide ALSA clients both interfaces.

Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
Tested-by: Joel Selvaraj <joelselvaraj.oss@gmail.com>
Tested-by: Caleb Connolly <caleb@connolly.tech>
---
 sound/soc/codecs/wcd-mbhc-v2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index 1911750f7445..1b75f49b2858 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -725,6 +725,10 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
 
 	mutex_lock(&mbhc->lock);
 
+	ret = snd_jack_add_new_kctl(mbhc->jack->jack, "Headset Jack", WCD_MBHC_JACK_MASK);
+	if (ret)
+		dev_warn(component->dev, "failed creating Headset Jack kctl with err: %d\n", ret);
+
 	/* enable HS detection */
 	if (mbhc->mbhc_cb->hph_pull_up_control_v2)
 		mbhc->mbhc_cb->hph_pull_up_control_v2(component,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 0/1] Expose ALSA control for jack
       [not found] <20230325142142.24337-1-me@dylanvanassche.be>
  2023-03-25 14:21 ` [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack Dylan Van Assche via Alsa-devel
@ 2023-03-25 18:02 ` Mark Brown
       [not found] ` <20230325142142.24337-2-me@dylanvanassche.be>
  2 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-03-25 18:02 UTC (permalink / raw)
  To: Dylan Van Assche
  Cc: Banajit Goswami, Takashi Iwai, Srinivas Kandagatla,
	Liam Girdwood, alsa-devel, linux-kernel,
	~postmarketos/upstreaming, phone-devel

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Sat, Mar 25, 2023 at 03:21:41PM +0100, Dylan Van Assche wrote:
> Qualcomm SDM845 features a headphone jack via a Qualcomm WCD9340
> codec which has jack detection through the wcd-mbhc-v2 driver.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff.  This reduces mail volume and ensures that 
any important information is recorded in the changelog rather than being
lost. 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack
       [not found] ` <20230325142142.24337-2-me@dylanvanassche.be>
@ 2023-03-25 18:12   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-03-25 18:12 UTC (permalink / raw)
  To: Dylan Van Assche
  Cc: Banajit Goswami, Takashi Iwai, Srinivas Kandagatla,
	Liam Girdwood, alsa-devel, linux-kernel,
	~postmarketos/upstreaming, phone-devel, Joel Selvaraj,
	Caleb Connolly

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Sat, Mar 25, 2023 at 03:21:42PM +0100, Dylan Van Assche wrote:

>  
>  	mutex_lock(&mbhc->lock);
>  
> +	ret = snd_jack_add_new_kctl(mbhc->jack->jack, "Headset Jack", WCD_MBHC_JACK_MASK);
> +	if (ret)
> +		dev_warn(component->dev, "failed creating Headset Jack kctl with err: %d\n", ret);
> +

No, drivers should not be open coding userspace reporting - there
is no reason for this device to be special, or for this device to
duplicate what machine drivers and the core are doing.  Any
configuration should be done by the machine driver, the ASoC core
jack handling already creates userspace controls when asked.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-25 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230325142142.24337-1-me@dylanvanassche.be>
2023-03-25 14:21 ` [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose ALSA control for jack Dylan Van Assche via Alsa-devel
2023-03-25 18:02 ` [PATCH v3 0/1] Expose " Mark Brown
     [not found] ` <20230325142142.24337-2-me@dylanvanassche.be>
2023-03-25 18:12   ` [PATCH v3 1/1] sound: soc: codecs: wcd-mbhc-v2: expose " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).