Skip to content

Commit 4eb94ff

Browse files
brentluplbossart
authored andcommitted
ASoC: Intel: maxim-common: support max98360a
Move max98360a code to this common module so it could be shared between multiple SOF machine drivers. MAX98357A and MAX98360A are sharing same codec driver so here we also share some function and structures. Signed-off-by: Brent Lu <brent.lu@intel.com>
1 parent 5a8b266 commit 4eb94ff

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

sound/soc/intel/boards/sof_maxim_common.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void max_98373_set_codec_conf(struct snd_soc_card *card)
134134
EXPORT_SYMBOL_NS(max_98373_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);
135135

136136
/*
137-
* Maxim MAX98357A
137+
* Maxim MAX98357A/MAX98360A
138138
*/
139139
static const struct snd_kcontrol_new max_98357a_kcontrols[] = {
140140
SOC_DAPM_PIN_SWITCH("Spk"),
@@ -156,6 +156,13 @@ static struct snd_soc_dai_link_component max_98357a_components[] = {
156156
}
157157
};
158158

159+
static struct snd_soc_dai_link_component max_98360a_components[] = {
160+
{
161+
.name = MAX_98360A_DEV0_NAME,
162+
.dai_name = MAX_98357A_CODEC_DAI,
163+
}
164+
};
165+
159166
static int max_98357a_init(struct snd_soc_pcm_runtime *rtd)
160167
{
161168
struct snd_soc_card *card = rtd->card;
@@ -193,5 +200,13 @@ void max_98357a_dai_link(struct snd_soc_dai_link *link)
193200
}
194201
EXPORT_SYMBOL_NS(max_98357a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
195202

203+
void max_98360a_dai_link(struct snd_soc_dai_link *link)
204+
{
205+
link->codecs = max_98360a_components;
206+
link->num_codecs = ARRAY_SIZE(max_98360a_components);
207+
link->init = max_98357a_init;
208+
}
209+
EXPORT_SYMBOL_NS(max_98360a_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
210+
196211
MODULE_DESCRIPTION("ASoC Intel SOF Maxim helpers");
197212
MODULE_LICENSE("GPL");

sound/soc/intel/boards/sof_maxim_common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ void max_98373_set_codec_conf(struct snd_soc_card *card);
2525
int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
2626

2727
/*
28-
* Maxim MAX98357A
28+
* Maxim MAX98357A/MAX98360A
2929
*/
3030
#define MAX_98357A_CODEC_DAI "HiFi"
3131
#define MAX_98357A_DEV0_NAME "MX98357A:00"
32+
#define MAX_98360A_DEV0_NAME "MX98360A:00"
3233

3334
void max_98357a_dai_link(struct snd_soc_dai_link *link);
35+
void max_98360a_dai_link(struct snd_soc_dai_link *link);
3436

3537
#endif /* __SOF_MAXIM_COMMON_H */

0 commit comments

Comments
 (0)