1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright(c) 2019 Intel Corporation.
5 * Intel SOF Machine Driver with Realtek rt5682 Codec
6 * and speaker codec MAX98357A
9 #include <linux/input.h>
10 #include <linux/module.h>
11 #include <linux/platform_device.h>
12 #include <linux/clk.h>
13 #include <linux/dmi.h>
14 #include <sound/core.h>
15 #include <sound/jack.h>
16 #include <sound/pcm.h>
17 #include <sound/pcm_params.h>
18 #include <sound/soc.h>
19 #include <sound/rt5682.h>
20 #include <sound/soc-acpi.h>
21 #include "../../codecs/rt5682.h"
22 #include "../../codecs/hdac_hdmi.h"
23 #include "../common/soc-intel-quirks.h"
24 #include "hda_dsp_common.h"
28 #define SOF_RT5682_SSP_CODEC(quirk) ((quirk) & GENMASK(2, 0))
29 #define SOF_RT5682_SSP_CODEC_MASK (GENMASK(2, 0))
30 #define SOF_RT5682_MCLK_EN BIT(3)
31 #define SOF_RT5682_MCLK_24MHZ BIT(4)
32 #define SOF_SPEAKER_AMP_PRESENT BIT(5)
33 #define SOF_RT5682_SSP_AMP_SHIFT 6
34 #define SOF_RT5682_SSP_AMP_MASK (GENMASK(8, 6))
35 #define SOF_RT5682_SSP_AMP(quirk) \
36 (((quirk) << SOF_RT5682_SSP_AMP_SHIFT) & SOF_RT5682_SSP_AMP_MASK)
37 #define SOF_RT5682_MCLK_BYTCHT_EN BIT(9)
38 #define SOF_RT5682_NUM_HDMIDEV_SHIFT 10
39 #define SOF_RT5682_NUM_HDMIDEV_MASK (GENMASK(12, 10))
40 #define SOF_RT5682_NUM_HDMIDEV(quirk) \
41 ((quirk << SOF_RT5682_NUM_HDMIDEV_SHIFT) & SOF_RT5682_NUM_HDMIDEV_MASK)
43 /* Default: MCLK on, MCLK 19.2M, SSP0 */
44 static unsigned long sof_rt5682_quirk
= SOF_RT5682_MCLK_EN
|
45 SOF_RT5682_SSP_CODEC(0);
47 static int is_legacy_cpu
;
49 static struct snd_soc_jack sof_hdmi
[3];
52 struct list_head head
;
53 struct snd_soc_dai
*codec_dai
;
57 struct sof_card_private
{
59 struct snd_soc_jack sof_headset
;
60 struct list_head hdmi_pcm_list
;
61 bool common_hdmi_codec_drv
;
64 static int sof_rt5682_quirk_cb(const struct dmi_system_id
*id
)
66 sof_rt5682_quirk
= (unsigned long)id
->driver_data
;
70 static const struct dmi_system_id sof_rt5682_quirk_table
[] = {
72 .callback
= sof_rt5682_quirk_cb
,
74 DMI_MATCH(DMI_SYS_VENDOR
, "Circuitco"),
75 DMI_MATCH(DMI_PRODUCT_NAME
, "Minnowboard Max"),
77 .driver_data
= (void *)(SOF_RT5682_SSP_CODEC(2)),
80 .callback
= sof_rt5682_quirk_cb
,
82 DMI_MATCH(DMI_SYS_VENDOR
, "AAEON"),
83 DMI_MATCH(DMI_PRODUCT_NAME
, "UP-CHT01"),
85 .driver_data
= (void *)(SOF_RT5682_SSP_CODEC(2)),
88 .callback
= sof_rt5682_quirk_cb
,
90 DMI_MATCH(DMI_SYS_VENDOR
, "Intel Corporation"),
91 DMI_MATCH(DMI_PRODUCT_NAME
, "WhiskeyLake Client"),
93 .driver_data
= (void *)(SOF_RT5682_MCLK_EN
|
94 SOF_RT5682_MCLK_24MHZ
|
95 SOF_RT5682_SSP_CODEC(1)),
98 .callback
= sof_rt5682_quirk_cb
,
100 DMI_MATCH(DMI_PRODUCT_FAMILY
, "Google_Hatch"),
102 .driver_data
= (void *)(SOF_RT5682_MCLK_EN
|
103 SOF_RT5682_MCLK_24MHZ
|
104 SOF_RT5682_SSP_CODEC(0) |
105 SOF_SPEAKER_AMP_PRESENT
|
106 SOF_RT5682_SSP_AMP(1)),
109 .callback
= sof_rt5682_quirk_cb
,
111 DMI_MATCH(DMI_SYS_VENDOR
, "Intel Corporation"),
112 DMI_MATCH(DMI_PRODUCT_NAME
, "Ice Lake Client"),
114 .driver_data
= (void *)(SOF_RT5682_MCLK_EN
|
115 SOF_RT5682_SSP_CODEC(0)),
120 static int sof_hdmi_init(struct snd_soc_pcm_runtime
*rtd
)
122 struct sof_card_private
*ctx
= snd_soc_card_get_drvdata(rtd
->card
);
123 struct snd_soc_dai
*dai
= rtd
->codec_dai
;
124 struct sof_hdmi_pcm
*pcm
;
126 pcm
= devm_kzalloc(rtd
->card
->dev
, sizeof(*pcm
), GFP_KERNEL
);
130 /* dai_link id is 1:1 mapped to the PCM device */
131 pcm
->device
= rtd
->dai_link
->id
;
132 pcm
->codec_dai
= dai
;
134 list_add_tail(&pcm
->head
, &ctx
->hdmi_pcm_list
);
139 static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime
*rtd
)
141 struct sof_card_private
*ctx
= snd_soc_card_get_drvdata(rtd
->card
);
142 struct snd_soc_component
*component
= rtd
->codec_dai
->component
;
143 struct snd_soc_jack
*jack
;
146 /* need to enable ASRC function for 24MHz mclk rate */
147 if ((sof_rt5682_quirk
& SOF_RT5682_MCLK_EN
) &&
148 (sof_rt5682_quirk
& SOF_RT5682_MCLK_24MHZ
)) {
149 rt5682_sel_asrc_clk_src(component
, RT5682_DA_STEREO1_FILTER
|
150 RT5682_AD_STEREO1_FILTER
,
151 RT5682_CLK_SEL_I2S1_ASRC
);
154 if (sof_rt5682_quirk
& SOF_RT5682_MCLK_BYTCHT_EN
) {
156 * The firmware might enable the clock at
157 * boot (this information may or may not
158 * be reflected in the enable clock register).
159 * To change the rate we must disable the clock
160 * first to cover these cases. Due to common
161 * clock framework restrictions that do not allow
162 * to disable a clock that has not been enabled,
163 * we need to enable the clock first.
165 ret
= clk_prepare_enable(ctx
->mclk
);
167 clk_disable_unprepare(ctx
->mclk
);
169 ret
= clk_set_rate(ctx
->mclk
, 19200000);
172 dev_err(rtd
->dev
, "unable to set MCLK rate\n");
176 * Headset buttons map to the google Reference headset.
177 * These can be configured by userspace.
179 ret
= snd_soc_card_jack_new(rtd
->card
, "Headset Jack",
180 SND_JACK_HEADSET
| SND_JACK_BTN_0
|
181 SND_JACK_BTN_1
| SND_JACK_BTN_2
|
183 &ctx
->sof_headset
, NULL
, 0);
185 dev_err(rtd
->dev
, "Headset Jack creation failed: %d\n", ret
);
189 jack
= &ctx
->sof_headset
;
191 snd_jack_set_key(jack
->jack
, SND_JACK_BTN_0
, KEY_PLAYPAUSE
);
192 snd_jack_set_key(jack
->jack
, SND_JACK_BTN_1
, KEY_VOICECOMMAND
);
193 snd_jack_set_key(jack
->jack
, SND_JACK_BTN_2
, KEY_VOLUMEUP
);
194 snd_jack_set_key(jack
->jack
, SND_JACK_BTN_3
, KEY_VOLUMEDOWN
);
195 ret
= snd_soc_component_set_jack(component
, jack
, NULL
);
198 dev_err(rtd
->dev
, "Headset Jack call-back failed: %d\n", ret
);
205 static int sof_rt5682_hw_params(struct snd_pcm_substream
*substream
,
206 struct snd_pcm_hw_params
*params
)
208 struct snd_soc_pcm_runtime
*rtd
= substream
->private_data
;
209 struct sof_card_private
*ctx
= snd_soc_card_get_drvdata(rtd
->card
);
210 struct snd_soc_dai
*codec_dai
= rtd
->codec_dai
;
211 int clk_id
, clk_freq
, pll_out
, ret
;
213 if (sof_rt5682_quirk
& SOF_RT5682_MCLK_EN
) {
214 if (sof_rt5682_quirk
& SOF_RT5682_MCLK_BYTCHT_EN
) {
215 ret
= clk_prepare_enable(ctx
->mclk
);
218 "could not configure MCLK state");
223 clk_id
= RT5682_PLL1_S_MCLK
;
224 if (sof_rt5682_quirk
& SOF_RT5682_MCLK_24MHZ
)
229 clk_id
= RT5682_PLL1_S_BCLK1
;
230 clk_freq
= params_rate(params
) * 50;
233 pll_out
= params_rate(params
) * 512;
235 ret
= snd_soc_dai_set_pll(codec_dai
, 0, clk_id
, clk_freq
, pll_out
);
237 dev_err(rtd
->dev
, "snd_soc_dai_set_pll err = %d\n", ret
);
239 /* Configure sysclk for codec */
240 ret
= snd_soc_dai_set_sysclk(codec_dai
, RT5682_SCLK_S_PLL1
,
241 pll_out
, SND_SOC_CLOCK_IN
);
243 dev_err(rtd
->dev
, "snd_soc_dai_set_sysclk err = %d\n", ret
);
246 * slot_width should equal or large than data length, set them
249 ret
= snd_soc_dai_set_tdm_slot(codec_dai
, 0x0, 0x0, 2,
250 params_width(params
));
252 dev_err(rtd
->dev
, "set TDM slot err:%d\n", ret
);
259 static struct snd_soc_ops sof_rt5682_ops
= {
260 .hw_params
= sof_rt5682_hw_params
,
263 static struct snd_soc_dai_link_component platform_component
[] = {
265 /* name might be overridden during probe */
266 .name
= "0000:00:1f.3"
270 static int sof_card_late_probe(struct snd_soc_card
*card
)
272 struct sof_card_private
*ctx
= snd_soc_card_get_drvdata(card
);
273 struct snd_soc_component
*component
= NULL
;
274 char jack_name
[NAME_SIZE
];
275 struct sof_hdmi_pcm
*pcm
;
279 /* HDMI is not supported by SOF on Baytrail/CherryTrail */
283 pcm
= list_first_entry(&ctx
->hdmi_pcm_list
, struct sof_hdmi_pcm
,
285 component
= pcm
->codec_dai
->component
;
287 if (ctx
->common_hdmi_codec_drv
)
288 return hda_dsp_hdmi_build_controls(card
, component
);
290 list_for_each_entry(pcm
, &ctx
->hdmi_pcm_list
, head
) {
291 component
= pcm
->codec_dai
->component
;
292 snprintf(jack_name
, sizeof(jack_name
),
293 "HDMI/DP, pcm=%d Jack", pcm
->device
);
294 err
= snd_soc_card_jack_new(card
, jack_name
,
295 SND_JACK_AVOUT
, &sof_hdmi
[i
],
301 err
= hdac_hdmi_jack_init(pcm
->codec_dai
, pcm
->device
,
311 return hdac_hdmi_jack_port_init(component
, &card
->dapm
);
314 static const struct snd_kcontrol_new sof_controls
[] = {
315 SOC_DAPM_PIN_SWITCH("Headphone Jack"),
316 SOC_DAPM_PIN_SWITCH("Headset Mic"),
317 SOC_DAPM_PIN_SWITCH("Spk"),
320 static const struct snd_soc_dapm_widget sof_widgets
[] = {
321 SND_SOC_DAPM_HP("Headphone Jack", NULL
),
322 SND_SOC_DAPM_MIC("Headset Mic", NULL
),
323 SND_SOC_DAPM_SPK("Spk", NULL
),
326 static const struct snd_soc_dapm_widget dmic_widgets
[] = {
327 SND_SOC_DAPM_MIC("SoC DMIC", NULL
),
330 static const struct snd_soc_dapm_route sof_map
[] = {
331 /* HP jack connectors - unknown if we have jack detection */
332 { "Headphone Jack", NULL
, "HPOL" },
333 { "Headphone Jack", NULL
, "HPOR" },
336 { "IN1P", NULL
, "Headset Mic" },
339 static const struct snd_soc_dapm_route speaker_map
[] = {
341 { "Spk", NULL
, "Speaker" },
344 static const struct snd_soc_dapm_route dmic_map
[] = {
346 {"DMic", NULL
, "SoC DMIC"},
349 static int speaker_codec_init(struct snd_soc_pcm_runtime
*rtd
)
351 struct snd_soc_card
*card
= rtd
->card
;
354 ret
= snd_soc_dapm_add_routes(&card
->dapm
, speaker_map
,
355 ARRAY_SIZE(speaker_map
));
358 dev_err(rtd
->dev
, "Speaker map addition failed: %d\n", ret
);
362 static int dmic_init(struct snd_soc_pcm_runtime
*rtd
)
364 struct snd_soc_card
*card
= rtd
->card
;
367 ret
= snd_soc_dapm_new_controls(&card
->dapm
, dmic_widgets
,
368 ARRAY_SIZE(dmic_widgets
));
370 dev_err(card
->dev
, "DMic widget addition failed: %d\n", ret
);
371 /* Don't need to add routes if widget addition failed */
375 ret
= snd_soc_dapm_add_routes(&card
->dapm
, dmic_map
,
376 ARRAY_SIZE(dmic_map
));
379 dev_err(card
->dev
, "DMic map addition failed: %d\n", ret
);
384 /* sof audio machine driver for rt5682 codec */
385 static struct snd_soc_card sof_audio_card_rt5682
= {
386 .name
= "rt5682", /* the sof- prefix is added by the core */
387 .owner
= THIS_MODULE
,
388 .controls
= sof_controls
,
389 .num_controls
= ARRAY_SIZE(sof_controls
),
390 .dapm_widgets
= sof_widgets
,
391 .num_dapm_widgets
= ARRAY_SIZE(sof_widgets
),
392 .dapm_routes
= sof_map
,
393 .num_dapm_routes
= ARRAY_SIZE(sof_map
),
394 .fully_routed
= true,
395 .late_probe
= sof_card_late_probe
,
398 static struct snd_soc_dai_link_component rt5682_component
[] = {
400 .name
= "i2c-10EC5682:00",
401 .dai_name
= "rt5682-aif1",
405 static struct snd_soc_dai_link_component dmic_component
[] = {
407 .name
= "dmic-codec",
408 .dai_name
= "dmic-hifi",
412 static struct snd_soc_dai_link_component max98357a_component
[] = {
414 .name
= "MX98357A:00",
419 static struct snd_soc_dai_link
*sof_card_dai_links_create(struct device
*dev
,
425 struct snd_soc_dai_link_component
*idisp_components
;
426 struct snd_soc_dai_link_component
*cpus
;
427 struct snd_soc_dai_link
*links
;
430 links
= devm_kzalloc(dev
, sizeof(struct snd_soc_dai_link
) *
431 sof_audio_card_rt5682
.num_links
, GFP_KERNEL
);
432 cpus
= devm_kzalloc(dev
, sizeof(struct snd_soc_dai_link_component
) *
433 sof_audio_card_rt5682
.num_links
, GFP_KERNEL
);
438 links
[id
].name
= devm_kasprintf(dev
, GFP_KERNEL
,
439 "SSP%d-Codec", ssp_codec
);
444 links
[id
].codecs
= rt5682_component
;
445 links
[id
].num_codecs
= ARRAY_SIZE(rt5682_component
);
446 links
[id
].platforms
= platform_component
;
447 links
[id
].num_platforms
= ARRAY_SIZE(platform_component
);
448 links
[id
].init
= sof_rt5682_codec_init
;
449 links
[id
].ops
= &sof_rt5682_ops
;
450 links
[id
].nonatomic
= true;
451 links
[id
].dpcm_playback
= 1;
452 links
[id
].dpcm_capture
= 1;
453 links
[id
].no_pcm
= 1;
454 links
[id
].cpus
= &cpus
[id
];
455 links
[id
].num_cpus
= 1;
457 links
[id
].cpus
->dai_name
= devm_kasprintf(dev
, GFP_KERNEL
,
460 if (!links
[id
].cpus
->dai_name
)
464 * Currently, On SKL+ platforms MCLK will be turned off in sof
465 * runtime suspended, and it will go into runtime suspended
466 * right after playback is stop. However, rt5682 will output
467 * static noise if sysclk turns off during playback. Set
468 * ignore_pmdown_time to power down rt5682 immediately and
470 * It can be removed once we can control MCLK by driver.
472 links
[id
].ignore_pmdown_time
= 1;
473 links
[id
].cpus
->dai_name
= devm_kasprintf(dev
, GFP_KERNEL
,
476 if (!links
[id
].cpus
->dai_name
)
482 if (dmic_be_num
> 0) {
483 /* at least we have dmic01 */
484 links
[id
].name
= "dmic01";
485 links
[id
].cpus
= &cpus
[id
];
486 links
[id
].cpus
->dai_name
= "DMIC01 Pin";
487 links
[id
].init
= dmic_init
;
488 if (dmic_be_num
> 1) {
489 /* set up 2 BE links at most */
490 links
[id
+ 1].name
= "dmic16k";
491 links
[id
+ 1].cpus
= &cpus
[id
+ 1];
492 links
[id
+ 1].cpus
->dai_name
= "DMIC16k Pin";
497 for (i
= 0; i
< dmic_be_num
; i
++) {
499 links
[id
].num_cpus
= 1;
500 links
[id
].codecs
= dmic_component
;
501 links
[id
].num_codecs
= ARRAY_SIZE(dmic_component
);
502 links
[id
].platforms
= platform_component
;
503 links
[id
].num_platforms
= ARRAY_SIZE(platform_component
);
504 links
[id
].ignore_suspend
= 1;
505 links
[id
].dpcm_capture
= 1;
506 links
[id
].no_pcm
= 1;
512 idisp_components
= devm_kzalloc(dev
,
513 sizeof(struct snd_soc_dai_link_component
) *
514 hdmi_num
, GFP_KERNEL
);
515 if (!idisp_components
)
518 for (i
= 1; i
<= hdmi_num
; i
++) {
519 links
[id
].name
= devm_kasprintf(dev
, GFP_KERNEL
,
525 links
[id
].cpus
= &cpus
[id
];
526 links
[id
].num_cpus
= 1;
527 links
[id
].cpus
->dai_name
= devm_kasprintf(dev
, GFP_KERNEL
,
529 if (!links
[id
].cpus
->dai_name
)
532 idisp_components
[i
- 1].name
= "ehdaudio0D2";
533 idisp_components
[i
- 1].dai_name
= devm_kasprintf(dev
,
537 if (!idisp_components
[i
- 1].dai_name
)
540 links
[id
].codecs
= &idisp_components
[i
- 1];
541 links
[id
].num_codecs
= 1;
542 links
[id
].platforms
= platform_component
;
543 links
[id
].num_platforms
= ARRAY_SIZE(platform_component
);
544 links
[id
].init
= sof_hdmi_init
;
545 links
[id
].dpcm_playback
= 1;
546 links
[id
].no_pcm
= 1;
551 if (sof_rt5682_quirk
& SOF_SPEAKER_AMP_PRESENT
) {
552 links
[id
].name
= devm_kasprintf(dev
, GFP_KERNEL
,
553 "SSP%d-Codec", ssp_amp
);
558 links
[id
].codecs
= max98357a_component
;
559 links
[id
].num_codecs
= ARRAY_SIZE(max98357a_component
);
560 links
[id
].platforms
= platform_component
;
561 links
[id
].num_platforms
= ARRAY_SIZE(platform_component
);
562 links
[id
].init
= speaker_codec_init
,
563 links
[id
].nonatomic
= true;
564 links
[id
].dpcm_playback
= 1;
565 links
[id
].no_pcm
= 1;
566 links
[id
].cpus
= &cpus
[id
];
567 links
[id
].num_cpus
= 1;
569 links
[id
].cpus
->dai_name
= devm_kasprintf(dev
, GFP_KERNEL
,
572 if (!links
[id
].cpus
->dai_name
)
576 links
[id
].cpus
->dai_name
= devm_kasprintf(dev
, GFP_KERNEL
,
579 if (!links
[id
].cpus
->dai_name
)
589 static int sof_audio_probe(struct platform_device
*pdev
)
591 struct snd_soc_dai_link
*dai_links
;
592 struct snd_soc_acpi_mach
*mach
;
593 struct sof_card_private
*ctx
;
594 int dmic_be_num
, hdmi_num
;
595 int ret
, ssp_amp
, ssp_codec
;
597 ctx
= devm_kzalloc(&pdev
->dev
, sizeof(*ctx
), GFP_KERNEL
);
601 if (pdev
->id_entry
&& pdev
->id_entry
->driver_data
)
602 sof_rt5682_quirk
= (unsigned long)pdev
->id_entry
->driver_data
;
604 dmi_check_system(sof_rt5682_quirk_table
);
606 mach
= (&pdev
->dev
)->platform_data
;
608 /* A speaker amp might not be present when the quirk claims one is.
609 * Detect this via whether the machine driver match includes quirk_data.
611 if ((sof_rt5682_quirk
& SOF_SPEAKER_AMP_PRESENT
) && !mach
->quirk_data
)
612 sof_rt5682_quirk
&= ~SOF_SPEAKER_AMP_PRESENT
;
614 if (soc_intel_is_byt() || soc_intel_is_cht()) {
618 /* default quirk for legacy cpu */
619 sof_rt5682_quirk
= SOF_RT5682_MCLK_EN
|
620 SOF_RT5682_MCLK_BYTCHT_EN
|
621 SOF_RT5682_SSP_CODEC(2);
624 hdmi_num
= (sof_rt5682_quirk
& SOF_RT5682_NUM_HDMIDEV_MASK
) >>
625 SOF_RT5682_NUM_HDMIDEV_SHIFT
;
626 /* default number of HDMI DAI's */
631 /* need to get main clock from pmc */
632 if (sof_rt5682_quirk
& SOF_RT5682_MCLK_BYTCHT_EN
) {
633 ctx
->mclk
= devm_clk_get(&pdev
->dev
, "pmc_plt_clk_3");
634 if (IS_ERR(ctx
->mclk
)) {
635 ret
= PTR_ERR(ctx
->mclk
);
638 "Failed to get MCLK from pmc_plt_clk_3: %d\n",
643 ret
= clk_prepare_enable(ctx
->mclk
);
646 "could not configure MCLK state");
651 dev_dbg(&pdev
->dev
, "sof_rt5682_quirk = %lx\n", sof_rt5682_quirk
);
653 ssp_amp
= (sof_rt5682_quirk
& SOF_RT5682_SSP_AMP_MASK
) >>
654 SOF_RT5682_SSP_AMP_SHIFT
;
656 ssp_codec
= sof_rt5682_quirk
& SOF_RT5682_SSP_CODEC_MASK
;
658 /* compute number of dai links */
659 sof_audio_card_rt5682
.num_links
= 1 + dmic_be_num
+ hdmi_num
;
661 if (sof_rt5682_quirk
& SOF_SPEAKER_AMP_PRESENT
)
662 sof_audio_card_rt5682
.num_links
++;
664 dai_links
= sof_card_dai_links_create(&pdev
->dev
, ssp_codec
, ssp_amp
,
665 dmic_be_num
, hdmi_num
);
669 sof_audio_card_rt5682
.dai_link
= dai_links
;
671 INIT_LIST_HEAD(&ctx
->hdmi_pcm_list
);
673 sof_audio_card_rt5682
.dev
= &pdev
->dev
;
675 /* set platform name for each dailink */
676 ret
= snd_soc_fixup_dai_links_platform_name(&sof_audio_card_rt5682
,
677 mach
->mach_params
.platform
);
681 ctx
->common_hdmi_codec_drv
= mach
->mach_params
.common_hdmi_codec_drv
;
683 snd_soc_card_set_drvdata(&sof_audio_card_rt5682
, ctx
);
685 return devm_snd_soc_register_card(&pdev
->dev
,
686 &sof_audio_card_rt5682
);
689 static int sof_rt5682_remove(struct platform_device
*pdev
)
691 struct snd_soc_card
*card
= platform_get_drvdata(pdev
);
692 struct snd_soc_component
*component
= NULL
;
694 for_each_card_components(card
, component
) {
695 if (!strcmp(component
->name
, rt5682_component
[0].name
)) {
696 snd_soc_component_set_jack(component
, NULL
, NULL
);
704 static const struct platform_device_id board_ids
[] = {
706 .name
= "sof_rt5682",
709 .name
= "tgl_max98357a_rt5682",
710 .driver_data
= (kernel_ulong_t
)(SOF_RT5682_MCLK_EN
|
711 SOF_RT5682_SSP_CODEC(0) |
712 SOF_SPEAKER_AMP_PRESENT
|
713 SOF_RT5682_SSP_AMP(1) |
714 SOF_RT5682_NUM_HDMIDEV(4)),
719 static struct platform_driver sof_audio
= {
720 .probe
= sof_audio_probe
,
721 .remove
= sof_rt5682_remove
,
723 .name
= "sof_rt5682",
724 .pm
= &snd_soc_pm_ops
,
726 .id_table
= board_ids
,
728 module_platform_driver(sof_audio
)
730 /* Module information */
731 MODULE_DESCRIPTION("SOF Audio Machine driver");
732 MODULE_AUTHOR("Bard Liao <bard.liao@intel.com>");
733 MODULE_AUTHOR("Sathya Prakash M R <sathya.prakash.m.r@intel.com>");
734 MODULE_LICENSE("GPL v2");
735 MODULE_ALIAS("platform:sof_rt5682");
736 MODULE_ALIAS("platform:tgl_max98357a_rt5682");