Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: codecs: max98090: switch to standard set_jack callback
@ 2026-05-20 13:29 Srinivas Kandagatla
  2026-05-20 13:29 ` [PATCH 1/2] ASoC: codecs: max98090: use component " Srinivas Kandagatla
  2026-05-20 13:29 ` [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack Srinivas Kandagatla
  0 siblings, 2 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

The MAX98090 codec driver currently exposes a custom
max98090_mic_detect() helper for machine drivers to register a headset
jack.

This series converts the driver to use the standard component
.set_jack callback and updates the mt8173-max98090 machine driver to use
snd_soc_component_set_jack() instead of the codec-specific helper.

Using the standard callback removes the need for a custom exported
symbol and allows machine drivers to use the common ASoC jack
registration interface. This also improves compatibility with machine
drivers, such as Qualcomm platforms, that already rely on
snd_soc_component_set_jack().


Srinivas Kandagatla (2):
  ASoC: codecs: max98090: use component set_jack callback
  ASoC: mt8173-max98090: use standard callback to set jack

 sound/soc/codecs/max98090.c                 | 10 +++++-----
 sound/soc/codecs/max98090.h                 |  3 ---
 sound/soc/mediatek/mt8173/mt8173-max98090.c |  3 +--
 3 files changed, 6 insertions(+), 10 deletions(-)

-- 
2.47.3



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

* [PATCH 1/2] ASoC: codecs: max98090: use component set_jack callback
  2026-05-20 13:29 [PATCH 0/2] ASoC: codecs: max98090: switch to standard set_jack callback Srinivas Kandagatla
@ 2026-05-20 13:29 ` Srinivas Kandagatla
  2026-05-20 13:29 ` [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack Srinivas Kandagatla
  1 sibling, 0 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

The MAX98090 driver provides a custom max98090_mic_detect() helper for
machine drivers to register a jack.

This can be implemented using the standard component set_jack callback
instead. Doing so allows machine drivers to use
snd_soc_component_set_jack(), which is also the interface used by
machine drivers including Qualcomm ones.

Convert max98090_mic_detect() to a component set_jack callback and remove
the exported helper.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/codecs/max98090.c | 10 +++++-----
 sound/soc/codecs/max98090.h |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13a15459040f..bd3bfa1d3402 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2337,7 +2337,7 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
 }
 
 /**
- * max98090_mic_detect - Enable microphone detection via the MAX98090 IRQ
+ * max98090_set_jack - Enable microphone detection via the MAX98090 IRQ
  *
  * @component:  MAX98090 component
  * @jack:   jack to report detection events on
@@ -2349,12 +2349,12 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
  *
  * If no jack is supplied detection will be disabled.
  */
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack)
+static int max98090_set_jack(struct snd_soc_component *component,
+			     struct snd_soc_jack *jack, void *data)
 {
 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
 
-	dev_dbg(component->dev, "max98090_mic_detect\n");
+	dev_dbg(component->dev, "%s\n", __func__);
 
 	max98090->jack = jack;
 	if (jack) {
@@ -2377,7 +2377,6 @@ int max98090_mic_detect(struct snd_soc_component *component,
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(max98090_mic_detect);
 
 #define MAX98090_RATES SNDRV_PCM_RATE_8000_96000
 #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
@@ -2554,6 +2553,7 @@ static const struct snd_soc_component_driver soc_component_dev_max98090 = {
 	.remove			= max98090_remove,
 	.seq_notifier		= max98090_seq_notifier,
 	.set_bias_level		= max98090_set_bias_level,
+	.set_jack		= max98090_set_jack,
 	.idle_bias_on		= 1,
 	.use_pmdown_time	= 1,
 	.endianness		= 1,
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h
index 6ce8dd176e48..048af4a1376f 100644
--- a/sound/soc/codecs/max98090.h
+++ b/sound/soc/codecs/max98090.h
@@ -1543,7 +1543,4 @@ struct max98090_priv {
 	bool shdn_pending;
 };
 
-int max98090_mic_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *jack);
-
 #endif
-- 
2.47.3



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

* [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
  2026-05-20 13:29 [PATCH 0/2] ASoC: codecs: max98090: switch to standard set_jack callback Srinivas Kandagatla
  2026-05-20 13:29 ` [PATCH 1/2] ASoC: codecs: max98090: use component " Srinivas Kandagatla
@ 2026-05-20 13:29 ` Srinivas Kandagatla
  2026-05-20 13:42   ` Mark Brown
  2026-05-20 23:12   ` kernel test robot
  1 sibling, 2 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2026-05-20 13:29 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, srinivas.kandagatla,
	linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

use snd_soc_component_set_jack() instead of custom callback to
max98090 codec.

This will help other drivers using the standard callback to exercise
the standard path instead of custom callback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
 sound/soc/mediatek/mt8173/mt8173-max98090.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-max98090.c b/sound/soc/mediatek/mt8173/mt8173-max98090.c
index 49ebb67c818a..236e1f8df45a 100644
--- a/sound/soc/mediatek/mt8173/mt8173-max98090.c
+++ b/sound/soc/mediatek/mt8173/mt8173-max98090.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <sound/soc.h>
 #include <sound/jack.h>
-#include "../../codecs/max98090.h"
 
 static struct snd_soc_jack mt8173_max98090_jack;
 
@@ -78,7 +77,7 @@ static int mt8173_max98090_init(struct snd_soc_pcm_runtime *runtime)
 		return ret;
 	}
 
-	return max98090_mic_detect(component, &mt8173_max98090_jack);
+	return snd_soc_component_set_jack(component, &mt8173_max98090_jack);
 }
 
 SND_SOC_DAILINK_DEFS(playback,
-- 
2.47.3



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

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
  2026-05-20 13:29 ` [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack Srinivas Kandagatla
@ 2026-05-20 13:42   ` Mark Brown
  2026-05-20 15:34     ` Srinivas Kandagatla
  2026-05-20 23:12   ` kernel test robot
  1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2026-05-20 13:42 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek

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

On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
> use snd_soc_component_set_jack() instead of custom callback to
> max98090 codec.

This needs to be squashed into the first commit, otherwise the first
commit will cause a build break.

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

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

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
  2026-05-20 13:42   ` Mark Brown
@ 2026-05-20 15:34     ` Srinivas Kandagatla
  2026-05-20 15:41       ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Srinivas Kandagatla @ 2026-05-20 15:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek

On 5/20/26 1:42 PM, Mark Brown wrote:
> On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
>> use snd_soc_component_set_jack() instead of custom callback to
>> max98090 codec.
> 
> This needs to be squashed into the first commit, otherwise the first
> commit will cause a build break.
I had them in opposite order in my local setup, which is why it did not
break the build for me, I can send out a squashed version.

--Srini



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

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
  2026-05-20 15:34     ` Srinivas Kandagatla
@ 2026-05-20 15:41       ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-05-20 15:41 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: lgirdwood, perex, tiwai, matthias.bgg, angelogioacchino.delregno,
	sharq0406, kuninori.morimoto.gx, ckeepax, linux-sound,
	linux-kernel, linux-arm-kernel, linux-mediatek

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

On Wed, May 20, 2026 at 03:34:59PM +0000, Srinivas Kandagatla wrote:
> On 5/20/26 1:42 PM, Mark Brown wrote:
> > On Wed, May 20, 2026 at 01:29:30PM +0000, Srinivas Kandagatla wrote:
> >> use snd_soc_component_set_jack() instead of custom callback to
> >> max98090 codec.

> > This needs to be squashed into the first commit, otherwise the first
> > commit will cause a build break.

> I had them in opposite order in my local setup, which is why it did not
> break the build for me, I can send out a squashed version.

Putting this first would also be fine from a build point of view so is
probably also OK, though there would be runtime breakage (which I
imagine is why you reordered).  I'm not sure anyone will notice the
runtime bisection issue.

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

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

* Re: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
  2026-05-20 13:29 ` [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack Srinivas Kandagatla
  2026-05-20 13:42   ` Mark Brown
@ 2026-05-20 23:12   ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-05-20 23:12 UTC (permalink / raw)
  To: Srinivas Kandagatla, broonie
  Cc: oe-kbuild-all, lgirdwood, perex, tiwai, matthias.bgg,
	angelogioacchino.delregno, sharq0406, kuninori.morimoto.gx,
	ckeepax, srinivas.kandagatla, linux-sound, linux-kernel,
	linux-arm-kernel, linux-mediatek

Hi Srinivas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master v7.1-rc4 next-20260520]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Srinivas-Kandagatla/ASoC-codecs-max98090-use-component-set_jack-callback/20260520-213646
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/20260520132930.54333-3-srinivas.kandagatla%40oss.qualcomm.com
patch subject: [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20260521/202605210132.USry3Haw-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260521/202605210132.USry3Haw-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605210132.USry3Haw-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> Warning: sound/soc/codecs/max98090.c:2353 function parameter 'data' not described in 'max98090_set_jack'
>> Warning: sound/soc/codecs/max98090.c:2353 function parameter 'data' not described in 'max98090_set_jack'

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

end of thread, other threads:[~2026-05-20 23:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 13:29 [PATCH 0/2] ASoC: codecs: max98090: switch to standard set_jack callback Srinivas Kandagatla
2026-05-20 13:29 ` [PATCH 1/2] ASoC: codecs: max98090: use component " Srinivas Kandagatla
2026-05-20 13:29 ` [PATCH 2/2] ASoC: mt8173-max98090: use standard callback to set jack Srinivas Kandagatla
2026-05-20 13:42   ` Mark Brown
2026-05-20 15:34     ` Srinivas Kandagatla
2026-05-20 15:41       ` Mark Brown
2026-05-20 23:12   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox