Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Trevor Wu" <trevor.wu@mediatek.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>
Cc: kernel@collabora.com, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Zoran Zhan <zoran.zhan@mediatek.com>
Subject: Re: [PATCH v2 3/3] ASoC: mediatek: mt8188-mt6359: Add accdet headset jack detect support
Date: Wed, 5 Mar 2025 18:18:41 +0100	[thread overview]
Message-ID: <59d0d382-1d15-46c4-b9e4-b66c32c188d3@collabora.com> (raw)
In-Reply-To: <20250304-mt8188-accdet-v2-3-27f496c4aede@collabora.com>

Il 04/03/25 22:35, Nícolas F. R. A. Prado ha scritto:
> Enable headset jack detection for MT8188 platforms that use the MT6359
> ACCDET block for it, indicated by the mediatek,accdet property in DT.
> For those platforms, register a jack and initialize the ACCDET block to
> report jack events through it.
> 
> Co-developed-by: Zoran Zhan <zoran.zhan@mediatek.com>
> Signed-off-by: Zoran Zhan <zoran.zhan@mediatek.com>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

We chatted about the issue that I raised before with mt8188_headset_jack_pins[],
it's fine to have it for now, as whatever we do with that would still duplicate
things and there's no way around that for now.

The sound card driver should get a bigger cleanup anyway, and it's not really
possible even because otherwise we'd break UCM2 confs, so it is what it is.

> ---
>   sound/soc/mediatek/Kconfig                |  1 +
>   sound/soc/mediatek/mt8188/mt8188-mt6359.c | 43 +++++++++++++++++++++++++++++++
>   2 files changed, 44 insertions(+)
> 
> diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
> index 3033e2d3fe16840631a465dd967da77f7a6ff43c..64155ea7965a1cc50593fef442ce90761836f328 100644
> --- a/sound/soc/mediatek/Kconfig
> +++ b/sound/soc/mediatek/Kconfig
> @@ -237,6 +237,7 @@ config SND_SOC_MT8188_MT6359
>   	select SND_SOC_NAU8825
>   	select SND_SOC_RT5682S
>   	select SND_SOC_ES8326
> +	select SND_SOC_MT6359_ACCDET

The only remaining complaint that I have is that this driver shouldn't really
add a select SND_SOC_MT6359_ACCDET.

Instead, the mt6359-accdet.h header should be modified to stub-ify the accdet
driver functions in the case in which it's not built in, or not available as a
module anyway.

This is because the accdet driver is not *mandatory* for this driver to work,
and being it an optional peripheral, adding a dependency doesn't really make
a lot of sense as it'd only force in bloat when not wanted.

So...

Get to that mt6359-accdet.h header and:

#if IS_ENABLED(CONFIG_SND_SOC_MT6359_ACCDET)

function signatures

#else

static .... { return -EINVAL; (or whatever else) }

#endif

That said, for the future v3 of this commit, after removing the select
SND_SOC_MT6359_ACCDET (and granted that the proposed header fix is in place),
you can add my

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo




  reply	other threads:[~2025-03-05 17:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 21:35 [PATCH v2 0/3] Allow retrieving accessory detection reference on MT8188 Nícolas F. R. A. Prado
2025-03-04 21:35 ` [PATCH v2 1/3] ASoC: dt-bindings: mediatek,mt8188-mt6359: Add mediatek,accdet Nícolas F. R. A. Prado
2025-03-04 21:35 ` [PATCH v2 2/3] ASoC: mediatek: common: Handle mediatek,accdet property Nícolas F. R. A. Prado
2025-03-04 21:35 ` [PATCH v2 3/3] ASoC: mediatek: mt8188-mt6359: Add accdet headset jack detect support Nícolas F. R. A. Prado
2025-03-05 17:18   ` AngeloGioacchino Del Regno [this message]
2025-03-05 17:23     ` Mark Brown
2025-03-05 19:20       ` Nícolas F. R. A. Prado

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=59d0d382-1d15-46c4-b9e4-b66c32c188d3@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    --cc=trevor.wu@mediatek.com \
    --cc=zoran.zhan@mediatek.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