ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: "Ondřej Jirman" <megi@xff.cz>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
	 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Arnaud Ferraris <arnaud.ferraris@collabora.com>,
	Chen-Yu Tsai <wens@csie.org>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	 linux-sound@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 4/4] ASoC: sun8i-codec: Implement jack and accessory detection
Date: Thu, 22 Feb 2024 21:18:00 +0100	[thread overview]
Message-ID: <vmi3fkm47wf7cbfakubbye4ce7ol5kjpg3edkrati2lhsl6qej@57uir6fjjzq2> (raw)
In-Reply-To: <0c351386-f1df-443f-a997-261f5c60c852@sirena.org.uk>

Hello Mark,

On Thu, Feb 22, 2024 at 06:41:13PM +0000, Mark Brown wrote:
> On Thu, Feb 22, 2024 at 07:18:47PM +0100, Ondřej Jirman wrote:
> 
> > +static struct snd_soc_jack_pin sun8i_codec_jack_pins[] = {
> > +	{
> > +		.pin	= "Headphone Jack",
> > +		.mask	= SND_JACK_HEADPHONE,
> > +	},
> > +	{
> > +		.pin	= "Headset Microphone",
> > +		.mask	= SND_JACK_MICROPHONE,
> > +	},
> > +};
> > +
> 
> The jack being a headset jack is going to be system specific isn't it?
> Some systems might have separate headphone and microphone jacks.  I'd
> not expect to see any pin handling code at all in a CODEC driver, that
> belongs in the machine driver.

Yeah, the only reason this and the card reference seems to be here is to
check whether jack detection should be enabled and in what capacity.

Looks like there's some set_jack component callback for that. :)

I'll look into that.

kind regards,
	o.

> >  static int sun8i_codec_component_probe(struct snd_soc_component *component)
> >  {
> >  	struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
> >  	struct sun8i_codec *scodec = snd_soc_component_get_drvdata(component);
> >  	int ret;
> >  
> > +	scodec->card = component->card;
> > +
> 
> The fact that you're needing to look at the card here should be a bit of
> a warning sign there.



  reply	other threads:[~2024-02-22 20:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 18:18 [PATCH 0/4] Add support for jack detection to codec present in A64 SoC Ondřej Jirman
2024-02-22 18:18 ` [PATCH 1/4] ASoC: sun50i-codec-analog: Move suspend/resume to set_bias_level Ondřej Jirman
2024-02-22 18:18 ` [PATCH 2/4] ASoC: sun8i-codec: Enable bus clock at STANDBY and higher bias Ondřej Jirman
2024-02-22 18:18 ` [PATCH 3/4] ASoC: sun50i-codec-analog: Enable jack detection on startup Ondřej Jirman
2024-02-22 18:18 ` [PATCH 4/4] ASoC: sun8i-codec: Implement jack and accessory detection Ondřej Jirman
2024-02-22 18:41   ` Mark Brown
2024-02-22 20:18     ` Ondřej Jirman [this message]
2024-02-22 18:46 ` [PATCH 0/4] Add support for jack detection to codec present in A64 SoC Mark Brown

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=vmi3fkm47wf7cbfakubbye4ce7ol5kjpg3edkrati2lhsl6qej@57uir6fjjzq2 \
    --to=megi@xff.cz \
    --cc=arnaud.ferraris@collabora.com \
    --cc=broonie@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=wens@csie.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).