public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Astrid Rost <astrid.rost@axis.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	kernel@axis.com,
	alsa-devel-mejlinglistan <alsa-devel@alsa-project.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: ts3a227e: allow enabling the jack detect in driver
Date: Fri, 9 Sep 2022 18:45:25 +0100	[thread overview]
Message-ID: <Yxt7tfm6MRMaDthO@sirena.org.uk> (raw)
In-Reply-To: <20220909093001.13110-1-astrid.rost@axis.com>

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

On Fri, Sep 09, 2022 at 11:30:01AM +0200, Astrid Rost wrote:

> ti,jack-detect enables the jack detection input device

New properties need to be documented, I'm happy for that to be in the
existing document though obviously a conversion to YAML would be very
much appreciated.  However...

> +	if (enable) {
> +		/* Enable Headset and 4 Buttons Jack detection */
> +		ts3a227e->jack = devm_kzalloc(component->dev,
> +				sizeof(struct snd_soc_jack), GFP_KERNEL);
> +
> +		ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
> +					    SND_JACK_HEADSET |
> +					    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
> +					    SND_JACK_BTN_2 | SND_JACK_BTN_3,
> +					    ts3a227e->jack,
> +					    ts3a227e_jack_pins,
> +					    ARRAY_SIZE(ts3a227e_jack_pins));
> +		if (ret)
> +			return ret;
> +
> +		ret = ts3a227e_enable_jack_detect(component, ts3a227e->jack);
> +	}

...this is something that should be done in the machine driver rather
than the CODEC, the way the device is wired up in an individual system
may be surprising or the system may have some more specific labelling
that can be usefully applied so this is all deferred to the card.

It would sense to convert ts3a277e_enable_jack_detect() to be a
component set_jack() operation, that'd enable it to be used more easily
with generic cards (though I see that it's not yet wired up for
audio-graph-card unfortunately).

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

  reply	other threads:[~2022-09-09 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  9:30 [PATCH] ASoC: ts3a227e: allow enabling the jack detect in driver Astrid Rost
2022-09-09 17:45 ` Mark Brown [this message]
2022-09-12  7:17   ` Astrid Rost
2022-09-10  2:17 ` kernel test robot
2022-09-10 14:37 ` 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=Yxt7tfm6MRMaDthO@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=astrid.rost@axis.com \
    --cc=kernel@axis.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --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