Skip to contentSkip to conversation

ASoC: max98095: Remove unused max98095_jack_detect

PATCH In review [email protected] 2 participants 6 messages Feb 5, 2025 – Feb 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: max98095: Remove unused max98095_jack_detect

From: "Dr. David Alan Gilbert" <[email protected]>

max98095_jack_detect() was added in 2012 as part of commit 9dd90c5db040 ("ASoC: max98095: add jack detection") but hasn't been used.

Remove it.

---
 sound/soc/codecs/max98095.c | 29 -----------------------------
 sound/soc/codecs/max98095.h |  3 ---
 2 files changed, 32 deletions(-)
sound/soc/codecs/max98095.c +0 -29
index cfb63fe69267..1d3464308ec4 100644
@@ -1884,35 +1884,6 @@ static int max98095_jack_detect_disable(struct snd_soc_component *component)
 	return ret;
 }
 
-int max98095_jack_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack)
-{
-	struct max98095_priv *max98095 = snd_soc_component_get_drvdata(component);
-	struct i2c_client *client = to_i2c_client(component->dev);
-	int ret = 0;
-
-	max98095->headphone_jack = hp_jack;
-	max98095->mic_jack = mic_jack;
-
-	/* only progress if we have at least 1 jack pointer */
-	if (!hp_jack && !mic_jack)
-		return -EINVAL;
-
-	max98095_jack_detect_enable(component);
-
-	/* enable interrupts for headphone jack detection */
-	ret = snd_soc_component_update_bits(component, M98095_013_JACK_INT_EN,
-		M98095_IDDONE, M98095_IDDONE);
-	if (ret < 0) {
-		dev_err(component->dev, "Failed to cfg jack irqs %d\n", ret);
-		return ret;
-	}
-
-	max98095_report_jack(client->irq, component);
-	return 0;
-}
-EXPORT_SYMBOL_GPL(max98095_jack_detect);
-
 #ifdef CONFIG_PM
 static int max98095_suspend(struct snd_soc_component *component)
 {
sound/soc/codecs/max98095.h +0 -3
index 2af7e77021a2..782e351debe9 100644
@@ -312,7 +312,4 @@
 /* Default Delay used in Slew Rate Calculation for Jack detection */
 #define M98095_DEFAULT_SLEW_DELAY		0x18
 
-extern int max98095_jack_detect(struct snd_soc_component *component,
-	struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack);
-
 #endif
Signature · 1 line
2.48.1
maintainer
#1 lore raw

sound/soc/codecs/max98095.c static int max98095_jack_detect_disable(struct snd_soc_component *component) · line 1914

Quoted 12 lines · On Wed, Feb 05, 2025 at 01:44:58AM +0000, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

max98095_jack_detect() was added in 2012 as part of commit 9dd90c5db040 ("ASoC: max98095: add jack detection") but hasn't been used.

Remove it.

sound/soc/codecs/max98095.c +0 -4
-	max98095_report_jack(client->irq, component);
-	return 0;
-}
-EXPORT_SYMBOL_GPL(max98095_jack_detect);

No, this is exported for machine drivers which might not be in tree.

#2 lore raw
Quoted 7 lines · * Mark Brown ([email protected]) wrote:
Quoted 6 lines · On Wed, Feb 05, 2025 at 01:44:58AM +0000, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

max98095_jack_detect() was added in 2012 as part of commit 9dd90c5db040 ("ASoC: max98095: add jack detection") but hasn't been used.

Quoted 8 lines

sound/soc/codecs/max98095.c static int max98095_jack_detect_disable(struct snd_soc_component *component) · line 1914

Quoted 6 lines

Remove it.

sound/soc/codecs/max98095.c +0 -4
-	max98095_report_jack(client->irq, component);
-	return 0;
-}
-EXPORT_SYMBOL_GPL(max98095_jack_detect);

No, this is exported for machine drivers which might not be in tree.

Ah OK; of course it would be nice if they were in the tree.

Thanks,

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#3 lore raw
Quoted 10 lines · * Dr. David Alan Gilbert ([email protected]) wrote:
Quoted 9 lines · * Mark Brown ([email protected]) wrote:
Quoted 7 lines · On Wed, Feb 05, 2025 at 01:44:58AM +0000, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

max98095_jack_detect() was added in 2012 as part of commit 9dd90c5db040 ("ASoC: max98095: add jack detection") but hasn't been used.

Remove it.

Quoted 8 lines
Quoted 6 lines

sound/soc/codecs/max98095.c static int max98095_jack_detect_disable(struct snd_soc_component *component) · line 1914

Quoted 4 lines
sound/soc/codecs/max98095.c +0 -4
-	max98095_report_jack(client->irq, component);
-	return 0;
-}
-EXPORT_SYMBOL_GPL(max98095_jack_detect);

No, this is exported for machine drivers which might not be in tree.

Ah OK; of course it would be nice if they were in the tree.

Mark:
Is that also true of mt6359_accdet_enable_jack_detect ?
I can't find any callers in tree.

Dave

Quoted 8 lines

Thanks,

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
maintainer
#4 lore raw
Quoted 9 lines · Dr. David Alan Gilbert
Quoted 3 lines · * Dr. David Alan Gilbert ([email protected]) wrote:
Quoted 1 line

No, this is exported for machine drivers which might not be in tree.

Ah OK; of course it would be nice if they were in the tree.

Is that also true of mt6359_accdet_enable_jack_detect ?
I can't find any callers in tree.

Yes, and any other jack detection control following the same pattern.

#5 lore raw
Quoted 5 lines · * Mark Brown ([email protected]) wrote:
Quoted 3 lines · Dr. David Alan Gilbert
Quoted 1 line · * Dr. David Alan Gilbert ([email protected]) wrote:
Quoted 1 line

No, this is exported for machine drivers which might not be in tree.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Ah OK; of course it would be nice if they were in the tree.

Is that also true of mt6359_accdet_enable_jack_detect ?
I can't find any callers in tree.

Yes, and any other jack detection control following the same pattern.

OK thanks.

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/