ASoC: Intel: Skylake: Add IVI feedback path in nau88125_ssm4567 machine
[linux-2.6-block.git] / sound / soc / intel / boards / skl_nau88l25_ssm4567.c
1 /*
2  * Intel Skylake I2S Machine Driver for NAU88L25+SSM4567
3  *
4  * Copyright (C) 2015, Intel Corporation. All rights reserved.
5  *
6  * Modified from:
7  *   Intel Skylake I2S Machine Driver for NAU88L25 and SSM4567
8  *
9  *   Copyright (C) 2015, Intel Corporation. All rights reserved.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License version
13  * 2 as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20
21 #include <linux/module.h>
22 #include <linux/platform_device.h>
23 #include <sound/core.h>
24 #include <sound/pcm.h>
25 #include <sound/soc.h>
26 #include <sound/jack.h>
27 #include <sound/pcm_params.h>
28 #include "../../codecs/nau8825.h"
29 #include "../../codecs/hdac_hdmi.h"
30
31 #define SKL_NUVOTON_CODEC_DAI   "nau8825-hifi"
32 #define SKL_SSM_CODEC_DAI       "ssm4567-hifi"
33
34 static struct snd_soc_jack skylake_headset;
35 static struct snd_soc_card skylake_audio_card;
36
37 enum {
38         SKL_DPCM_AUDIO_PB = 0,
39         SKL_DPCM_AUDIO_CP,
40         SKL_DPCM_AUDIO_REF_CP,
41         SKL_DPCM_AUDIO_DMIC_CP,
42         SKL_DPCM_AUDIO_HDMI1_PB,
43         SKL_DPCM_AUDIO_HDMI2_PB,
44         SKL_DPCM_AUDIO_HDMI3_PB,
45 };
46
47 static inline struct snd_soc_dai *skl_get_codec_dai(struct snd_soc_card *card)
48 {
49         struct snd_soc_pcm_runtime *rtd;
50
51         list_for_each_entry(rtd, &card->rtd_list, list) {
52
53                 if (!strncmp(rtd->codec_dai->name, SKL_NUVOTON_CODEC_DAI,
54                              strlen(SKL_NUVOTON_CODEC_DAI)))
55                         return rtd->codec_dai;
56         }
57
58         return NULL;
59 }
60
61 static const struct snd_kcontrol_new skylake_controls[] = {
62         SOC_DAPM_PIN_SWITCH("Headphone Jack"),
63         SOC_DAPM_PIN_SWITCH("Headset Mic"),
64         SOC_DAPM_PIN_SWITCH("Left Speaker"),
65         SOC_DAPM_PIN_SWITCH("Right Speaker"),
66 };
67
68 static int platform_clock_control(struct snd_soc_dapm_widget *w,
69                 struct snd_kcontrol *k, int  event)
70 {
71         struct snd_soc_dapm_context *dapm = w->dapm;
72         struct snd_soc_card *card = dapm->card;
73         struct snd_soc_dai *codec_dai;
74         int ret;
75
76         codec_dai = skl_get_codec_dai(card);
77         if (!codec_dai) {
78                 dev_err(card->dev, "Codec dai not found\n");
79                 return -EIO;
80         }
81
82         if (SND_SOC_DAPM_EVENT_ON(event)) {
83                 ret = snd_soc_dai_set_sysclk(codec_dai,
84                                 NAU8825_CLK_MCLK, 24000000, SND_SOC_CLOCK_IN);
85                 if (ret < 0) {
86                         dev_err(card->dev, "set sysclk err = %d\n", ret);
87                         return -EIO;
88                 }
89         } else {
90                 ret = snd_soc_dai_set_sysclk(codec_dai,
91                                 NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
92                 if (ret < 0) {
93                         dev_err(card->dev, "set sysclk err = %d\n", ret);
94                         return -EIO;
95                 }
96         }
97         return ret;
98 }
99
100 static const struct snd_soc_dapm_widget skylake_widgets[] = {
101         SND_SOC_DAPM_HP("Headphone Jack", NULL),
102         SND_SOC_DAPM_MIC("Headset Mic", NULL),
103         SND_SOC_DAPM_SPK("Left Speaker", NULL),
104         SND_SOC_DAPM_SPK("Right Speaker", NULL),
105         SND_SOC_DAPM_MIC("SoC DMIC", NULL),
106         SND_SOC_DAPM_SPK("DP", NULL),
107         SND_SOC_DAPM_SPK("HDMI", NULL),
108         SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
109                         platform_clock_control, SND_SOC_DAPM_PRE_PMU |
110                         SND_SOC_DAPM_POST_PMD),
111 };
112
113 static const struct snd_soc_dapm_route skylake_map[] = {
114         /* HP jack connectors - unknown if we have jack detection */
115         {"Headphone Jack", NULL, "HPOL"},
116         {"Headphone Jack", NULL, "HPOR"},
117
118         /* speaker */
119         {"Left Speaker", NULL, "Left OUT"},
120         {"Right Speaker", NULL, "Right OUT"},
121
122         /* other jacks */
123         {"MIC", NULL, "Headset Mic"},
124         {"DMic", NULL, "SoC DMIC"},
125
126         {"HDMI", NULL, "hif5 Output"},
127         {"DP", NULL, "hif6 Output"},
128         /* CODEC BE connections */
129         { "Left Playback", NULL, "ssp0 Tx"},
130         { "Right Playback", NULL, "ssp0 Tx"},
131         { "ssp0 Tx", NULL, "codec0_out"},
132
133         /* IV feedback path */
134         { "codec0_lp_in", NULL, "ssp0 Rx"},
135         { "ssp0 Rx", NULL, "Left Capture Sense" },
136         { "ssp0 Rx", NULL, "Right Capture Sense" },
137
138         { "Playback", NULL, "ssp1 Tx"},
139         { "ssp1 Tx", NULL, "codec1_out"},
140
141         { "codec0_in", NULL, "ssp1 Rx" },
142         { "ssp1 Rx", NULL, "Capture" },
143
144         /* DMIC */
145         { "dmic01_hifi", NULL, "DMIC01 Rx" },
146         { "DMIC01 Rx", NULL, "DMIC AIF" },
147
148         { "hifi3", NULL, "iDisp3 Tx"},
149         { "iDisp3 Tx", NULL, "iDisp3_out"},
150         { "hifi2", NULL, "iDisp2 Tx"},
151         { "iDisp2 Tx", NULL, "iDisp2_out"},
152         { "hifi1", NULL, "iDisp1 Tx"},
153         { "iDisp1 Tx", NULL, "iDisp1_out"},
154
155         { "Headphone Jack", NULL, "Platform Clock" },
156         { "Headset Mic", NULL, "Platform Clock" },
157 };
158
159 static const struct snd_soc_pcm_stream skl_ssm4567_loop_params = {
160         .formats = SNDRV_PCM_FMTBIT_S24_LE,
161         .rate_min = 48000,
162         .rate_max = 48000,
163         .channels_min = 4,
164         .channels_max = 4,
165 };
166
167 static struct snd_soc_codec_conf ssm4567_codec_conf[] = {
168         {
169                 .dev_name = "i2c-INT343B:00",
170                 .name_prefix = "Left",
171         },
172         {
173                 .dev_name = "i2c-INT343B:01",
174                 .name_prefix = "Right",
175         },
176 };
177
178 static struct snd_soc_dai_link_component ssm4567_codec_components[] = {
179         { /* Left */
180                 .name = "i2c-INT343B:00",
181                 .dai_name = SKL_SSM_CODEC_DAI,
182         },
183         { /* Right */
184                 .name = "i2c-INT343B:01",
185                 .dai_name = SKL_SSM_CODEC_DAI,
186         },
187 };
188
189 static int skylake_ssm4567_codec_init(struct snd_soc_pcm_runtime *rtd)
190 {
191         int ret;
192
193         /* Slot 1 for left */
194         ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[0], 0x01, 0x01, 2, 48);
195         if (ret < 0)
196                 return ret;
197
198         /* Slot 2 for right */
199         ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[1], 0x02, 0x02, 2, 48);
200         if (ret < 0)
201                 return ret;
202
203         return ret;
204 }
205
206 static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
207 {
208         int ret;
209         struct snd_soc_codec *codec = rtd->codec;
210
211         /*
212          * 4 buttons here map to the google Reference headset
213          * The use of these buttons can be decided by the user space.
214          */
215         ret = snd_soc_card_jack_new(&skylake_audio_card, "Headset Jack",
216                 SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 |
217                 SND_JACK_BTN_2 | SND_JACK_BTN_3, &skylake_headset,
218                 NULL, 0);
219         if (ret) {
220                 dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret);
221                 return ret;
222         }
223
224         nau8825_enable_jack_detect(codec, &skylake_headset);
225
226         snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
227
228         return ret;
229 }
230
231 static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
232 {
233         struct snd_soc_dai *dai = rtd->codec_dai;
234
235         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI1_PB);
236 }
237
238 static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
239 {
240         struct snd_soc_dai *dai = rtd->codec_dai;
241
242         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI2_PB);
243 }
244
245
246 static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
247 {
248         struct snd_soc_dai *dai = rtd->codec_dai;
249
250         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI3_PB);
251 }
252
253 static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
254 {
255         struct snd_soc_dapm_context *dapm;
256         struct snd_soc_component *component = rtd->cpu_dai->component;
257
258         dapm = snd_soc_component_get_dapm(component);
259         snd_soc_dapm_ignore_suspend(dapm, "Reference Capture");
260
261         return 0;
262 }
263
264 static unsigned int rates[] = {
265         48000,
266 };
267
268 static struct snd_pcm_hw_constraint_list constraints_rates = {
269         .count = ARRAY_SIZE(rates),
270         .list  = rates,
271         .mask = 0,
272 };
273
274 static unsigned int channels[] = {
275         2,
276 };
277
278 static struct snd_pcm_hw_constraint_list constraints_channels = {
279         .count = ARRAY_SIZE(channels),
280         .list = channels,
281         .mask = 0,
282 };
283
284 static int skl_fe_startup(struct snd_pcm_substream *substream)
285 {
286         struct snd_pcm_runtime *runtime = substream->runtime;
287
288         /*
289          * on this platform for PCM device we support,
290          *      48Khz
291          *      stereo
292          *      16 bit audio
293          */
294
295         runtime->hw.channels_max = 2;
296         snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
297                                            &constraints_channels);
298
299         runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
300         snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
301
302         snd_pcm_hw_constraint_list(runtime, 0,
303                                 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
304
305         return 0;
306 }
307
308 static const struct snd_soc_ops skylake_nau8825_fe_ops = {
309         .startup = skl_fe_startup,
310 };
311
312 static int skylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
313                         struct snd_pcm_hw_params *params)
314 {
315         struct snd_interval *rate = hw_param_interval(params,
316                         SNDRV_PCM_HW_PARAM_RATE);
317         struct snd_interval *channels = hw_param_interval(params,
318                                                 SNDRV_PCM_HW_PARAM_CHANNELS);
319         struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
320
321         /* The ADSP will covert the FE rate to 48k, stereo */
322         rate->min = rate->max = 48000;
323         channels->min = channels->max = 2;
324
325         /* set SSP0 to 24 bit */
326         snd_mask_none(fmt);
327         snd_mask_set(fmt, SNDRV_PCM_FORMAT_S24_LE);
328         return 0;
329 }
330
331 static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
332                         struct snd_pcm_hw_params *params)
333 {
334         struct snd_interval *channels = hw_param_interval(params,
335                                                 SNDRV_PCM_HW_PARAM_CHANNELS);
336         if (params_channels(params) == 2)
337                 channels->min = channels->max = 2;
338         else
339                 channels->min = channels->max = 4;
340
341         return 0;
342 }
343
344 static int skylake_nau8825_hw_params(struct snd_pcm_substream *substream,
345         struct snd_pcm_hw_params *params)
346 {
347         struct snd_soc_pcm_runtime *rtd = substream->private_data;
348         struct snd_soc_dai *codec_dai = rtd->codec_dai;
349         int ret;
350
351         ret = snd_soc_dai_set_sysclk(codec_dai,
352                         NAU8825_CLK_MCLK, 24000000, SND_SOC_CLOCK_IN);
353
354         if (ret < 0)
355                 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
356
357         return ret;
358 }
359
360 static struct snd_soc_ops skylake_nau8825_ops = {
361         .hw_params = skylake_nau8825_hw_params,
362 };
363
364 static unsigned int channels_dmic[] = {
365         2, 4,
366 };
367
368 static struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
369         .count = ARRAY_SIZE(channels_dmic),
370         .list = channels_dmic,
371         .mask = 0,
372 };
373
374 static int skylake_dmic_startup(struct snd_pcm_substream *substream)
375 {
376         struct snd_pcm_runtime *runtime = substream->runtime;
377
378         runtime->hw.channels_max = 4;
379         snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
380                         &constraints_dmic_channels);
381
382         return snd_pcm_hw_constraint_list(substream->runtime, 0,
383                         SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
384 }
385
386 static struct snd_soc_ops skylake_dmic_ops = {
387         .startup = skylake_dmic_startup,
388 };
389
390 static unsigned int rates_16000[] = {
391         16000,
392 };
393
394 static struct snd_pcm_hw_constraint_list constraints_16000 = {
395         .count = ARRAY_SIZE(rates_16000),
396         .list  = rates_16000,
397 };
398
399 static int skylake_refcap_startup(struct snd_pcm_substream *substream)
400 {
401         return snd_pcm_hw_constraint_list(substream->runtime, 0,
402                         SNDRV_PCM_HW_PARAM_RATE,
403                         &constraints_16000);
404 }
405
406 static struct snd_soc_ops skylaye_refcap_ops = {
407         .startup = skylake_refcap_startup,
408 };
409
410 /* skylake digital audio interface glue - connects codec <--> CPU */
411 static struct snd_soc_dai_link skylake_dais[] = {
412         /* Front End DAI links */
413         [SKL_DPCM_AUDIO_PB] = {
414                 .name = "Skl Audio Port",
415                 .stream_name = "Audio",
416                 .cpu_dai_name = "System Pin",
417                 .platform_name = "0000:00:1f.3",
418                 .dynamic = 1,
419                 .codec_name = "snd-soc-dummy",
420                 .codec_dai_name = "snd-soc-dummy-dai",
421                 .nonatomic = 1,
422                 .init = skylake_nau8825_fe_init,
423                 .trigger = {
424                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
425                 .dpcm_playback = 1,
426                 .ops = &skylake_nau8825_fe_ops,
427         },
428         [SKL_DPCM_AUDIO_CP] = {
429                 .name = "Skl Audio Capture Port",
430                 .stream_name = "Audio Record",
431                 .cpu_dai_name = "System Pin",
432                 .platform_name = "0000:00:1f.3",
433                 .dynamic = 1,
434                 .codec_name = "snd-soc-dummy",
435                 .codec_dai_name = "snd-soc-dummy-dai",
436                 .nonatomic = 1,
437                 .trigger = {
438                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
439                 .dpcm_capture = 1,
440                 .ops = &skylake_nau8825_fe_ops,
441         },
442         [SKL_DPCM_AUDIO_REF_CP] = {
443                 .name = "Skl Audio Reference cap",
444                 .stream_name = "Wake on Voice",
445                 .cpu_dai_name = "Reference Pin",
446                 .codec_name = "snd-soc-dummy",
447                 .codec_dai_name = "snd-soc-dummy-dai",
448                 .platform_name = "0000:00:1f.3",
449                 .init = NULL,
450                 .dpcm_capture = 1,
451                 .ignore_suspend = 1,
452                 .nonatomic = 1,
453                 .dynamic = 1,
454                 .ops = &skylaye_refcap_ops,
455         },
456         [SKL_DPCM_AUDIO_DMIC_CP] = {
457                 .name = "Skl Audio DMIC cap",
458                 .stream_name = "dmiccap",
459                 .cpu_dai_name = "DMIC Pin",
460                 .codec_name = "snd-soc-dummy",
461                 .codec_dai_name = "snd-soc-dummy-dai",
462                 .platform_name = "0000:00:1f.3",
463                 .init = NULL,
464                 .dpcm_capture = 1,
465                 .nonatomic = 1,
466                 .dynamic = 1,
467                 .ops = &skylake_dmic_ops,
468         },
469         [SKL_DPCM_AUDIO_HDMI1_PB] = {
470                 .name = "Skl HDMI Port1",
471                 .stream_name = "Hdmi1",
472                 .cpu_dai_name = "HDMI1 Pin",
473                 .codec_name = "snd-soc-dummy",
474                 .codec_dai_name = "snd-soc-dummy-dai",
475                 .platform_name = "0000:00:1f.3",
476                 .dpcm_playback = 1,
477                 .init = NULL,
478                 .trigger = {
479                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
480                 .nonatomic = 1,
481                 .dynamic = 1,
482         },
483         [SKL_DPCM_AUDIO_HDMI2_PB] = {
484                 .name = "Skl HDMI Port2",
485                 .stream_name = "Hdmi2",
486                 .cpu_dai_name = "HDMI2 Pin",
487                 .codec_name = "snd-soc-dummy",
488                 .codec_dai_name = "snd-soc-dummy-dai",
489                 .platform_name = "0000:00:1f.3",
490                 .dpcm_playback = 1,
491                 .init = NULL,
492                 .trigger = {
493                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
494                 .nonatomic = 1,
495                 .dynamic = 1,
496         },
497         [SKL_DPCM_AUDIO_HDMI3_PB] = {
498                 .name = "Skl HDMI Port3",
499                 .stream_name = "Hdmi3",
500                 .cpu_dai_name = "HDMI3 Pin",
501                 .codec_name = "snd-soc-dummy",
502                 .codec_dai_name = "snd-soc-dummy-dai",
503                 .platform_name = "0000:00:1f.3",
504                 .trigger = {
505                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
506                 .dpcm_playback = 1,
507                 .init = NULL,
508                 .nonatomic = 1,
509                 .dynamic = 1,
510         },
511         /* Codec-codec link */
512         {
513                 .name = "Skylake IV loop",
514                 .stream_name = "SKL IV Loop",
515                 .cpu_dai_name = "SSP0 Pin",
516                 .platform_name = "0000:00:1f.3",
517                 .codecs = ssm4567_codec_components,
518                 .num_codecs = ARRAY_SIZE(ssm4567_codec_components),
519                 .params = &skl_ssm4567_loop_params,
520         },
521
522         /* Back End DAI links */
523         {
524                 /* SSP0 - Codec */
525                 .name = "SSP0-Codec",
526                 .be_id = 0,
527                 .cpu_dai_name = "SSP0 Pin",
528                 .platform_name = "0000:00:1f.3",
529                 .no_pcm = 1,
530                 .codecs = ssm4567_codec_components,
531                 .num_codecs = ARRAY_SIZE(ssm4567_codec_components),
532                 .dai_fmt = SND_SOC_DAIFMT_DSP_A |
533                         SND_SOC_DAIFMT_IB_NF |
534                         SND_SOC_DAIFMT_CBS_CFS,
535                 .init = skylake_ssm4567_codec_init,
536                 .ignore_pmdown_time = 1,
537                 .be_hw_params_fixup = skylake_ssp_fixup,
538                 .dpcm_playback = 1,
539                 .dpcm_capture = 1,
540         },
541         {
542                 /* SSP1 - Codec */
543                 .name = "SSP1-Codec",
544                 .be_id = 1,
545                 .cpu_dai_name = "SSP1 Pin",
546                 .platform_name = "0000:00:1f.3",
547                 .no_pcm = 1,
548                 .codec_name = "i2c-10508825:00",
549                 .codec_dai_name = SKL_NUVOTON_CODEC_DAI,
550                 .init = skylake_nau8825_codec_init,
551                 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
552                         SND_SOC_DAIFMT_CBS_CFS,
553                 .ignore_pmdown_time = 1,
554                 .be_hw_params_fixup = skylake_ssp_fixup,
555                 .ops = &skylake_nau8825_ops,
556                 .dpcm_playback = 1,
557                 .dpcm_capture = 1,
558         },
559         {
560                 .name = "dmic01",
561                 .be_id = 2,
562                 .cpu_dai_name = "DMIC01 Pin",
563                 .codec_name = "dmic-codec",
564                 .codec_dai_name = "dmic-hifi",
565                 .platform_name = "0000:00:1f.3",
566                 .ignore_suspend = 1,
567                 .be_hw_params_fixup = skylake_dmic_fixup,
568                 .dpcm_capture = 1,
569                 .no_pcm = 1,
570         },
571         {
572                 .name = "iDisp1",
573                 .be_id = 3,
574                 .cpu_dai_name = "iDisp1 Pin",
575                 .codec_name = "ehdaudio0D2",
576                 .codec_dai_name = "intel-hdmi-hifi1",
577                 .platform_name = "0000:00:1f.3",
578                 .dpcm_playback = 1,
579                 .init = skylake_hdmi1_init,
580                 .no_pcm = 1,
581         },
582         {
583                 .name = "iDisp2",
584                 .be_id = 4,
585                 .cpu_dai_name = "iDisp2 Pin",
586                 .codec_name = "ehdaudio0D2",
587                 .codec_dai_name = "intel-hdmi-hifi2",
588                 .platform_name = "0000:00:1f.3",
589                 .init = skylake_hdmi2_init,
590                 .dpcm_playback = 1,
591                 .no_pcm = 1,
592         },
593         {
594                 .name = "iDisp3",
595                 .be_id = 5,
596                 .cpu_dai_name = "iDisp3 Pin",
597                 .codec_name = "ehdaudio0D2",
598                 .codec_dai_name = "intel-hdmi-hifi3",
599                 .platform_name = "0000:00:1f.3",
600                 .init = skylake_hdmi3_init,
601                 .dpcm_playback = 1,
602                 .no_pcm = 1,
603         },
604 };
605
606 /* skylake audio machine driver for SPT + NAU88L25 */
607 static struct snd_soc_card skylake_audio_card = {
608         .name = "sklnau8825adi",
609         .owner = THIS_MODULE,
610         .dai_link = skylake_dais,
611         .num_links = ARRAY_SIZE(skylake_dais),
612         .controls = skylake_controls,
613         .num_controls = ARRAY_SIZE(skylake_controls),
614         .dapm_widgets = skylake_widgets,
615         .num_dapm_widgets = ARRAY_SIZE(skylake_widgets),
616         .dapm_routes = skylake_map,
617         .num_dapm_routes = ARRAY_SIZE(skylake_map),
618         .codec_conf = ssm4567_codec_conf,
619         .num_configs = ARRAY_SIZE(ssm4567_codec_conf),
620         .fully_routed = true,
621 };
622
623 static int skylake_audio_probe(struct platform_device *pdev)
624 {
625         skylake_audio_card.dev = &pdev->dev;
626
627         return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card);
628 }
629
630 static struct platform_driver skylake_audio = {
631         .probe = skylake_audio_probe,
632         .driver = {
633                 .name = "skl_nau88l25_ssm4567_i2s",
634                 .pm = &snd_soc_pm_ops,
635         },
636 };
637
638 module_platform_driver(skylake_audio)
639
640 /* Module information */
641 MODULE_AUTHOR("Conrad Cooke  <conrad.cooke@intel.com>");
642 MODULE_AUTHOR("Harsha Priya <harshapriya.n@intel.com>");
643 MODULE_AUTHOR("Naveen M <naveen.m@intel.com>");
644 MODULE_AUTHOR("Sathya Prakash M R <sathya.prakash.m.r@intel.com>");
645 MODULE_AUTHOR("Yong Zhi <yong.zhi@intel.com>");
646 MODULE_DESCRIPTION("Intel Audio Machine driver for SKL with NAU88L25 and SSM4567 in I2S Mode");
647 MODULE_LICENSE("GPL v2");
648 MODULE_ALIAS("platform:skl_nau88l25_ssm4567_i2s");