ASoC: Intel: Split hsw_pcm_data for playback and capture
[deliverable/linux.git] / sound / soc / intel / sst-haswell-pcm.c
1 /*
2 * Intel SST Haswell/Broadwell PCM Support
3 *
4 * Copyright (C) 2013, Intel Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17 #include <linux/module.h>
18 #include <linux/dma-mapping.h>
19 #include <linux/slab.h>
20 #include <linux/delay.h>
21 #include <linux/pm_runtime.h>
22 #include <asm/page.h>
23 #include <asm/pgtable.h>
24 #include <sound/core.h>
25 #include <sound/pcm.h>
26 #include <sound/pcm_params.h>
27 #include <sound/dmaengine_pcm.h>
28 #include <sound/soc.h>
29 #include <sound/tlv.h>
30 #include <sound/compress_driver.h>
31
32 #include "sst-haswell-ipc.h"
33 #include "sst-dsp-priv.h"
34 #include "sst-dsp.h"
35
36 #define HSW_PCM_COUNT 6
37 #define HSW_VOLUME_MAX 0x7FFFFFFF /* 0dB */
38
39 /* simple volume table */
40 static const u32 volume_map[] = {
41 HSW_VOLUME_MAX >> 30,
42 HSW_VOLUME_MAX >> 29,
43 HSW_VOLUME_MAX >> 28,
44 HSW_VOLUME_MAX >> 27,
45 HSW_VOLUME_MAX >> 26,
46 HSW_VOLUME_MAX >> 25,
47 HSW_VOLUME_MAX >> 24,
48 HSW_VOLUME_MAX >> 23,
49 HSW_VOLUME_MAX >> 22,
50 HSW_VOLUME_MAX >> 21,
51 HSW_VOLUME_MAX >> 20,
52 HSW_VOLUME_MAX >> 19,
53 HSW_VOLUME_MAX >> 18,
54 HSW_VOLUME_MAX >> 17,
55 HSW_VOLUME_MAX >> 16,
56 HSW_VOLUME_MAX >> 15,
57 HSW_VOLUME_MAX >> 14,
58 HSW_VOLUME_MAX >> 13,
59 HSW_VOLUME_MAX >> 12,
60 HSW_VOLUME_MAX >> 11,
61 HSW_VOLUME_MAX >> 10,
62 HSW_VOLUME_MAX >> 9,
63 HSW_VOLUME_MAX >> 8,
64 HSW_VOLUME_MAX >> 7,
65 HSW_VOLUME_MAX >> 6,
66 HSW_VOLUME_MAX >> 5,
67 HSW_VOLUME_MAX >> 4,
68 HSW_VOLUME_MAX >> 3,
69 HSW_VOLUME_MAX >> 2,
70 HSW_VOLUME_MAX >> 1,
71 HSW_VOLUME_MAX >> 0,
72 };
73
74 #define HSW_PCM_PERIODS_MAX 64
75 #define HSW_PCM_PERIODS_MIN 2
76
77 #define HSW_PCM_DAI_ID_SYSTEM 0
78 #define HSW_PCM_DAI_ID_OFFLOAD0 1
79 #define HSW_PCM_DAI_ID_OFFLOAD1 2
80 #define HSW_PCM_DAI_ID_LOOPBACK 3
81
82
83 static const struct snd_pcm_hardware hsw_pcm_hardware = {
84 .info = SNDRV_PCM_INFO_MMAP |
85 SNDRV_PCM_INFO_MMAP_VALID |
86 SNDRV_PCM_INFO_INTERLEAVED |
87 SNDRV_PCM_INFO_PAUSE |
88 SNDRV_PCM_INFO_RESUME |
89 SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
90 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |
91 SNDRV_PCM_FMTBIT_S32_LE,
92 .period_bytes_min = PAGE_SIZE,
93 .period_bytes_max = (HSW_PCM_PERIODS_MAX / HSW_PCM_PERIODS_MIN) * PAGE_SIZE,
94 .periods_min = HSW_PCM_PERIODS_MIN,
95 .periods_max = HSW_PCM_PERIODS_MAX,
96 .buffer_bytes_max = HSW_PCM_PERIODS_MAX * PAGE_SIZE,
97 };
98
99 struct hsw_pcm_module_map {
100 int dai_id;
101 int stream;
102 enum sst_hsw_module_id mod_id;
103 };
104
105 /* private data for each PCM DSP stream */
106 struct hsw_pcm_data {
107 int dai_id;
108 struct sst_hsw_stream *stream;
109 struct sst_module_runtime *runtime;
110 struct sst_module_runtime_context context;
111 struct snd_pcm *hsw_pcm;
112 u32 volume[2];
113 struct snd_pcm_substream *substream;
114 struct snd_compr_stream *cstream;
115 unsigned int wpos;
116 struct mutex mutex;
117 bool allocated;
118 int persistent_offset;
119 };
120
121 enum hsw_pm_state {
122 HSW_PM_STATE_D3 = 0,
123 HSW_PM_STATE_D0 = 1,
124 };
125
126 /* private data for the driver */
127 struct hsw_priv_data {
128 /* runtime DSP */
129 struct sst_hsw *hsw;
130 struct device *dev;
131 enum hsw_pm_state pm_state;
132 struct snd_soc_card *soc_card;
133
134 /* page tables */
135 struct snd_dma_buffer dmab[HSW_PCM_COUNT][2];
136
137 /* DAI data */
138 struct hsw_pcm_data pcm[HSW_PCM_COUNT][2];
139 };
140
141
142 /* static mappings between PCMs and modules - may be dynamic in future */
143 static struct hsw_pcm_module_map mod_map[] = {
144 {HSW_PCM_DAI_ID_SYSTEM, 0, SST_HSW_MODULE_PCM_SYSTEM},
145 {HSW_PCM_DAI_ID_OFFLOAD0, 0, SST_HSW_MODULE_PCM},
146 {HSW_PCM_DAI_ID_OFFLOAD1, 0, SST_HSW_MODULE_PCM},
147 {HSW_PCM_DAI_ID_LOOPBACK, 1, SST_HSW_MODULE_PCM_REFERENCE},
148 {HSW_PCM_DAI_ID_SYSTEM, 1, SST_HSW_MODULE_PCM_CAPTURE},
149 };
150
151 static u32 hsw_notify_pointer(struct sst_hsw_stream *stream, void *data);
152
153 static inline u32 hsw_mixer_to_ipc(unsigned int value)
154 {
155 if (value >= ARRAY_SIZE(volume_map))
156 return volume_map[0];
157 else
158 return volume_map[value];
159 }
160
161 static inline unsigned int hsw_ipc_to_mixer(u32 value)
162 {
163 int i;
164
165 for (i = 0; i < ARRAY_SIZE(volume_map); i++) {
166 if (volume_map[i] >= value)
167 return i;
168 }
169
170 return i - 1;
171 }
172
173 static int hsw_stream_volume_put(struct snd_kcontrol *kcontrol,
174 struct snd_ctl_elem_value *ucontrol)
175 {
176 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
177 struct soc_mixer_control *mc =
178 (struct soc_mixer_control *)kcontrol->private_value;
179 struct hsw_priv_data *pdata =
180 snd_soc_platform_get_drvdata(platform);
181 struct hsw_pcm_data *pcm_data;
182 struct sst_hsw *hsw = pdata->hsw;
183 u32 volume;
184 int dai, stream;
185
186 dai = mod_map[mc->reg].dai_id;
187 stream = mod_map[mc->reg].stream;
188 pcm_data = &pdata->pcm[dai][stream];
189
190 mutex_lock(&pcm_data->mutex);
191 pm_runtime_get_sync(pdata->dev);
192
193 if (!pcm_data->stream) {
194 pcm_data->volume[0] =
195 hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
196 pcm_data->volume[1] =
197 hsw_mixer_to_ipc(ucontrol->value.integer.value[1]);
198 pm_runtime_mark_last_busy(pdata->dev);
199 pm_runtime_put_autosuspend(pdata->dev);
200 mutex_unlock(&pcm_data->mutex);
201 return 0;
202 }
203
204 if (ucontrol->value.integer.value[0] ==
205 ucontrol->value.integer.value[1]) {
206 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
207 /* apply volume value to all channels */
208 sst_hsw_stream_set_volume(hsw, pcm_data->stream, 0, SST_HSW_CHANNELS_ALL, volume);
209 } else {
210 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
211 sst_hsw_stream_set_volume(hsw, pcm_data->stream, 0, 0, volume);
212 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[1]);
213 sst_hsw_stream_set_volume(hsw, pcm_data->stream, 0, 1, volume);
214 }
215
216 pm_runtime_mark_last_busy(pdata->dev);
217 pm_runtime_put_autosuspend(pdata->dev);
218 mutex_unlock(&pcm_data->mutex);
219 return 0;
220 }
221
222 static int hsw_stream_volume_get(struct snd_kcontrol *kcontrol,
223 struct snd_ctl_elem_value *ucontrol)
224 {
225 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
226 struct soc_mixer_control *mc =
227 (struct soc_mixer_control *)kcontrol->private_value;
228 struct hsw_priv_data *pdata =
229 snd_soc_platform_get_drvdata(platform);
230 struct hsw_pcm_data *pcm_data;
231 struct sst_hsw *hsw = pdata->hsw;
232 u32 volume;
233 int dai, stream;
234
235 dai = mod_map[mc->reg].dai_id;
236 stream = mod_map[mc->reg].stream;
237 pcm_data = &pdata->pcm[dai][stream];
238
239 mutex_lock(&pcm_data->mutex);
240 pm_runtime_get_sync(pdata->dev);
241
242 if (!pcm_data->stream) {
243 ucontrol->value.integer.value[0] =
244 hsw_ipc_to_mixer(pcm_data->volume[0]);
245 ucontrol->value.integer.value[1] =
246 hsw_ipc_to_mixer(pcm_data->volume[1]);
247 pm_runtime_mark_last_busy(pdata->dev);
248 pm_runtime_put_autosuspend(pdata->dev);
249 mutex_unlock(&pcm_data->mutex);
250 return 0;
251 }
252
253 sst_hsw_stream_get_volume(hsw, pcm_data->stream, 0, 0, &volume);
254 ucontrol->value.integer.value[0] = hsw_ipc_to_mixer(volume);
255 sst_hsw_stream_get_volume(hsw, pcm_data->stream, 0, 1, &volume);
256 ucontrol->value.integer.value[1] = hsw_ipc_to_mixer(volume);
257
258 pm_runtime_mark_last_busy(pdata->dev);
259 pm_runtime_put_autosuspend(pdata->dev);
260 mutex_unlock(&pcm_data->mutex);
261
262 return 0;
263 }
264
265 static int hsw_volume_put(struct snd_kcontrol *kcontrol,
266 struct snd_ctl_elem_value *ucontrol)
267 {
268 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
269 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform);
270 struct sst_hsw *hsw = pdata->hsw;
271 u32 volume;
272
273 pm_runtime_get_sync(pdata->dev);
274
275 if (ucontrol->value.integer.value[0] ==
276 ucontrol->value.integer.value[1]) {
277
278 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
279 sst_hsw_mixer_set_volume(hsw, 0, SST_HSW_CHANNELS_ALL, volume);
280
281 } else {
282 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
283 sst_hsw_mixer_set_volume(hsw, 0, 0, volume);
284
285 volume = hsw_mixer_to_ipc(ucontrol->value.integer.value[1]);
286 sst_hsw_mixer_set_volume(hsw, 0, 1, volume);
287 }
288
289 pm_runtime_mark_last_busy(pdata->dev);
290 pm_runtime_put_autosuspend(pdata->dev);
291 return 0;
292 }
293
294 static int hsw_volume_get(struct snd_kcontrol *kcontrol,
295 struct snd_ctl_elem_value *ucontrol)
296 {
297 struct snd_soc_platform *platform = snd_soc_kcontrol_platform(kcontrol);
298 struct hsw_priv_data *pdata = snd_soc_platform_get_drvdata(platform);
299 struct sst_hsw *hsw = pdata->hsw;
300 unsigned int volume = 0;
301
302 pm_runtime_get_sync(pdata->dev);
303 sst_hsw_mixer_get_volume(hsw, 0, 0, &volume);
304 ucontrol->value.integer.value[0] = hsw_ipc_to_mixer(volume);
305
306 sst_hsw_mixer_get_volume(hsw, 0, 1, &volume);
307 ucontrol->value.integer.value[1] = hsw_ipc_to_mixer(volume);
308
309 pm_runtime_mark_last_busy(pdata->dev);
310 pm_runtime_put_autosuspend(pdata->dev);
311 return 0;
312 }
313
314 /* TLV used by both global and stream volumes */
315 static const DECLARE_TLV_DB_SCALE(hsw_vol_tlv, -9000, 300, 1);
316
317 /* System Pin has no volume control */
318 static const struct snd_kcontrol_new hsw_volume_controls[] = {
319 /* Global DSP volume */
320 SOC_DOUBLE_EXT_TLV("Master Playback Volume", 0, 0, 8,
321 ARRAY_SIZE(volume_map) - 1, 0,
322 hsw_volume_get, hsw_volume_put, hsw_vol_tlv),
323 /* Offload 0 volume */
324 SOC_DOUBLE_EXT_TLV("Media0 Playback Volume", 1, 0, 8,
325 ARRAY_SIZE(volume_map) - 1, 0,
326 hsw_stream_volume_get, hsw_stream_volume_put, hsw_vol_tlv),
327 /* Offload 1 volume */
328 SOC_DOUBLE_EXT_TLV("Media1 Playback Volume", 2, 0, 8,
329 ARRAY_SIZE(volume_map) - 1, 0,
330 hsw_stream_volume_get, hsw_stream_volume_put, hsw_vol_tlv),
331 /* Mic Capture volume */
332 SOC_DOUBLE_EXT_TLV("Mic Capture Volume", 4, 0, 8,
333 ARRAY_SIZE(volume_map) - 1, 0,
334 hsw_stream_volume_get, hsw_stream_volume_put, hsw_vol_tlv),
335 };
336
337 /* Create DMA buffer page table for DSP */
338 static int create_adsp_page_table(struct snd_pcm_substream *substream,
339 struct hsw_priv_data *pdata, struct snd_soc_pcm_runtime *rtd,
340 unsigned char *dma_area, size_t size, int pcm)
341 {
342 struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
343 int i, pages, stream = substream->stream;
344
345 pages = snd_sgbuf_aligned_pages(size);
346
347 dev_dbg(rtd->dev, "generating page table for %p size 0x%zu pages %d\n",
348 dma_area, size, pages);
349
350 for (i = 0; i < pages; i++) {
351 u32 idx = (((i << 2) + i)) >> 1;
352 u32 pfn = snd_sgbuf_get_addr(dmab, i * PAGE_SIZE) >> PAGE_SHIFT;
353 u32 *pg_table;
354
355 dev_dbg(rtd->dev, "pfn i %i idx %d pfn %x\n", i, idx, pfn);
356
357 pg_table = (u32 *)(pdata->dmab[pcm][stream].area + idx);
358
359 if (i & 1)
360 *pg_table |= (pfn << 4);
361 else
362 *pg_table |= pfn;
363 }
364
365 return 0;
366 }
367
368 /* this may get called several times by oss emulation */
369 static int hsw_pcm_hw_params(struct snd_pcm_substream *substream,
370 struct snd_pcm_hw_params *params)
371 {
372 struct snd_soc_pcm_runtime *rtd = substream->private_data;
373 struct snd_pcm_runtime *runtime = substream->runtime;
374 struct hsw_priv_data *pdata =
375 snd_soc_platform_get_drvdata(rtd->platform);
376 struct hsw_pcm_data *pcm_data;
377 struct sst_hsw *hsw = pdata->hsw;
378 struct sst_module *module_data;
379 struct sst_dsp *dsp;
380 struct snd_dma_buffer *dmab;
381 enum sst_hsw_stream_type stream_type;
382 enum sst_hsw_stream_path_id path_id;
383 u32 rate, bits, map, pages, module_id;
384 u8 channels;
385 int ret, dai;
386
387 dai = mod_map[rtd->cpu_dai->id].dai_id;
388 pcm_data = &pdata->pcm[dai][substream->stream];
389
390 /* check if we are being called a subsequent time */
391 if (pcm_data->allocated) {
392 ret = sst_hsw_stream_reset(hsw, pcm_data->stream);
393 if (ret < 0)
394 dev_dbg(rtd->dev, "error: reset stream failed %d\n",
395 ret);
396
397 ret = sst_hsw_stream_free(hsw, pcm_data->stream);
398 if (ret < 0) {
399 dev_dbg(rtd->dev, "error: free stream failed %d\n",
400 ret);
401 return ret;
402 }
403 pcm_data->allocated = false;
404
405 pcm_data->stream = sst_hsw_stream_new(hsw, rtd->cpu_dai->id,
406 hsw_notify_pointer, pcm_data);
407 if (pcm_data->stream == NULL) {
408 dev_err(rtd->dev, "error: failed to create stream\n");
409 return -EINVAL;
410 }
411 }
412
413 /* stream direction */
414 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
415 path_id = SST_HSW_STREAM_PATH_SSP0_OUT;
416 else
417 path_id = SST_HSW_STREAM_PATH_SSP0_IN;
418
419 /* DSP stream type depends on DAI ID */
420 switch (rtd->cpu_dai->id) {
421 case 0:
422 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
423 stream_type = SST_HSW_STREAM_TYPE_SYSTEM;
424 module_id = SST_HSW_MODULE_PCM_SYSTEM;
425 }
426 else {
427 stream_type = SST_HSW_STREAM_TYPE_CAPTURE;
428 module_id = SST_HSW_MODULE_PCM_CAPTURE;
429 }
430 break;
431 case 1:
432 case 2:
433 stream_type = SST_HSW_STREAM_TYPE_RENDER;
434 module_id = SST_HSW_MODULE_PCM;
435 break;
436 case 3:
437 /* path ID needs to be OUT for loopback */
438 stream_type = SST_HSW_STREAM_TYPE_LOOPBACK;
439 path_id = SST_HSW_STREAM_PATH_SSP0_OUT;
440 module_id = SST_HSW_MODULE_PCM_REFERENCE;
441 break;
442 default:
443 dev_err(rtd->dev, "error: invalid DAI ID %d\n",
444 rtd->cpu_dai->id);
445 return -EINVAL;
446 };
447
448 ret = sst_hsw_stream_format(hsw, pcm_data->stream,
449 path_id, stream_type, SST_HSW_STREAM_FORMAT_PCM_FORMAT);
450 if (ret < 0) {
451 dev_err(rtd->dev, "error: failed to set format %d\n", ret);
452 return ret;
453 }
454
455 rate = params_rate(params);
456 ret = sst_hsw_stream_set_rate(hsw, pcm_data->stream, rate);
457 if (ret < 0) {
458 dev_err(rtd->dev, "error: could not set rate %d\n", rate);
459 return ret;
460 }
461
462 switch (params_format(params)) {
463 case SNDRV_PCM_FORMAT_S16_LE:
464 bits = SST_HSW_DEPTH_16BIT;
465 sst_hsw_stream_set_valid(hsw, pcm_data->stream, 16);
466 break;
467 case SNDRV_PCM_FORMAT_S24_LE:
468 bits = SST_HSW_DEPTH_32BIT;
469 sst_hsw_stream_set_valid(hsw, pcm_data->stream, 24);
470 break;
471 case SNDRV_PCM_FORMAT_S8:
472 bits = SST_HSW_DEPTH_8BIT;
473 sst_hsw_stream_set_valid(hsw, pcm_data->stream, 8);
474 break;
475 case SNDRV_PCM_FORMAT_S32_LE:
476 bits = SST_HSW_DEPTH_32BIT;
477 sst_hsw_stream_set_valid(hsw, pcm_data->stream, 32);
478 break;
479 default:
480 dev_err(rtd->dev, "error: invalid format %d\n",
481 params_format(params));
482 return -EINVAL;
483 }
484
485 ret = sst_hsw_stream_set_bits(hsw, pcm_data->stream, bits);
486 if (ret < 0) {
487 dev_err(rtd->dev, "error: could not set bits %d\n", bits);
488 return ret;
489 }
490
491 channels = params_channels(params);
492 map = create_channel_map(SST_HSW_CHANNEL_CONFIG_STEREO);
493 sst_hsw_stream_set_map_config(hsw, pcm_data->stream,
494 map, SST_HSW_CHANNEL_CONFIG_STEREO);
495
496 ret = sst_hsw_stream_set_channels(hsw, pcm_data->stream, channels);
497 if (ret < 0) {
498 dev_err(rtd->dev, "error: could not set channels %d\n",
499 channels);
500 return ret;
501 }
502
503 ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
504 if (ret < 0) {
505 dev_err(rtd->dev, "error: could not allocate %d bytes for PCM %d\n",
506 params_buffer_bytes(params), ret);
507 return ret;
508 }
509
510 dmab = snd_pcm_get_dma_buf(substream);
511
512 ret = create_adsp_page_table(substream, pdata, rtd, runtime->dma_area,
513 runtime->dma_bytes, rtd->cpu_dai->id);
514 if (ret < 0)
515 return ret;
516
517 sst_hsw_stream_set_style(hsw, pcm_data->stream,
518 SST_HSW_INTERLEAVING_PER_CHANNEL);
519
520 if (runtime->dma_bytes % PAGE_SIZE)
521 pages = (runtime->dma_bytes / PAGE_SIZE) + 1;
522 else
523 pages = runtime->dma_bytes / PAGE_SIZE;
524
525 ret = sst_hsw_stream_buffer(hsw, pcm_data->stream,
526 pdata->dmab[rtd->cpu_dai->id][substream->stream].addr,
527 pages, runtime->dma_bytes, 0,
528 snd_sgbuf_get_addr(dmab, 0) >> PAGE_SHIFT);
529 if (ret < 0) {
530 dev_err(rtd->dev, "error: failed to set DMA buffer %d\n", ret);
531 return ret;
532 }
533
534 dsp = sst_hsw_get_dsp(hsw);
535
536 module_data = sst_module_get_from_id(dsp, module_id);
537 if (module_data == NULL) {
538 dev_err(rtd->dev, "error: failed to get module config\n");
539 return -EINVAL;
540 }
541
542 sst_hsw_stream_set_module_info(hsw, pcm_data->stream,
543 pcm_data->runtime);
544
545 ret = sst_hsw_stream_commit(hsw, pcm_data->stream);
546 if (ret < 0) {
547 dev_err(rtd->dev, "error: failed to commit stream %d\n", ret);
548 return ret;
549 }
550
551 if (!pcm_data->allocated) {
552 /* Set previous saved volume */
553 sst_hsw_stream_set_volume(hsw, pcm_data->stream, 0,
554 0, pcm_data->volume[0]);
555 sst_hsw_stream_set_volume(hsw, pcm_data->stream, 0,
556 1, pcm_data->volume[1]);
557 pcm_data->allocated = true;
558 }
559
560 ret = sst_hsw_stream_pause(hsw, pcm_data->stream, 1);
561 if (ret < 0)
562 dev_err(rtd->dev, "error: failed to pause %d\n", ret);
563
564 return 0;
565 }
566
567 static int hsw_pcm_hw_free(struct snd_pcm_substream *substream)
568 {
569 snd_pcm_lib_free_pages(substream);
570 return 0;
571 }
572
573 static int hsw_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
574 {
575 struct snd_soc_pcm_runtime *rtd = substream->private_data;
576 struct hsw_priv_data *pdata =
577 snd_soc_platform_get_drvdata(rtd->platform);
578 struct hsw_pcm_data *pcm_data;
579 struct sst_hsw *hsw = pdata->hsw;
580 int dai;
581
582 dai = mod_map[rtd->cpu_dai->id].dai_id;
583 pcm_data = &pdata->pcm[dai][substream->stream];
584
585 switch (cmd) {
586 case SNDRV_PCM_TRIGGER_START:
587 case SNDRV_PCM_TRIGGER_RESUME:
588 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
589 sst_hsw_stream_resume(hsw, pcm_data->stream, 0);
590 break;
591 case SNDRV_PCM_TRIGGER_STOP:
592 case SNDRV_PCM_TRIGGER_SUSPEND:
593 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
594 sst_hsw_stream_pause(hsw, pcm_data->stream, 0);
595 break;
596 default:
597 break;
598 }
599
600 return 0;
601 }
602
603 static u32 hsw_notify_pointer(struct sst_hsw_stream *stream, void *data)
604 {
605 struct hsw_pcm_data *pcm_data = data;
606 struct snd_pcm_substream *substream = pcm_data->substream;
607 struct snd_pcm_runtime *runtime = substream->runtime;
608 struct snd_soc_pcm_runtime *rtd = substream->private_data;
609 u32 pos;
610
611 pos = frames_to_bytes(runtime,
612 (runtime->control->appl_ptr % runtime->buffer_size));
613
614 dev_vdbg(rtd->dev, "PCM: App pointer %d bytes\n", pos);
615
616 /* let alsa know we have play a period */
617 snd_pcm_period_elapsed(substream);
618 return pos;
619 }
620
621 static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_pcm_substream *substream)
622 {
623 struct snd_soc_pcm_runtime *rtd = substream->private_data;
624 struct snd_pcm_runtime *runtime = substream->runtime;
625 struct hsw_priv_data *pdata =
626 snd_soc_platform_get_drvdata(rtd->platform);
627 struct hsw_pcm_data *pcm_data;
628 struct sst_hsw *hsw = pdata->hsw;
629 snd_pcm_uframes_t offset;
630 uint64_t ppos;
631 u32 position;
632 int dai;
633
634 dai = mod_map[rtd->cpu_dai->id].dai_id;
635 pcm_data = &pdata->pcm[dai][substream->stream];
636 position = sst_hsw_get_dsp_position(hsw, pcm_data->stream);
637
638 offset = bytes_to_frames(runtime, position);
639 ppos = sst_hsw_get_dsp_presentation_position(hsw, pcm_data->stream);
640
641 dev_vdbg(rtd->dev, "PCM: DMA pointer %du bytes, pos %llu\n",
642 position, ppos);
643 return offset;
644 }
645
646 static int hsw_pcm_open(struct snd_pcm_substream *substream)
647 {
648 struct snd_soc_pcm_runtime *rtd = substream->private_data;
649 struct hsw_priv_data *pdata =
650 snd_soc_platform_get_drvdata(rtd->platform);
651 struct hsw_pcm_data *pcm_data;
652 struct sst_hsw *hsw = pdata->hsw;
653 int dai;
654
655 dai = mod_map[rtd->cpu_dai->id].dai_id;
656 pcm_data = &pdata->pcm[dai][substream->stream];
657
658 mutex_lock(&pcm_data->mutex);
659 pm_runtime_get_sync(pdata->dev);
660
661 snd_soc_pcm_set_drvdata(rtd, pcm_data);
662 pcm_data->substream = substream;
663
664 snd_soc_set_runtime_hwparams(substream, &hsw_pcm_hardware);
665
666 pcm_data->stream = sst_hsw_stream_new(hsw, rtd->cpu_dai->id,
667 hsw_notify_pointer, pcm_data);
668 if (pcm_data->stream == NULL) {
669 dev_err(rtd->dev, "error: failed to create stream\n");
670 pm_runtime_mark_last_busy(pdata->dev);
671 pm_runtime_put_autosuspend(pdata->dev);
672 mutex_unlock(&pcm_data->mutex);
673 return -EINVAL;
674 }
675
676 mutex_unlock(&pcm_data->mutex);
677 return 0;
678 }
679
680 static int hsw_pcm_close(struct snd_pcm_substream *substream)
681 {
682 struct snd_soc_pcm_runtime *rtd = substream->private_data;
683 struct hsw_priv_data *pdata =
684 snd_soc_platform_get_drvdata(rtd->platform);
685 struct hsw_pcm_data *pcm_data;
686 struct sst_hsw *hsw = pdata->hsw;
687 int ret, dai;
688
689 dai = mod_map[rtd->cpu_dai->id].dai_id;
690 pcm_data = &pdata->pcm[dai][substream->stream];
691
692 mutex_lock(&pcm_data->mutex);
693 ret = sst_hsw_stream_reset(hsw, pcm_data->stream);
694 if (ret < 0) {
695 dev_dbg(rtd->dev, "error: reset stream failed %d\n", ret);
696 goto out;
697 }
698
699 ret = sst_hsw_stream_free(hsw, pcm_data->stream);
700 if (ret < 0) {
701 dev_dbg(rtd->dev, "error: free stream failed %d\n", ret);
702 goto out;
703 }
704 pcm_data->allocated = 0;
705 pcm_data->stream = NULL;
706
707 out:
708 pm_runtime_mark_last_busy(pdata->dev);
709 pm_runtime_put_autosuspend(pdata->dev);
710 mutex_unlock(&pcm_data->mutex);
711 return ret;
712 }
713
714 static struct snd_pcm_ops hsw_pcm_ops = {
715 .open = hsw_pcm_open,
716 .close = hsw_pcm_close,
717 .ioctl = snd_pcm_lib_ioctl,
718 .hw_params = hsw_pcm_hw_params,
719 .hw_free = hsw_pcm_hw_free,
720 .trigger = hsw_pcm_trigger,
721 .pointer = hsw_pcm_pointer,
722 .page = snd_pcm_sgbuf_ops_page,
723 };
724
725 static int hsw_pcm_create_modules(struct hsw_priv_data *pdata)
726 {
727 struct sst_hsw *hsw = pdata->hsw;
728 struct hsw_pcm_data *pcm_data;
729 int i;
730
731 for (i = 0; i < ARRAY_SIZE(mod_map); i++) {
732 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
733
734 /* create new runtime module, use same offset if recreated */
735 pcm_data->runtime = sst_hsw_runtime_module_create(hsw,
736 mod_map[i].mod_id, pcm_data->persistent_offset);
737 if (pcm_data->runtime == NULL)
738 goto err;
739 pcm_data->persistent_offset =
740 pcm_data->runtime->persistent_offset;
741 }
742
743 return 0;
744
745 err:
746 for (--i; i >= 0; i--) {
747 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
748 sst_hsw_runtime_module_free(pcm_data->runtime);
749 }
750
751 return -ENODEV;
752 }
753
754 static void hsw_pcm_free_modules(struct hsw_priv_data *pdata)
755 {
756 struct hsw_pcm_data *pcm_data;
757 int i;
758
759 for (i = 0; i < ARRAY_SIZE(mod_map); i++) {
760 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
761
762 sst_hsw_runtime_module_free(pcm_data->runtime);
763 }
764 }
765
766 static int hsw_pcm_new(struct snd_soc_pcm_runtime *rtd)
767 {
768 struct snd_pcm *pcm = rtd->pcm;
769 struct snd_soc_platform *platform = rtd->platform;
770 struct sst_pdata *pdata = dev_get_platdata(platform->dev);
771 struct hsw_priv_data *priv_data = dev_get_drvdata(platform->dev);
772 struct device *dev = pdata->dma_dev;
773 int ret = 0;
774
775 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream ||
776 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
777 ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
778 SNDRV_DMA_TYPE_DEV_SG,
779 dev,
780 hsw_pcm_hardware.buffer_bytes_max,
781 hsw_pcm_hardware.buffer_bytes_max);
782 if (ret) {
783 dev_err(rtd->dev, "dma buffer allocation failed %d\n",
784 ret);
785 return ret;
786 }
787 }
788 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
789 priv_data->pcm[rtd->cpu_dai->id][SNDRV_PCM_STREAM_PLAYBACK].hsw_pcm = pcm;
790 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream)
791 priv_data->pcm[rtd->cpu_dai->id][SNDRV_PCM_STREAM_CAPTURE].hsw_pcm = pcm;
792
793 return ret;
794 }
795
796 #define HSW_FORMATS \
797 (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
798
799 static struct snd_soc_dai_driver hsw_dais[] = {
800 {
801 .name = "System Pin",
802 .id = HSW_PCM_DAI_ID_SYSTEM,
803 .playback = {
804 .stream_name = "System Playback",
805 .channels_min = 2,
806 .channels_max = 2,
807 .rates = SNDRV_PCM_RATE_48000,
808 .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE,
809 },
810 .capture = {
811 .stream_name = "Analog Capture",
812 .channels_min = 2,
813 .channels_max = 4,
814 .rates = SNDRV_PCM_RATE_48000,
815 .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE,
816 },
817 },
818 {
819 /* PCM */
820 .name = "Offload0 Pin",
821 .id = HSW_PCM_DAI_ID_OFFLOAD0,
822 .playback = {
823 .stream_name = "Offload0 Playback",
824 .channels_min = 2,
825 .channels_max = 2,
826 .rates = SNDRV_PCM_RATE_8000_192000,
827 .formats = HSW_FORMATS,
828 },
829 },
830 {
831 /* PCM */
832 .name = "Offload1 Pin",
833 .id = HSW_PCM_DAI_ID_OFFLOAD1,
834 .playback = {
835 .stream_name = "Offload1 Playback",
836 .channels_min = 2,
837 .channels_max = 2,
838 .rates = SNDRV_PCM_RATE_8000_192000,
839 .formats = HSW_FORMATS,
840 },
841 },
842 {
843 .name = "Loopback Pin",
844 .id = HSW_PCM_DAI_ID_LOOPBACK,
845 .capture = {
846 .stream_name = "Loopback Capture",
847 .channels_min = 2,
848 .channels_max = 2,
849 .rates = SNDRV_PCM_RATE_48000,
850 .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE,
851 },
852 },
853 };
854
855 static const struct snd_soc_dapm_widget widgets[] = {
856
857 /* Backend DAIs */
858 SND_SOC_DAPM_AIF_IN("SSP0 CODEC IN", NULL, 0, SND_SOC_NOPM, 0, 0),
859 SND_SOC_DAPM_AIF_OUT("SSP0 CODEC OUT", NULL, 0, SND_SOC_NOPM, 0, 0),
860 SND_SOC_DAPM_AIF_IN("SSP1 BT IN", NULL, 0, SND_SOC_NOPM, 0, 0),
861 SND_SOC_DAPM_AIF_OUT("SSP1 BT OUT", NULL, 0, SND_SOC_NOPM, 0, 0),
862
863 /* Global Playback Mixer */
864 SND_SOC_DAPM_MIXER("Playback VMixer", SND_SOC_NOPM, 0, 0, NULL, 0),
865 };
866
867 static const struct snd_soc_dapm_route graph[] = {
868
869 /* Playback Mixer */
870 {"Playback VMixer", NULL, "System Playback"},
871 {"Playback VMixer", NULL, "Offload0 Playback"},
872 {"Playback VMixer", NULL, "Offload1 Playback"},
873
874 {"SSP0 CODEC OUT", NULL, "Playback VMixer"},
875
876 {"Analog Capture", NULL, "SSP0 CODEC IN"},
877 };
878
879 static int hsw_pcm_probe(struct snd_soc_platform *platform)
880 {
881 struct hsw_priv_data *priv_data = snd_soc_platform_get_drvdata(platform);
882 struct sst_pdata *pdata = dev_get_platdata(platform->dev);
883 struct device *dma_dev, *dev;
884 int i, ret = 0;
885
886 if (!pdata)
887 return -ENODEV;
888
889 dev = platform->dev;
890 dma_dev = pdata->dma_dev;
891
892 priv_data->hsw = pdata->dsp;
893 priv_data->dev = platform->dev;
894 priv_data->pm_state = HSW_PM_STATE_D0;
895 priv_data->soc_card = platform->component.card;
896
897 /* allocate DSP buffer page tables */
898 for (i = 0; i < ARRAY_SIZE(hsw_dais); i++) {
899
900 /* playback */
901 if (hsw_dais[i].playback.channels_min) {
902 mutex_init(&priv_data->pcm[i][SNDRV_PCM_STREAM_PLAYBACK].mutex);
903 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, dma_dev,
904 PAGE_SIZE, &priv_data->dmab[i][0]);
905 if (ret < 0)
906 goto err;
907 }
908
909 /* capture */
910 if (hsw_dais[i].capture.channels_min) {
911 mutex_init(&priv_data->pcm[i][SNDRV_PCM_STREAM_CAPTURE].mutex);
912 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, dma_dev,
913 PAGE_SIZE, &priv_data->dmab[i][1]);
914 if (ret < 0)
915 goto err;
916 }
917 }
918
919 /* allocate runtime modules */
920 hsw_pcm_create_modules(priv_data);
921
922 /* enable runtime PM with auto suspend */
923 pm_runtime_set_autosuspend_delay(platform->dev,
924 SST_RUNTIME_SUSPEND_DELAY);
925 pm_runtime_use_autosuspend(platform->dev);
926 pm_runtime_enable(platform->dev);
927 pm_runtime_idle(platform->dev);
928
929 return 0;
930
931 err:
932 for (;i >= 0; i--) {
933 if (hsw_dais[i].playback.channels_min)
934 snd_dma_free_pages(&priv_data->dmab[i][0]);
935 if (hsw_dais[i].capture.channels_min)
936 snd_dma_free_pages(&priv_data->dmab[i][1]);
937 }
938 return ret;
939 }
940
941 static int hsw_pcm_remove(struct snd_soc_platform *platform)
942 {
943 struct hsw_priv_data *priv_data =
944 snd_soc_platform_get_drvdata(platform);
945 int i;
946
947 pm_runtime_disable(platform->dev);
948 hsw_pcm_free_modules(priv_data);
949
950 for (i = 0; i < ARRAY_SIZE(hsw_dais); i++) {
951 if (hsw_dais[i].playback.channels_min)
952 snd_dma_free_pages(&priv_data->dmab[i][0]);
953 if (hsw_dais[i].capture.channels_min)
954 snd_dma_free_pages(&priv_data->dmab[i][1]);
955 }
956
957 return 0;
958 }
959
960 static struct snd_soc_platform_driver hsw_soc_platform = {
961 .probe = hsw_pcm_probe,
962 .remove = hsw_pcm_remove,
963 .ops = &hsw_pcm_ops,
964 .pcm_new = hsw_pcm_new,
965 };
966
967 static const struct snd_soc_component_driver hsw_dai_component = {
968 .name = "haswell-dai",
969 .controls = hsw_volume_controls,
970 .num_controls = ARRAY_SIZE(hsw_volume_controls),
971 .dapm_widgets = widgets,
972 .num_dapm_widgets = ARRAY_SIZE(widgets),
973 .dapm_routes = graph,
974 .num_dapm_routes = ARRAY_SIZE(graph),
975 };
976
977 static int hsw_pcm_dev_probe(struct platform_device *pdev)
978 {
979 struct sst_pdata *sst_pdata = dev_get_platdata(&pdev->dev);
980 struct hsw_priv_data *priv_data;
981 int ret;
982
983 if (!sst_pdata)
984 return -EINVAL;
985
986 priv_data = devm_kzalloc(&pdev->dev, sizeof(*priv_data), GFP_KERNEL);
987 if (!priv_data)
988 return -ENOMEM;
989
990 ret = sst_hsw_dsp_init(&pdev->dev, sst_pdata);
991 if (ret < 0)
992 return -ENODEV;
993
994 priv_data->hsw = sst_pdata->dsp;
995 platform_set_drvdata(pdev, priv_data);
996
997 ret = snd_soc_register_platform(&pdev->dev, &hsw_soc_platform);
998 if (ret < 0)
999 goto err_plat;
1000
1001 ret = snd_soc_register_component(&pdev->dev, &hsw_dai_component,
1002 hsw_dais, ARRAY_SIZE(hsw_dais));
1003 if (ret < 0)
1004 goto err_comp;
1005
1006 return 0;
1007
1008 err_comp:
1009 snd_soc_unregister_platform(&pdev->dev);
1010 err_plat:
1011 sst_hsw_dsp_free(&pdev->dev, sst_pdata);
1012 return 0;
1013 }
1014
1015 static int hsw_pcm_dev_remove(struct platform_device *pdev)
1016 {
1017 struct sst_pdata *sst_pdata = dev_get_platdata(&pdev->dev);
1018
1019 snd_soc_unregister_platform(&pdev->dev);
1020 snd_soc_unregister_component(&pdev->dev);
1021 sst_hsw_dsp_free(&pdev->dev, sst_pdata);
1022
1023 return 0;
1024 }
1025
1026 #ifdef CONFIG_PM
1027
1028 static int hsw_pcm_runtime_idle(struct device *dev)
1029 {
1030 return 0;
1031 }
1032
1033 static int hsw_pcm_runtime_suspend(struct device *dev)
1034 {
1035 struct hsw_priv_data *pdata = dev_get_drvdata(dev);
1036 struct sst_hsw *hsw = pdata->hsw;
1037
1038 if (pdata->pm_state == HSW_PM_STATE_D3)
1039 return 0;
1040
1041 sst_hsw_dsp_runtime_suspend(hsw);
1042 sst_hsw_dsp_runtime_sleep(hsw);
1043 pdata->pm_state = HSW_PM_STATE_D3;
1044
1045 return 0;
1046 }
1047
1048 static int hsw_pcm_runtime_resume(struct device *dev)
1049 {
1050 struct hsw_priv_data *pdata = dev_get_drvdata(dev);
1051 struct sst_hsw *hsw = pdata->hsw;
1052 int ret;
1053
1054 if (pdata->pm_state == HSW_PM_STATE_D0)
1055 return 0;
1056
1057 ret = sst_hsw_dsp_load(hsw);
1058 if (ret < 0) {
1059 dev_err(dev, "failed to reload %d\n", ret);
1060 return ret;
1061 }
1062
1063 ret = hsw_pcm_create_modules(pdata);
1064 if (ret < 0) {
1065 dev_err(dev, "failed to create modules %d\n", ret);
1066 return ret;
1067 }
1068
1069 ret = sst_hsw_dsp_runtime_resume(hsw);
1070 if (ret < 0)
1071 return ret;
1072 else if (ret == 1) /* no action required */
1073 return 0;
1074
1075 pdata->pm_state = HSW_PM_STATE_D0;
1076 return ret;
1077 }
1078
1079 #else
1080 #define hsw_pcm_runtime_idle NULL
1081 #define hsw_pcm_runtime_suspend NULL
1082 #define hsw_pcm_runtime_resume NULL
1083 #endif
1084
1085 #ifdef CONFIG_PM
1086
1087 static void hsw_pcm_complete(struct device *dev)
1088 {
1089 struct hsw_priv_data *pdata = dev_get_drvdata(dev);
1090 struct sst_hsw *hsw = pdata->hsw;
1091 struct hsw_pcm_data *pcm_data;
1092 int i, err;
1093
1094 if (pdata->pm_state == HSW_PM_STATE_D0)
1095 return;
1096
1097 err = sst_hsw_dsp_load(hsw);
1098 if (err < 0) {
1099 dev_err(dev, "failed to reload %d\n", err);
1100 return;
1101 }
1102
1103 err = hsw_pcm_create_modules(pdata);
1104 if (err < 0) {
1105 dev_err(dev, "failed to create modules %d\n", err);
1106 return;
1107 }
1108
1109 for (i = 0; i < ARRAY_SIZE(mod_map); i++) {
1110 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
1111
1112 if (!pcm_data->substream)
1113 continue;
1114
1115 err = sst_module_runtime_restore(pcm_data->runtime,
1116 &pcm_data->context);
1117 if (err < 0)
1118 dev_err(dev, "failed to restore context for PCM %d\n", i);
1119 }
1120
1121 snd_soc_resume(pdata->soc_card->dev);
1122
1123 err = sst_hsw_dsp_runtime_resume(hsw);
1124 if (err < 0)
1125 return;
1126 else if (err == 1) /* no action required */
1127 return;
1128
1129 pdata->pm_state = HSW_PM_STATE_D0;
1130 return;
1131 }
1132
1133 static int hsw_pcm_prepare(struct device *dev)
1134 {
1135 struct hsw_priv_data *pdata = dev_get_drvdata(dev);
1136 struct sst_hsw *hsw = pdata->hsw;
1137 struct hsw_pcm_data *pcm_data;
1138 int i, err;
1139
1140 if (pdata->pm_state == HSW_PM_STATE_D3)
1141 return 0;
1142 /* suspend all active streams */
1143 for (i = 0; i < ARRAY_SIZE(mod_map); i++) {
1144 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
1145
1146 if (!pcm_data->substream)
1147 continue;
1148 dev_dbg(dev, "suspending pcm %d\n", i);
1149 snd_pcm_suspend_all(pcm_data->hsw_pcm);
1150
1151 /* We need to wait until the DSP FW stops the streams */
1152 msleep(2);
1153 }
1154
1155 snd_soc_suspend(pdata->soc_card->dev);
1156 snd_soc_poweroff(pdata->soc_card->dev);
1157
1158 /* enter D3 state and stall */
1159 sst_hsw_dsp_runtime_suspend(hsw);
1160
1161 /* preserve persistent memory */
1162 for (i = 0; i < ARRAY_SIZE(mod_map); i++) {
1163 pcm_data = &pdata->pcm[mod_map[i].dai_id][mod_map[i].stream];
1164
1165 if (!pcm_data->substream)
1166 continue;
1167
1168 dev_dbg(dev, "saving context pcm %d\n", i);
1169 err = sst_module_runtime_save(pcm_data->runtime,
1170 &pcm_data->context);
1171 if (err < 0)
1172 dev_err(dev, "failed to save context for PCM %d\n", i);
1173 }
1174
1175 /* put the DSP to sleep */
1176 sst_hsw_dsp_runtime_sleep(hsw);
1177 pdata->pm_state = HSW_PM_STATE_D3;
1178
1179 return 0;
1180 }
1181
1182 #else
1183 #define hsw_pcm_prepare NULL
1184 #define hsw_pcm_complete NULL
1185 #endif
1186
1187 static const struct dev_pm_ops hsw_pcm_pm = {
1188 .runtime_idle = hsw_pcm_runtime_idle,
1189 .runtime_suspend = hsw_pcm_runtime_suspend,
1190 .runtime_resume = hsw_pcm_runtime_resume,
1191 .prepare = hsw_pcm_prepare,
1192 .complete = hsw_pcm_complete,
1193 };
1194
1195 static struct platform_driver hsw_pcm_driver = {
1196 .driver = {
1197 .name = "haswell-pcm-audio",
1198 .pm = &hsw_pcm_pm,
1199 },
1200
1201 .probe = hsw_pcm_dev_probe,
1202 .remove = hsw_pcm_dev_remove,
1203 };
1204 module_platform_driver(hsw_pcm_driver);
1205
1206 MODULE_AUTHOR("Liam Girdwood, Xingchao Wang");
1207 MODULE_DESCRIPTION("Haswell/Lynxpoint + Broadwell/Wildcatpoint PCM");
1208 MODULE_LICENSE("GPL v2");
1209 MODULE_ALIAS("platform:haswell-pcm-audio");
This page took 0.077121 seconds and 5 git commands to generate.