Linux 4.15.6
[linux/fpc-iii.git] / sound / soc / intel / boards / skl_nau88l25_max98357a.c
blob1b5a689dc99bb4810194a0bd068fea8f75c99426
1 /*
2 * Intel Skylake I2S Machine Driver with MAXIM98357A
3 * and NAU88L25
5 * Copyright (C) 2015, Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #include <linux/module.h>
18 #include <linux/platform_device.h>
19 #include <sound/core.h>
20 #include <sound/jack.h>
21 #include <sound/pcm.h>
22 #include <sound/pcm_params.h>
23 #include <sound/soc.h>
24 #include "../../codecs/nau8825.h"
25 #include "../../codecs/hdac_hdmi.h"
26 #include "../skylake/skl.h"
28 #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
29 #define SKL_MAXIM_CODEC_DAI "HiFi"
30 #define DMIC_CH(p) p->list[p->count-1]
32 static struct snd_soc_jack skylake_headset;
33 static struct snd_soc_card skylake_audio_card;
34 static const struct snd_pcm_hw_constraint_list *dmic_constraints;
35 static struct snd_soc_jack skylake_hdmi[3];
37 struct skl_hdmi_pcm {
38 struct list_head head;
39 struct snd_soc_dai *codec_dai;
40 int device;
43 struct skl_nau8825_private {
44 struct list_head hdmi_pcm_list;
47 enum {
48 SKL_DPCM_AUDIO_PB = 0,
49 SKL_DPCM_AUDIO_CP,
50 SKL_DPCM_AUDIO_REF_CP,
51 SKL_DPCM_AUDIO_DMIC_CP,
52 SKL_DPCM_AUDIO_HDMI1_PB,
53 SKL_DPCM_AUDIO_HDMI2_PB,
54 SKL_DPCM_AUDIO_HDMI3_PB,
57 static int platform_clock_control(struct snd_soc_dapm_widget *w,
58 struct snd_kcontrol *k, int event)
60 struct snd_soc_dapm_context *dapm = w->dapm;
61 struct snd_soc_card *card = dapm->card;
62 struct snd_soc_dai *codec_dai;
63 int ret;
65 codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI);
66 if (!codec_dai) {
67 dev_err(card->dev, "Codec dai not found; Unable to set platform clock\n");
68 return -EIO;
71 if (SND_SOC_DAPM_EVENT_ON(event)) {
72 ret = snd_soc_dai_set_sysclk(codec_dai,
73 NAU8825_CLK_MCLK, 24000000, SND_SOC_CLOCK_IN);
74 if (ret < 0) {
75 dev_err(card->dev, "set sysclk err = %d\n", ret);
76 return -EIO;
78 } else {
79 ret = snd_soc_dai_set_sysclk(codec_dai,
80 NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
81 if (ret < 0) {
82 dev_err(card->dev, "set sysclk err = %d\n", ret);
83 return -EIO;
87 return ret;
90 static const struct snd_kcontrol_new skylake_controls[] = {
91 SOC_DAPM_PIN_SWITCH("Headphone Jack"),
92 SOC_DAPM_PIN_SWITCH("Headset Mic"),
93 SOC_DAPM_PIN_SWITCH("Spk"),
96 static const struct snd_soc_dapm_widget skylake_widgets[] = {
97 SND_SOC_DAPM_HP("Headphone Jack", NULL),
98 SND_SOC_DAPM_MIC("Headset Mic", NULL),
99 SND_SOC_DAPM_SPK("Spk", NULL),
100 SND_SOC_DAPM_MIC("SoC DMIC", NULL),
101 SND_SOC_DAPM_SPK("DP1", NULL),
102 SND_SOC_DAPM_SPK("DP2", NULL),
103 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
104 platform_clock_control, SND_SOC_DAPM_PRE_PMU |
105 SND_SOC_DAPM_POST_PMD),
108 static const struct snd_soc_dapm_route skylake_map[] = {
109 /* HP jack connectors - unknown if we have jack detection */
110 { "Headphone Jack", NULL, "HPOL" },
111 { "Headphone Jack", NULL, "HPOR" },
113 /* speaker */
114 { "Spk", NULL, "Speaker" },
116 /* other jacks */
117 { "MIC", NULL, "Headset Mic" },
118 { "DMic", NULL, "SoC DMIC" },
120 /* CODEC BE connections */
121 { "HiFi Playback", NULL, "ssp0 Tx" },
122 { "ssp0 Tx", NULL, "codec0_out" },
124 { "Playback", NULL, "ssp1 Tx" },
125 { "ssp1 Tx", NULL, "codec1_out" },
127 { "codec0_in", NULL, "ssp1 Rx" },
128 { "ssp1 Rx", NULL, "Capture" },
130 /* DMIC */
131 { "dmic01_hifi", NULL, "DMIC01 Rx" },
132 { "DMIC01 Rx", NULL, "DMIC AIF" },
134 { "hifi3", NULL, "iDisp3 Tx"},
135 { "iDisp3 Tx", NULL, "iDisp3_out"},
136 { "hifi2", NULL, "iDisp2 Tx"},
137 { "iDisp2 Tx", NULL, "iDisp2_out"},
138 { "hifi1", NULL, "iDisp1 Tx"},
139 { "iDisp1 Tx", NULL, "iDisp1_out"},
141 { "Headphone Jack", NULL, "Platform Clock" },
142 { "Headset Mic", NULL, "Platform Clock" },
145 static int skylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
146 struct snd_pcm_hw_params *params)
148 struct snd_interval *rate = hw_param_interval(params,
149 SNDRV_PCM_HW_PARAM_RATE);
150 struct snd_interval *channels = hw_param_interval(params,
151 SNDRV_PCM_HW_PARAM_CHANNELS);
152 struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
154 /* The ADSP will covert the FE rate to 48k, stereo */
155 rate->min = rate->max = 48000;
156 channels->min = channels->max = 2;
158 /* set SSP0 to 24 bit */
159 snd_mask_none(fmt);
160 snd_mask_set(fmt, SNDRV_PCM_FORMAT_S24_LE);
162 return 0;
165 static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
167 int ret;
168 struct snd_soc_codec *codec = rtd->codec;
171 * Headset buttons map to the google Reference headset.
172 * These can be configured by userspace.
174 ret = snd_soc_card_jack_new(&skylake_audio_card, "Headset Jack",
175 SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 |
176 SND_JACK_BTN_2 | SND_JACK_BTN_3, &skylake_headset,
177 NULL, 0);
178 if (ret) {
179 dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret);
180 return ret;
183 nau8825_enable_jack_detect(codec, &skylake_headset);
185 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
187 return ret;
190 static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
192 struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(rtd->card);
193 struct snd_soc_dai *dai = rtd->codec_dai;
194 struct skl_hdmi_pcm *pcm;
196 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
197 if (!pcm)
198 return -ENOMEM;
200 pcm->device = SKL_DPCM_AUDIO_HDMI1_PB;
201 pcm->codec_dai = dai;
203 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
205 return 0;
208 static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
210 struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(rtd->card);
211 struct snd_soc_dai *dai = rtd->codec_dai;
212 struct skl_hdmi_pcm *pcm;
214 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
215 if (!pcm)
216 return -ENOMEM;
218 pcm->device = SKL_DPCM_AUDIO_HDMI2_PB;
219 pcm->codec_dai = dai;
221 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
223 return 0;
226 static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
228 struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(rtd->card);
229 struct snd_soc_dai *dai = rtd->codec_dai;
230 struct skl_hdmi_pcm *pcm;
232 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
233 if (!pcm)
234 return -ENOMEM;
236 pcm->device = SKL_DPCM_AUDIO_HDMI3_PB;
237 pcm->codec_dai = dai;
239 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
241 return 0;
244 static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
246 struct snd_soc_dapm_context *dapm;
247 struct snd_soc_component *component = rtd->cpu_dai->component;
249 dapm = snd_soc_component_get_dapm(component);
250 snd_soc_dapm_ignore_suspend(dapm, "Reference Capture");
252 return 0;
255 static const unsigned int rates[] = {
256 48000,
259 static const struct snd_pcm_hw_constraint_list constraints_rates = {
260 .count = ARRAY_SIZE(rates),
261 .list = rates,
262 .mask = 0,
265 static const unsigned int channels[] = {
269 static const struct snd_pcm_hw_constraint_list constraints_channels = {
270 .count = ARRAY_SIZE(channels),
271 .list = channels,
272 .mask = 0,
275 static int skl_fe_startup(struct snd_pcm_substream *substream)
277 struct snd_pcm_runtime *runtime = substream->runtime;
280 * On this platform for PCM device we support,
281 * 48Khz
282 * stereo
283 * 16 bit audio
286 runtime->hw.channels_max = 2;
287 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
288 &constraints_channels);
290 runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
291 snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
293 snd_pcm_hw_constraint_list(runtime, 0,
294 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
296 return 0;
299 static const struct snd_soc_ops skylake_nau8825_fe_ops = {
300 .startup = skl_fe_startup,
303 static int skylake_nau8825_hw_params(struct snd_pcm_substream *substream,
304 struct snd_pcm_hw_params *params)
306 struct snd_soc_pcm_runtime *rtd = substream->private_data;
307 struct snd_soc_dai *codec_dai = rtd->codec_dai;
308 int ret;
310 ret = snd_soc_dai_set_sysclk(codec_dai,
311 NAU8825_CLK_MCLK, 24000000, SND_SOC_CLOCK_IN);
313 if (ret < 0)
314 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
316 return ret;
319 static const struct snd_soc_ops skylake_nau8825_ops = {
320 .hw_params = skylake_nau8825_hw_params,
323 static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
324 struct snd_pcm_hw_params *params)
326 struct snd_interval *channels = hw_param_interval(params,
327 SNDRV_PCM_HW_PARAM_CHANNELS);
329 if (params_channels(params) == 2 || DMIC_CH(dmic_constraints) == 2)
330 channels->min = channels->max = 2;
331 else
332 channels->min = channels->max = 4;
334 return 0;
337 static const unsigned int channels_dmic[] = {
338 2, 4,
341 static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
342 .count = ARRAY_SIZE(channels_dmic),
343 .list = channels_dmic,
344 .mask = 0,
347 static const unsigned int dmic_2ch[] = {
351 static const struct snd_pcm_hw_constraint_list constraints_dmic_2ch = {
352 .count = ARRAY_SIZE(dmic_2ch),
353 .list = dmic_2ch,
354 .mask = 0,
357 static int skylake_dmic_startup(struct snd_pcm_substream *substream)
359 struct snd_pcm_runtime *runtime = substream->runtime;
361 runtime->hw.channels_max = DMIC_CH(dmic_constraints);
362 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
363 dmic_constraints);
365 return snd_pcm_hw_constraint_list(substream->runtime, 0,
366 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
369 static const struct snd_soc_ops skylake_dmic_ops = {
370 .startup = skylake_dmic_startup,
373 static const unsigned int rates_16000[] = {
374 16000,
377 static const struct snd_pcm_hw_constraint_list constraints_16000 = {
378 .count = ARRAY_SIZE(rates_16000),
379 .list = rates_16000,
382 static const unsigned int ch_mono[] = {
386 static const struct snd_pcm_hw_constraint_list constraints_refcap = {
387 .count = ARRAY_SIZE(ch_mono),
388 .list = ch_mono,
391 static int skylake_refcap_startup(struct snd_pcm_substream *substream)
393 substream->runtime->hw.channels_max = 1;
394 snd_pcm_hw_constraint_list(substream->runtime, 0,
395 SNDRV_PCM_HW_PARAM_CHANNELS,
396 &constraints_refcap);
398 return snd_pcm_hw_constraint_list(substream->runtime, 0,
399 SNDRV_PCM_HW_PARAM_RATE,
400 &constraints_16000);
403 static const struct snd_soc_ops skylaye_refcap_ops = {
404 .startup = skylake_refcap_startup,
407 /* skylake digital audio interface glue - connects codec <--> CPU */
408 static struct snd_soc_dai_link skylake_dais[] = {
409 /* Front End DAI links */
410 [SKL_DPCM_AUDIO_PB] = {
411 .name = "Skl Audio Port",
412 .stream_name = "Audio",
413 .cpu_dai_name = "System Pin",
414 .platform_name = "0000:00:1f.3",
415 .dynamic = 1,
416 .codec_name = "snd-soc-dummy",
417 .codec_dai_name = "snd-soc-dummy-dai",
418 .nonatomic = 1,
419 .init = skylake_nau8825_fe_init,
420 .trigger = {
421 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
422 .dpcm_playback = 1,
423 .ops = &skylake_nau8825_fe_ops,
425 [SKL_DPCM_AUDIO_CP] = {
426 .name = "Skl Audio Capture Port",
427 .stream_name = "Audio Record",
428 .cpu_dai_name = "System Pin",
429 .platform_name = "0000:00:1f.3",
430 .dynamic = 1,
431 .codec_name = "snd-soc-dummy",
432 .codec_dai_name = "snd-soc-dummy-dai",
433 .nonatomic = 1,
434 .trigger = {
435 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
436 .dpcm_capture = 1,
437 .ops = &skylake_nau8825_fe_ops,
439 [SKL_DPCM_AUDIO_REF_CP] = {
440 .name = "Skl Audio Reference cap",
441 .stream_name = "Wake on Voice",
442 .cpu_dai_name = "Reference Pin",
443 .codec_name = "snd-soc-dummy",
444 .codec_dai_name = "snd-soc-dummy-dai",
445 .platform_name = "0000:00:1f.3",
446 .init = NULL,
447 .dpcm_capture = 1,
448 .nonatomic = 1,
449 .dynamic = 1,
450 .ops = &skylaye_refcap_ops,
452 [SKL_DPCM_AUDIO_DMIC_CP] = {
453 .name = "Skl Audio DMIC cap",
454 .stream_name = "dmiccap",
455 .cpu_dai_name = "DMIC Pin",
456 .codec_name = "snd-soc-dummy",
457 .codec_dai_name = "snd-soc-dummy-dai",
458 .platform_name = "0000:00:1f.3",
459 .init = NULL,
460 .dpcm_capture = 1,
461 .nonatomic = 1,
462 .dynamic = 1,
463 .ops = &skylake_dmic_ops,
465 [SKL_DPCM_AUDIO_HDMI1_PB] = {
466 .name = "Skl HDMI Port1",
467 .stream_name = "Hdmi1",
468 .cpu_dai_name = "HDMI1 Pin",
469 .codec_name = "snd-soc-dummy",
470 .codec_dai_name = "snd-soc-dummy-dai",
471 .platform_name = "0000:00:1f.3",
472 .dpcm_playback = 1,
473 .init = NULL,
474 .trigger = {
475 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
476 .nonatomic = 1,
477 .dynamic = 1,
479 [SKL_DPCM_AUDIO_HDMI2_PB] = {
480 .name = "Skl HDMI Port2",
481 .stream_name = "Hdmi2",
482 .cpu_dai_name = "HDMI2 Pin",
483 .codec_name = "snd-soc-dummy",
484 .codec_dai_name = "snd-soc-dummy-dai",
485 .platform_name = "0000:00:1f.3",
486 .dpcm_playback = 1,
487 .init = NULL,
488 .trigger = {
489 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
490 .nonatomic = 1,
491 .dynamic = 1,
493 [SKL_DPCM_AUDIO_HDMI3_PB] = {
494 .name = "Skl HDMI Port3",
495 .stream_name = "Hdmi3",
496 .cpu_dai_name = "HDMI3 Pin",
497 .codec_name = "snd-soc-dummy",
498 .codec_dai_name = "snd-soc-dummy-dai",
499 .platform_name = "0000:00:1f.3",
500 .trigger = {
501 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
502 .dpcm_playback = 1,
503 .init = NULL,
504 .nonatomic = 1,
505 .dynamic = 1,
508 /* Back End DAI links */
510 /* SSP0 - Codec */
511 .name = "SSP0-Codec",
512 .id = 0,
513 .cpu_dai_name = "SSP0 Pin",
514 .platform_name = "0000:00:1f.3",
515 .no_pcm = 1,
516 .codec_name = "MX98357A:00",
517 .codec_dai_name = SKL_MAXIM_CODEC_DAI,
518 .dai_fmt = SND_SOC_DAIFMT_I2S |
519 SND_SOC_DAIFMT_NB_NF |
520 SND_SOC_DAIFMT_CBS_CFS,
521 .ignore_pmdown_time = 1,
522 .be_hw_params_fixup = skylake_ssp_fixup,
523 .dpcm_playback = 1,
526 /* SSP1 - Codec */
527 .name = "SSP1-Codec",
528 .id = 1,
529 .cpu_dai_name = "SSP1 Pin",
530 .platform_name = "0000:00:1f.3",
531 .no_pcm = 1,
532 .codec_name = "i2c-10508825:00",
533 .codec_dai_name = SKL_NUVOTON_CODEC_DAI,
534 .init = skylake_nau8825_codec_init,
535 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
536 SND_SOC_DAIFMT_CBS_CFS,
537 .ignore_pmdown_time = 1,
538 .be_hw_params_fixup = skylake_ssp_fixup,
539 .ops = &skylake_nau8825_ops,
540 .dpcm_playback = 1,
541 .dpcm_capture = 1,
544 .name = "dmic01",
545 .id = 2,
546 .cpu_dai_name = "DMIC01 Pin",
547 .codec_name = "dmic-codec",
548 .codec_dai_name = "dmic-hifi",
549 .platform_name = "0000:00:1f.3",
550 .be_hw_params_fixup = skylake_dmic_fixup,
551 .ignore_suspend = 1,
552 .dpcm_capture = 1,
553 .no_pcm = 1,
556 .name = "iDisp1",
557 .id = 3,
558 .cpu_dai_name = "iDisp1 Pin",
559 .codec_name = "ehdaudio0D2",
560 .codec_dai_name = "intel-hdmi-hifi1",
561 .platform_name = "0000:00:1f.3",
562 .dpcm_playback = 1,
563 .init = skylake_hdmi1_init,
564 .no_pcm = 1,
567 .name = "iDisp2",
568 .id = 4,
569 .cpu_dai_name = "iDisp2 Pin",
570 .codec_name = "ehdaudio0D2",
571 .codec_dai_name = "intel-hdmi-hifi2",
572 .platform_name = "0000:00:1f.3",
573 .init = skylake_hdmi2_init,
574 .dpcm_playback = 1,
575 .no_pcm = 1,
578 .name = "iDisp3",
579 .id = 5,
580 .cpu_dai_name = "iDisp3 Pin",
581 .codec_name = "ehdaudio0D2",
582 .codec_dai_name = "intel-hdmi-hifi3",
583 .platform_name = "0000:00:1f.3",
584 .init = skylake_hdmi3_init,
585 .dpcm_playback = 1,
586 .no_pcm = 1,
590 #define NAME_SIZE 32
591 static int skylake_card_late_probe(struct snd_soc_card *card)
593 struct skl_nau8825_private *ctx = snd_soc_card_get_drvdata(card);
594 struct skl_hdmi_pcm *pcm;
595 struct snd_soc_codec *codec = NULL;
596 int err, i = 0;
597 char jack_name[NAME_SIZE];
599 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
600 codec = pcm->codec_dai->codec;
601 snprintf(jack_name, sizeof(jack_name),
602 "HDMI/DP, pcm=%d Jack", pcm->device);
603 err = snd_soc_card_jack_new(card, jack_name,
604 SND_JACK_AVOUT,
605 &skylake_hdmi[i],
606 NULL, 0);
608 if (err)
609 return err;
611 err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device,
612 &skylake_hdmi[i]);
613 if (err < 0)
614 return err;
616 i++;
619 if (!codec)
620 return -EINVAL;
622 return hdac_hdmi_jack_port_init(codec, &card->dapm);
625 /* skylake audio machine driver for SPT + NAU88L25 */
626 static struct snd_soc_card skylake_audio_card = {
627 .name = "sklnau8825max",
628 .owner = THIS_MODULE,
629 .dai_link = skylake_dais,
630 .num_links = ARRAY_SIZE(skylake_dais),
631 .controls = skylake_controls,
632 .num_controls = ARRAY_SIZE(skylake_controls),
633 .dapm_widgets = skylake_widgets,
634 .num_dapm_widgets = ARRAY_SIZE(skylake_widgets),
635 .dapm_routes = skylake_map,
636 .num_dapm_routes = ARRAY_SIZE(skylake_map),
637 .fully_routed = true,
638 .late_probe = skylake_card_late_probe,
641 static int skylake_audio_probe(struct platform_device *pdev)
643 struct skl_nau8825_private *ctx;
644 struct skl_machine_pdata *pdata;
646 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC);
647 if (!ctx)
648 return -ENOMEM;
650 INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
652 skylake_audio_card.dev = &pdev->dev;
653 snd_soc_card_set_drvdata(&skylake_audio_card, ctx);
655 pdata = dev_get_drvdata(&pdev->dev);
656 if (pdata)
657 dmic_constraints = pdata->dmic_num == 2 ?
658 &constraints_dmic_2ch : &constraints_dmic_channels;
660 return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card);
663 static const struct platform_device_id skl_board_ids[] = {
664 { .name = "skl_n88l25_m98357a" },
665 { .name = "kbl_n88l25_m98357a" },
669 static struct platform_driver skylake_audio = {
670 .probe = skylake_audio_probe,
671 .driver = {
672 .name = "skl_n88l25_m98357a",
673 .pm = &snd_soc_pm_ops,
675 .id_table = skl_board_ids,
678 module_platform_driver(skylake_audio)
680 /* Module information */
681 MODULE_DESCRIPTION("Audio Machine driver-NAU88L25 & MAX98357A in I2S mode");
682 MODULE_AUTHOR("Rohit Ainapure <rohit.m.ainapure@intel.com");
683 MODULE_LICENSE("GPL v2");
684 MODULE_ALIAS("platform:skl_n88l25_m98357a");
685 MODULE_ALIAS("platform:kbl_n88l25_m98357a");