mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
ASoC: codecs: max98090: switch to standard set_jack callback
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> says: 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(). Link: https://patch.msgid.link/20260520155002.145306-1-srinivas.kandagatla@oss.qualcomm.com
This commit is contained in:
commit
b0ffc4b644
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* mt8173-max98090.c -- MT8173 MAX98090 ALSA SoC machine driver
|
||||
|
|
@ -9,7 +10,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 +78,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, NULL);
|
||||
}
|
||||
|
||||
SND_SOC_DAILINK_DEFS(playback,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user