Merge branch 'topic/hdac' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[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
136         { "Playback", NULL, "ssp1 Tx"},
137         { "ssp1 Tx", NULL, "codec1_out"},
138
139         { "codec0_in", NULL, "ssp1 Rx" },
140         { "ssp1 Rx", NULL, "Capture" },
141
142         /* DMIC */
143         { "dmic01_hifi", NULL, "DMIC01 Rx" },
144         { "DMIC01 Rx", NULL, "DMIC AIF" },
145
146         { "hifi3", NULL, "iDisp3 Tx"},
147         { "iDisp3 Tx", NULL, "iDisp3_out"},
148         { "hifi2", NULL, "iDisp2 Tx"},
149         { "iDisp2 Tx", NULL, "iDisp2_out"},
150         { "hifi1", NULL, "iDisp1 Tx"},
151         { "iDisp1 Tx", NULL, "iDisp1_out"},
152
153         { "Headphone Jack", NULL, "Platform Clock" },
154         { "Headset Mic", NULL, "Platform Clock" },
155 };
156
157 static const struct snd_soc_pcm_stream skl_ssm4567_loop_params = {
158         .formats = SNDRV_PCM_FMTBIT_S24_LE,
159         .rate_min = 48000,
160         .rate_max = 48000,
161         .channels_min = 4,
162         .channels_max = 4,
163 };
164
165 static struct snd_soc_codec_conf ssm4567_codec_conf[] = {
166         {
167                 .dev_name = "i2c-INT343B:00",
168                 .name_prefix = "Left",
169         },
170         {
171                 .dev_name = "i2c-INT343B:01",
172                 .name_prefix = "Right",
173         },
174 };
175
176 static struct snd_soc_dai_link_component ssm4567_codec_components[] = {
177         { /* Left */
178                 .name = "i2c-INT343B:00",
179                 .dai_name = SKL_SSM_CODEC_DAI,
180         },
181         { /* Right */
182                 .name = "i2c-INT343B:01",
183                 .dai_name = SKL_SSM_CODEC_DAI,
184         },
185 };
186
187 static int skylake_ssm4567_codec_init(struct snd_soc_pcm_runtime *rtd)
188 {
189         int ret;
190
191         /* Slot 1 for left */
192         ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[0], 0x01, 0x01, 2, 48);
193         if (ret < 0)
194                 return ret;
195
196         /* Slot 2 for right */
197         ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[1], 0x02, 0x02, 2, 48);
198         if (ret < 0)
199                 return ret;
200
201         return ret;
202 }
203
204 static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
205 {
206         int ret;
207         struct snd_soc_codec *codec = rtd->codec;
208
209         /*
210          * 4 buttons here map to the google Reference headset
211          * The use of these buttons can be decided by the user space.
212          */
213         ret = snd_soc_card_jack_new(&skylake_audio_card, "Headset Jack",
214                 SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 |
215                 SND_JACK_BTN_2 | SND_JACK_BTN_3, &skylake_headset,
216                 NULL, 0);
217         if (ret) {
218                 dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret);
219                 return ret;
220         }
221
222         nau8825_enable_jack_detect(codec, &skylake_headset);
223
224         snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
225
226         return ret;
227 }
228
229 static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
230 {
231         struct snd_soc_dai *dai = rtd->codec_dai;
232
233         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI1_PB);
234 }
235
236 static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
237 {
238         struct snd_soc_dai *dai = rtd->codec_dai;
239
240         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI2_PB);
241 }
242
243
244 static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
245 {
246         struct snd_soc_dai *dai = rtd->codec_dai;
247
248         return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI3_PB);
249 }
250
251 static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
252 {
253         struct snd_soc_dapm_context *dapm;
254         struct snd_soc_component *component = rtd->cpu_dai->component;
255
256         dapm = snd_soc_component_get_dapm(component);
257         snd_soc_dapm_ignore_suspend(dapm, "Reference Capture");
258
259         return 0;
260 }
261
262 static unsigned int rates[] = {
263         48000,
264 };
265
266 static struct snd_pcm_hw_constraint_list constraints_rates = {
267         .count = ARRAY_SIZE(rates),
268         .list  = rates,
269         .mask = 0,
270 };
271
272 static unsigned int channels[] = {
273         2,
274 };
275
276 static struct snd_pcm_hw_constraint_list constraints_channels = {
277         .count = ARRAY_SIZE(channels),
278         .list = channels,
279         .mask = 0,
280 };
281
282 static int skl_fe_startup(struct snd_pcm_substream *substream)
283 {
284         struct snd_pcm_runtime *runtime = substream->runtime;
285
286         /*
287          * on this platform for PCM device we support,
288          *      48Khz
289          *      stereo
290          *      16 bit audio
291          */
292
293         runtime->hw.channels_max = 2;
294         snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
295                                            &constraints_channels);
296
297         runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
298         snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
299
300         snd_pcm_hw_constraint_list(runtime, 0,
301                                 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
302
303         return 0;
304 }
305
306 static const struct snd_soc_ops skylake_nau8825_fe_ops = {
307         .startup = skl_fe_startup,
308 };
309
310 static int skylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
311                         struct snd_pcm_hw_params *params)
312 {
313         struct snd_interval *rate = hw_param_interval(params,
314                         SNDRV_PCM_HW_PARAM_RATE);
315         struct snd_interval *channels = hw_param_interval(params,
316                                                 SNDRV_PCM_HW_PARAM_CHANNELS);
317         struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
318
319         /* The ADSP will covert the FE rate to 48k, stereo */
320         rate->min = rate->max = 48000;
321         channels->min = channels->max = 2;
322
323         /* set SSP0 to 24 bit */
324         snd_mask_none(fmt);
325         snd_mask_set(fmt, SNDRV_PCM_FORMAT_S24_LE);
326         return 0;
327 }
328
329 static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
330                         struct snd_pcm_hw_params *params)
331 {
332         struct snd_interval *channels = hw_param_interval(params,
333                                                 SNDRV_PCM_HW_PARAM_CHANNELS);
334         if (params_channels(params) == 2)
335                 channels->min = channels->max = 2;
336         else
337                 channels->min = channels->max = 4;
338
339         return 0;
340 }
341
342 static int skylake_nau8825_hw_params(struct snd_pcm_substream *substream,
343         struct snd_pcm_hw_params *params)
344 {
345         struct snd_soc_pcm_runtime *rtd = substream->private_data;
346         struct snd_soc_dai *codec_dai = rtd->codec_dai;
347         int ret;
348
349         ret = snd_soc_dai_set_sysclk(codec_dai,
350                         NAU8825_CLK_MCLK, 24000000, SND_SOC_CLOCK_IN);
351
352         if (ret < 0)
353                 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
354
355         return ret;
356 }
357
358 static struct snd_soc_ops skylake_nau8825_ops = {
359         .hw_params = skylake_nau8825_hw_params,
360 };
361
362 static unsigned int channels_dmic[] = {
363         2, 4,
364 };
365
366 static struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
367         .count = ARRAY_SIZE(channels_dmic),
368         .list = channels_dmic,
369         .mask = 0,
370 };
371
372 static int skylake_dmic_startup(struct snd_pcm_substream *substream)
373 {
374         struct snd_pcm_runtime *runtime = substream->runtime;
375
376         runtime->hw.channels_max = 4;
377         snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
378                         &constraints_dmic_channels);
379
380         return snd_pcm_hw_constraint_list(substream->runtime, 0,
381                         SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
382 }
383
384 static struct snd_soc_ops skylake_dmic_ops = {
385         .startup = skylake_dmic_startup,
386 };
387
388 static unsigned int rates_16000[] = {
389         16000,
390 };
391
392 static struct snd_pcm_hw_constraint_list constraints_16000 = {
393         .count = ARRAY_SIZE(rates_16000),
394         .list  = rates_16000,
395 };
396
397 static int skylake_refcap_startup(struct snd_pcm_substream *substream)
398 {
399         return snd_pcm_hw_constraint_list(substream->runtime, 0,
400                         SNDRV_PCM_HW_PARAM_RATE,
401                         &constraints_16000);
402 }
403
404 static struct snd_soc_ops skylaye_refcap_ops = {
405         .startup = skylake_refcap_startup,
406 };
407
408 /* skylake digital audio interface glue - connects codec <--> CPU */
409 static struct snd_soc_dai_link skylake_dais[] = {
410         /* Front End DAI links */
411         [SKL_DPCM_AUDIO_PB] = {
412                 .name = "Skl Audio Port",
413                 .stream_name = "Audio",
414                 .cpu_dai_name = "System Pin",
415                 .platform_name = "0000:00:1f.3",
416                 .dynamic = 1,
417                 .codec_name = "snd-soc-dummy",
418                 .codec_dai_name = "snd-soc-dummy-dai",
419                 .nonatomic = 1,
420                 .init = skylake_nau8825_fe_init,
421                 .trigger = {
422                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
423                 .dpcm_playback = 1,
424                 .ops = &skylake_nau8825_fe_ops,
425         },
426         [SKL_DPCM_AUDIO_CP] = {
427                 .name = "Skl Audio Capture Port",
428                 .stream_name = "Audio Record",
429                 .cpu_dai_name = "System Pin",
430                 .platform_name = "0000:00:1f.3",
431                 .dynamic = 1,
432                 .codec_name = "snd-soc-dummy",
433                 .codec_dai_name = "snd-soc-dummy-dai",
434                 .nonatomic = 1,
435                 .trigger = {
436                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
437                 .dpcm_capture = 1,
438                 .ops = &skylake_nau8825_fe_ops,
439         },
440         [SKL_DPCM_AUDIO_REF_CP] = {
441                 .name = "Skl Audio Reference cap",
442                 .stream_name = "Wake on Voice",
443                 .cpu_dai_name = "Reference Pin",
444                 .codec_name = "snd-soc-dummy",
445                 .codec_dai_name = "snd-soc-dummy-dai",
446                 .platform_name = "0000:00:1f.3",
447                 .init = NULL,
448                 .dpcm_capture = 1,
449                 .ignore_suspend = 1,
450                 .nonatomic = 1,
451                 .dynamic = 1,
452                 .ops = &skylaye_refcap_ops,
453         },
454         [SKL_DPCM_AUDIO_DMIC_CP] = {
455                 .name = "Skl Audio DMIC cap",
456                 .stream_name = "dmiccap",
457                 .cpu_dai_name = "DMIC Pin",
458                 .codec_name = "snd-soc-dummy",
459                 .codec_dai_name = "snd-soc-dummy-dai",
460                 .platform_name = "0000:00:1f.3",
461                 .init = NULL,
462                 .dpcm_capture = 1,
463                 .nonatomic = 1,
464                 .dynamic = 1,
465                 .ops = &skylake_dmic_ops,
466         },
467         [SKL_DPCM_AUDIO_HDMI1_PB] = {
468                 .name = "Skl HDMI Port1",
469                 .stream_name = "Hdmi1",
470                 .cpu_dai_name = "HDMI1 Pin",
471                 .codec_name = "snd-soc-dummy",
472                 .codec_dai_name = "snd-soc-dummy-dai",
473                 .platform_name = "0000:00:1f.3",
474                 .dpcm_playback = 1,
475                 .init = NULL,
476                 .trigger = {
477                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
478                 .nonatomic = 1,
479                 .dynamic = 1,
480         },
481         [SKL_DPCM_AUDIO_HDMI2_PB] = {
482                 .name = "Skl HDMI Port2",
483                 .stream_name = "Hdmi2",
484                 .cpu_dai_name = "HDMI2 Pin",
485                 .codec_name = "snd-soc-dummy",
486                 .codec_dai_name = "snd-soc-dummy-dai",
487                 .platform_name = "0000:00:1f.3",
488                 .dpcm_playback = 1,
489                 .init = NULL,
490                 .trigger = {
491                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
492                 .nonatomic = 1,
493                 .dynamic = 1,
494         },
495         [SKL_DPCM_AUDIO_HDMI3_PB] = {
496                 .name = "Skl HDMI Port3",
497                 .stream_name = "Hdmi3",
498                 .cpu_dai_name = "HDMI3 Pin",
499                 .codec_name = "snd-soc-dummy",
500                 .codec_dai_name = "snd-soc-dummy-dai",
501                 .platform_name = "0000:00:1f.3",
502                 .trigger = {
503                         SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
504                 .dpcm_playback = 1,
505                 .init = NULL,
506                 .nonatomic = 1,
507                 .dynamic = 1,
508         },
509         /* Codec-codec link */
510         {
511                 .name = "Skylake IV loop",
512                 .stream_name = "SKL IV Loop",
513                 .cpu_dai_name = "SSP0 Pin",
514                 .platform_name = "0000:00:1f.3",
515                 .codecs = ssm4567_codec_components,
516                 .num_codecs = ARRAY_SIZE(ssm4567_codec_components),
517                 .params = &skl_ssm4567_loop_params,
518         },
519
520         /* Back End DAI links */
521         {
522                 /* SSP0 - Codec */
523                 .name = "SSP0-Codec",
524                 .be_id = 0,
525                 .cpu_dai_name = "SSP0 Pin",
526                 .platform_name = "0000:00:1f.3",
527                 .no_pcm = 1,
528                 .codecs = ssm4567_codec_components,
529                 .num_codecs = ARRAY_SIZE(ssm4567_codec_components),
530                 .dai_fmt = SND_SOC_DAIFMT_DSP_A |
531                         SND_SOC_DAIFMT_IB_NF |
532                         SND_SOC_DAIFMT_CBS_CFS,
533                 .init = skylake_ssm4567_codec_init,
534                 .ignore_pmdown_time = 1,
535                 .be_hw_params_fixup = skylake_ssp_fixup,
536                 .dpcm_playback = 1,
537         },
538         {
539                 /* SSP1 - Codec */
540                 .name = "SSP1-Codec",
541                 .be_id = 1,
542                 .cpu_dai_name = "SSP1 Pin",
543                 .platform_name = "0000:00:1f.3",
544                 .no_pcm = 1,
545                 .codec_name = "i2c-10508825:00",
546                 .codec_dai_name = SKL_NUVOTON_CODEC_DAI,
547                 .init = skylake_nau8825_codec_init,
548                 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
549                         SND_SOC_DAIFMT_CBS_CFS,
550                 .ignore_pmdown_time = 1,
551                 .be_hw_params_fixup = skylake_ssp_fixup,
552                 .ops = &skylake_nau8825_ops,
553                 .dpcm_playback = 1,
554                 .dpcm_capture = 1,
555         },
556         {
557                 .name = "dmic01",
558                 .be_id = 2,
559                 .cpu_dai_name = "DMIC01 Pin",
560                 .codec_name = "dmic-codec",
561                 .codec_dai_name = "dmic-hifi",
562                 .platform_name = "0000:00:1f.3",
563                 .ignore_suspend = 1,
564                 .be_hw_params_fixup = skylake_dmic_fixup,
565                 .dpcm_capture = 1,
566                 .no_pcm = 1,
567         },
568         {
569                 .name = "iDisp1",
570                 .be_id = 3,
571                 .cpu_dai_name = "iDisp1 Pin",
572                 .codec_name = "ehdaudio0D2",
573                 .codec_dai_name = "intel-hdmi-hifi1",
574                 .platform_name = "0000:00:1f.3",
575                 .dpcm_playback = 1,
576                 .init = skylake_hdmi1_init,
577                 .no_pcm = 1,
578         },
579         {
580                 .name = "iDisp2",
581                 .be_id = 4,
582                 .cpu_dai_name = "iDisp2 Pin",
583                 .codec_name = "ehdaudio0D2",
584                 .codec_dai_name = "intel-hdmi-hifi2",
585                 .platform_name = "0000:00:1f.3",
586                 .init = skylake_hdmi2_init,
587                 .dpcm_playback = 1,
588                 .no_pcm = 1,
589         },
590         {
591                 .name = "iDisp3",
592                 .be_id = 5,
593                 .cpu_dai_name = "iDisp3 Pin",
594                 .codec_name = "ehdaudio0D2",
595                 .codec_dai_name = "intel-hdmi-hifi3",
596                 .platform_name = "0000:00:1f.3",
597                 .init = skylake_hdmi3_init,
598                 .dpcm_playback = 1,
599                 .no_pcm = 1,
600         },
601 };
602
603 /* skylake audio machine driver for SPT + NAU88L25 */
604 static struct snd_soc_card skylake_audio_card = {
605         .name = "sklnau8825adi",
606         .owner = THIS_MODULE,
607         .dai_link = skylake_dais,
608         .num_links = ARRAY_SIZE(skylake_dais),
609         .controls = skylake_controls,
610         .num_controls = ARRAY_SIZE(skylake_controls),
611         .dapm_widgets = skylake_widgets,
612         .num_dapm_widgets = ARRAY_SIZE(skylake_widgets),
613         .dapm_routes = skylake_map,
614         .num_dapm_routes = ARRAY_SIZE(skylake_map),
615         .codec_conf = ssm4567_codec_conf,
616         .num_configs = ARRAY_SIZE(ssm4567_codec_conf),
617         .fully_routed = true,
618 };
619
620 static int skylake_audio_probe(struct platform_device *pdev)
621 {
622         skylake_audio_card.dev = &pdev->dev;
623
624         return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card);
625 }
626
627 static struct platform_driver skylake_audio = {
628         .probe = skylake_audio_probe,
629         .driver = {
630                 .name = "skl_nau88l25_ssm4567_i2s",
631                 .pm = &snd_soc_pm_ops,
632         },
633 };
634
635 module_platform_driver(skylake_audio)
636
637 /* Module information */
638 MODULE_AUTHOR("Conrad Cooke  <conrad.cooke@intel.com>");
639 MODULE_AUTHOR("Harsha Priya <harshapriya.n@intel.com>");
640 MODULE_AUTHOR("Naveen M <naveen.m@intel.com>");
641 MODULE_AUTHOR("Sathya Prakash M R <sathya.prakash.m.r@intel.com>");
642 MODULE_AUTHOR("Yong Zhi <yong.zhi@intel.com>");
643 MODULE_DESCRIPTION("Intel Audio Machine driver for SKL with NAU88L25 and SSM4567 in I2S Mode");
644 MODULE_LICENSE("GPL v2");
645 MODULE_ALIAS("platform:skl_nau88l25_ssm4567_i2s");