1 // SPDX-License-Identifier: GPL-2.0+
3 // AMD ALSA SoC PCM Driver
5 //Copyright 2016 Advanced Micro Devices, Inc.
7 #include <linux/platform_device.h>
8 #include <linux/module.h>
11 #include <linux/pm_runtime.h>
12 #include <sound/pcm.h>
13 #include <sound/pcm_params.h>
14 #include <sound/soc.h>
15 #include <sound/soc-dai.h>
19 #define DRV_NAME "acp3x-i2s-audio"
25 void __iomem *acp3x_base;
26 struct snd_pcm_substream *play_stream;
27 struct snd_pcm_substream *capture_stream;
30 struct i2s_stream_instance {
36 void __iomem *acp3x_base;
39 static const struct snd_pcm_hardware acp3x_pcm_hardware_playback = {
40 .info = SNDRV_PCM_INFO_INTERLEAVED |
41 SNDRV_PCM_INFO_BLOCK_TRANSFER |
42 SNDRV_PCM_INFO_BATCH |
43 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME,
44 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 |
45 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE |
46 SNDRV_PCM_FMTBIT_S32_LE,
49 .rates = SNDRV_PCM_RATE_8000_96000,
52 .buffer_bytes_max = PLAYBACK_MAX_NUM_PERIODS * PLAYBACK_MAX_PERIOD_SIZE,
53 .period_bytes_min = PLAYBACK_MIN_PERIOD_SIZE,
54 .period_bytes_max = PLAYBACK_MAX_PERIOD_SIZE,
55 .periods_min = PLAYBACK_MIN_NUM_PERIODS,
56 .periods_max = PLAYBACK_MAX_NUM_PERIODS,
59 static const struct snd_pcm_hardware acp3x_pcm_hardware_capture = {
60 .info = SNDRV_PCM_INFO_INTERLEAVED |
61 SNDRV_PCM_INFO_BLOCK_TRANSFER |
62 SNDRV_PCM_INFO_BATCH |
63 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME,
64 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 |
65 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S24_LE |
66 SNDRV_PCM_FMTBIT_S32_LE,
69 .rates = SNDRV_PCM_RATE_8000_48000,
72 .buffer_bytes_max = CAPTURE_MAX_NUM_PERIODS * CAPTURE_MAX_PERIOD_SIZE,
73 .period_bytes_min = CAPTURE_MIN_PERIOD_SIZE,
74 .period_bytes_max = CAPTURE_MAX_PERIOD_SIZE,
75 .periods_min = CAPTURE_MIN_NUM_PERIODS,
76 .periods_max = CAPTURE_MAX_NUM_PERIODS,
79 static int acp3x_power_on(void __iomem *acp3x_base, bool on)
86 mask = ACP3x_POWER_ON;
89 mask = ACP3x_POWER_OFF;
92 rv_writel(val, acp3x_base + mmACP_PGFSM_CONTROL);
95 val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS);
96 if ((val & ACP3x_POWER_OFF_IN_PROGRESS) == mask)
99 pr_err("ACP3x power state change failure\n");
108 static int acp3x_reset(void __iomem *acp3x_base)
112 rv_writel(1, acp3x_base + mmACP_SOFT_RESET);
115 val = rv_readl(acp3x_base + mmACP_SOFT_RESET);
116 if ((val & ACP3x_SOFT_RESET__SoftResetAudDone_MASK) ||
118 if (val & ACP3x_SOFT_RESET__SoftResetAudDone_MASK)
126 rv_writel(0, acp3x_base + mmACP_SOFT_RESET);
129 val = rv_readl(acp3x_base + mmACP_SOFT_RESET);
130 if (!val || timeout > 100) {
141 static int acp3x_init(void __iomem *acp3x_base)
146 ret = acp3x_power_on(acp3x_base, true);
148 pr_err("ACP3x power on failed\n");
152 ret = acp3x_reset(acp3x_base);
154 pr_err("ACP3x reset failed\n");
160 static int acp3x_deinit(void __iomem *acp3x_base)
165 ret = acp3x_reset(acp3x_base);
167 pr_err("ACP3x reset failed\n");
171 ret = acp3x_power_on(acp3x_base, false);
173 pr_err("ACP3x power off failed\n");
179 static irqreturn_t i2s_irq_handler(int irq, void *dev_id)
181 u16 play_flag, cap_flag;
183 struct i2s_dev_data *rv_i2s_data = dev_id;
190 val = rv_readl(rv_i2s_data->acp3x_base + mmACP_EXTERNAL_INTR_STAT);
191 if ((val & BIT(BT_TX_THRESHOLD)) && rv_i2s_data->play_stream) {
192 rv_writel(BIT(BT_TX_THRESHOLD), rv_i2s_data->acp3x_base +
193 mmACP_EXTERNAL_INTR_STAT);
194 snd_pcm_period_elapsed(rv_i2s_data->play_stream);
198 if ((val & BIT(BT_RX_THRESHOLD)) && rv_i2s_data->capture_stream) {
199 rv_writel(BIT(BT_RX_THRESHOLD), rv_i2s_data->acp3x_base +
200 mmACP_EXTERNAL_INTR_STAT);
201 snd_pcm_period_elapsed(rv_i2s_data->capture_stream);
205 if (play_flag | cap_flag)
211 static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
215 u32 low, high, val, acp_fifo_addr;
216 struct page *pg = rtd->pg;
218 /* 8 scratch registers used to map one 64 bit address */
219 if (direction == SNDRV_PCM_STREAM_PLAYBACK)
222 val = rtd->num_pages * 8;
225 rv_writel(ACP_SRAM_PTE_OFFSET | BIT(31), rtd->acp3x_base +
226 mmACPAXI2AXI_ATU_BASE_ADDR_GRP_1);
227 rv_writel(PAGE_SIZE_4K_ENABLE, rtd->acp3x_base +
228 mmACPAXI2AXI_ATU_PAGE_SIZE_GRP_1);
230 for (page_idx = 0; page_idx < rtd->num_pages; page_idx++) {
231 /* Load the low address of page int ACP SRAM through SRBM */
232 addr = page_to_phys(pg);
233 low = lower_32_bits(addr);
234 high = upper_32_bits(addr);
236 rv_writel(low, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val);
238 rv_writel(high, rtd->acp3x_base + mmACP_SCRATCH_REG_0 + val
240 /* Move to next physically contiguos page */
245 if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
246 /* Config ringbuffer */
247 rv_writel(MEM_WINDOW_START, rtd->acp3x_base +
248 mmACP_BT_TX_RINGBUFADDR);
249 rv_writel(MAX_BUFFER, rtd->acp3x_base +
250 mmACP_BT_TX_RINGBUFSIZE);
251 rv_writel(DMA_SIZE, rtd->acp3x_base + mmACP_BT_TX_DMA_SIZE);
253 /* Config audio fifo */
254 acp_fifo_addr = ACP_SRAM_PTE_OFFSET + (rtd->num_pages * 8)
255 + PLAYBACK_FIFO_ADDR_OFFSET;
256 rv_writel(acp_fifo_addr, rtd->acp3x_base +
257 mmACP_BT_TX_FIFOADDR);
258 rv_writel(FIFO_SIZE, rtd->acp3x_base + mmACP_BT_TX_FIFOSIZE);
260 /* Config ringbuffer */
261 rv_writel(MEM_WINDOW_START + MAX_BUFFER, rtd->acp3x_base +
262 mmACP_BT_RX_RINGBUFADDR);
263 rv_writel(MAX_BUFFER, rtd->acp3x_base +
264 mmACP_BT_RX_RINGBUFSIZE);
265 rv_writel(DMA_SIZE, rtd->acp3x_base + mmACP_BT_RX_DMA_SIZE);
267 /* Config audio fifo */
268 acp_fifo_addr = ACP_SRAM_PTE_OFFSET +
269 (rtd->num_pages * 8) + CAPTURE_FIFO_ADDR_OFFSET;
270 rv_writel(acp_fifo_addr, rtd->acp3x_base +
271 mmACP_BT_RX_FIFOADDR);
272 rv_writel(FIFO_SIZE, rtd->acp3x_base + mmACP_BT_RX_FIFOSIZE);
275 /* Enable watermark/period interrupt to host */
276 rv_writel(BIT(BT_TX_THRESHOLD) | BIT(BT_RX_THRESHOLD),
277 rtd->acp3x_base + mmACP_EXTERNAL_INTR_CNTL);
280 static int acp3x_dma_open(struct snd_pcm_substream *substream)
284 struct snd_pcm_runtime *runtime = substream->runtime;
285 struct snd_soc_pcm_runtime *prtd = substream->private_data;
286 struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd,
288 struct i2s_dev_data *adata = dev_get_drvdata(component->dev);
290 struct i2s_stream_instance *i2s_data = kzalloc(sizeof(struct i2s_stream_instance),
295 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
296 runtime->hw = acp3x_pcm_hardware_playback;
298 runtime->hw = acp3x_pcm_hardware_capture;
300 ret = snd_pcm_hw_constraint_integer(runtime,
301 SNDRV_PCM_HW_PARAM_PERIODS);
303 dev_err(component->dev, "set integer constraint failed\n");
308 if (!adata->play_stream && !adata->capture_stream)
309 rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
311 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
312 adata->play_stream = substream;
314 adata->capture_stream = substream;
316 i2s_data->acp3x_base = adata->acp3x_base;
317 runtime->private_data = i2s_data;
321 static u64 acp_get_byte_count(struct i2s_stream_instance *rtd, int direction)
325 if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
326 byte_count = rv_readl(rtd->acp3x_base +
327 mmACP_BT_TX_LINEARPOSITIONCNTR_HIGH);
328 byte_count |= rv_readl(rtd->acp3x_base +
329 mmACP_BT_TX_LINEARPOSITIONCNTR_LOW);
331 byte_count = rv_readl(rtd->acp3x_base +
332 mmACP_BT_RX_LINEARPOSITIONCNTR_HIGH);
333 byte_count |= rv_readl(rtd->acp3x_base +
334 mmACP_BT_RX_LINEARPOSITIONCNTR_LOW);
339 static int acp3x_dma_hw_params(struct snd_pcm_substream *substream,
340 struct snd_pcm_hw_params *params)
345 struct snd_pcm_runtime *runtime = substream->runtime;
346 struct i2s_stream_instance *rtd = runtime->private_data;
351 size = params_buffer_bytes(params);
352 status = snd_pcm_lib_malloc_pages(substream, size);
356 memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
357 pg = virt_to_page(substream->dma_buffer.area);
360 rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
361 config_acp3x_dma(rtd, substream->stream);
369 static snd_pcm_uframes_t acp3x_dma_pointer(struct snd_pcm_substream *substream)
374 struct i2s_stream_instance *rtd =
375 substream->runtime->private_data;
377 buffersize = frames_to_bytes(substream->runtime,
378 substream->runtime->buffer_size);
379 bytescount = acp_get_byte_count(rtd, substream->stream);
380 if (bytescount > rtd->bytescount)
381 bytescount -= rtd->bytescount;
382 pos = do_div(bytescount, buffersize);
383 return bytes_to_frames(substream->runtime, pos);
386 static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd)
388 struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd,
390 struct device *parent = component->dev->parent;
391 snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, SNDRV_DMA_TYPE_DEV,
392 parent, MIN_BUFFER, MAX_BUFFER);
396 static int acp3x_dma_hw_free(struct snd_pcm_substream *substream)
398 return snd_pcm_lib_free_pages(substream);
401 static int acp3x_dma_mmap(struct snd_pcm_substream *substream,
402 struct vm_area_struct *vma)
404 return snd_pcm_lib_default_mmap(substream, vma);
407 static int acp3x_dma_close(struct snd_pcm_substream *substream)
409 struct snd_soc_pcm_runtime *prtd = substream->private_data;
410 struct i2s_stream_instance *rtd = substream->runtime->private_data;
411 struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd,
413 struct i2s_dev_data *adata = dev_get_drvdata(component->dev);
415 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
416 adata->play_stream = NULL;
418 adata->capture_stream = NULL;
420 /* Disable ACP irq, when the current stream is being closed and
421 * another stream is also not active.
423 if (!adata->play_stream && !adata->capture_stream)
424 rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
429 static struct snd_pcm_ops acp3x_dma_ops = {
430 .open = acp3x_dma_open,
431 .close = acp3x_dma_close,
432 .ioctl = snd_pcm_lib_ioctl,
433 .hw_params = acp3x_dma_hw_params,
434 .hw_free = acp3x_dma_hw_free,
435 .pointer = acp3x_dma_pointer,
436 .mmap = acp3x_dma_mmap,
440 static int acp3x_dai_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
443 struct i2s_dev_data *adata = snd_soc_dai_get_drvdata(cpu_dai);
445 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
446 case SND_SOC_DAIFMT_I2S:
447 adata->tdm_mode = false;
449 case SND_SOC_DAIFMT_DSP_A:
450 adata->tdm_mode = true;
459 static int acp3x_dai_set_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask,
460 u32 rx_mask, int slots, int slot_width)
465 struct i2s_dev_data *adata = snd_soc_dai_get_drvdata(cpu_dai);
467 switch (slot_width) {
484 val = rv_readl(adata->acp3x_base + mmACP_BTTDM_ITER);
485 rv_writel((val | 0x2), adata->acp3x_base + mmACP_BTTDM_ITER);
486 val = rv_readl(adata->acp3x_base + mmACP_BTTDM_IRER);
487 rv_writel((val | 0x2), adata->acp3x_base + mmACP_BTTDM_IRER);
489 val = (FRM_LEN | (slots << 15) | (slot_len << 18));
490 rv_writel(val, adata->acp3x_base + mmACP_BTTDM_TXFRMT);
491 rv_writel(val, adata->acp3x_base + mmACP_BTTDM_RXFRMT);
493 adata->tdm_fmt = val;
497 static int acp3x_dai_i2s_hwparams(struct snd_pcm_substream *substream,
498 struct snd_pcm_hw_params *params,
499 struct snd_soc_dai *dai)
502 struct i2s_stream_instance *rtd = substream->runtime->private_data;
504 switch (params_format(params)) {
505 case SNDRV_PCM_FORMAT_U8:
506 case SNDRV_PCM_FORMAT_S8:
507 rtd->xfer_resolution = 0x0;
509 case SNDRV_PCM_FORMAT_S16_LE:
510 rtd->xfer_resolution = 0x02;
512 case SNDRV_PCM_FORMAT_S24_LE:
513 rtd->xfer_resolution = 0x04;
515 case SNDRV_PCM_FORMAT_S32_LE:
516 rtd->xfer_resolution = 0x05;
521 val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER);
522 val = val | (rtd->xfer_resolution << 3);
523 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
524 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER);
526 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER);
531 static int acp3x_dai_i2s_trigger(struct snd_pcm_substream *substream,
532 int cmd, struct snd_soc_dai *dai)
535 struct i2s_stream_instance *rtd = substream->runtime->private_data;
536 u32 val, period_bytes;
538 period_bytes = frames_to_bytes(substream->runtime,
539 substream->runtime->period_size);
541 case SNDRV_PCM_TRIGGER_START:
542 case SNDRV_PCM_TRIGGER_RESUME:
543 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
544 rtd->bytescount = acp_get_byte_count(rtd, substream->stream);
545 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
546 rv_writel(period_bytes, rtd->acp3x_base +
547 mmACP_BT_TX_INTR_WATERMARK_SIZE);
548 val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER);
550 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER);
552 rv_writel(period_bytes, rtd->acp3x_base +
553 mmACP_BT_RX_INTR_WATERMARK_SIZE);
554 val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER);
556 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER);
558 rv_writel(1, rtd->acp3x_base + mmACP_BTTDM_IER);
560 case SNDRV_PCM_TRIGGER_STOP:
561 case SNDRV_PCM_TRIGGER_SUSPEND:
562 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
563 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
564 val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER);
566 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER);
568 val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER);
570 rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER);
572 rv_writel(0, rtd->acp3x_base + mmACP_BTTDM_IER);
582 static struct snd_soc_dai_ops acp3x_dai_i2s_ops = {
583 .hw_params = acp3x_dai_i2s_hwparams,
584 .trigger = acp3x_dai_i2s_trigger,
585 .set_fmt = acp3x_dai_i2s_set_fmt,
586 .set_tdm_slot = acp3x_dai_set_tdm_slot,
589 static struct snd_soc_dai_driver acp3x_i2s_dai_driver = {
591 .rates = SNDRV_PCM_RATE_8000_96000,
592 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 |
593 SNDRV_PCM_FMTBIT_U8 |
594 SNDRV_PCM_FMTBIT_S24_LE |
595 SNDRV_PCM_FMTBIT_S32_LE,
603 .rates = SNDRV_PCM_RATE_8000_48000,
604 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 |
605 SNDRV_PCM_FMTBIT_U8 |
606 SNDRV_PCM_FMTBIT_S24_LE |
607 SNDRV_PCM_FMTBIT_S32_LE,
613 .ops = &acp3x_dai_i2s_ops,
616 static const struct snd_soc_component_driver acp3x_i2s_component = {
618 .ops = &acp3x_dma_ops,
619 .pcm_new = acp3x_dma_new,
622 static int acp3x_audio_probe(struct platform_device *pdev)
625 struct resource *res;
626 struct i2s_dev_data *adata;
627 unsigned int irqflags;
629 if (!pdev->dev.platform_data) {
630 dev_err(&pdev->dev, "platform_data not retrieved\n");
633 irqflags = *((unsigned int *)(pdev->dev.platform_data));
635 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
637 dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n");
641 adata = devm_kzalloc(&pdev->dev, sizeof(*adata), GFP_KERNEL);
645 adata->acp3x_base = devm_ioremap(&pdev->dev, res->start,
648 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
650 dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n");
654 adata->i2s_irq = res->start;
655 adata->play_stream = NULL;
656 adata->capture_stream = NULL;
658 dev_set_drvdata(&pdev->dev, adata);
660 status = acp3x_init(adata->acp3x_base);
663 status = devm_snd_soc_register_component(&pdev->dev,
664 &acp3x_i2s_component,
665 &acp3x_i2s_dai_driver, 1);
667 dev_err(&pdev->dev, "Fail to register acp i2s dai\n");
670 status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
671 irqflags, "ACP3x_I2S_IRQ", adata);
673 dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n");
677 pm_runtime_set_autosuspend_delay(&pdev->dev, 10000);
678 pm_runtime_use_autosuspend(&pdev->dev);
679 pm_runtime_enable(&pdev->dev);
682 status = acp3x_deinit(adata->acp3x_base);
684 dev_err(&pdev->dev, "ACP de-init failed\n");
686 dev_info(&pdev->dev, "ACP de-initialized\n");
687 /*ignore device status and return driver probe error*/
691 static int acp3x_audio_remove(struct platform_device *pdev)
694 struct i2s_dev_data *adata = dev_get_drvdata(&pdev->dev);
696 ret = acp3x_deinit(adata->acp3x_base);
698 dev_err(&pdev->dev, "ACP de-init failed\n");
700 dev_info(&pdev->dev, "ACP de-initialized\n");
702 pm_runtime_disable(&pdev->dev);
706 static int acp3x_resume(struct device *dev)
710 struct i2s_dev_data *adata = dev_get_drvdata(dev);
712 status = acp3x_init(adata->acp3x_base);
716 if (adata->play_stream && adata->play_stream->runtime) {
717 struct i2s_stream_instance *rtd =
718 adata->play_stream->runtime->private_data;
719 config_acp3x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK);
720 rv_writel((rtd->xfer_resolution << 3),
721 rtd->acp3x_base + mmACP_BTTDM_ITER);
722 if (adata->tdm_mode == true) {
723 rv_writel(adata->tdm_fmt, adata->acp3x_base +
725 val = rv_readl(adata->acp3x_base + mmACP_BTTDM_ITER);
726 rv_writel((val | 0x2), adata->acp3x_base +
731 if (adata->capture_stream && adata->capture_stream->runtime) {
732 struct i2s_stream_instance *rtd =
733 adata->capture_stream->runtime->private_data;
734 config_acp3x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE);
735 rv_writel((rtd->xfer_resolution << 3),
736 rtd->acp3x_base + mmACP_BTTDM_IRER);
737 if (adata->tdm_mode == true) {
738 rv_writel(adata->tdm_fmt, adata->acp3x_base +
740 val = rv_readl(adata->acp3x_base + mmACP_BTTDM_IRER);
741 rv_writel((val | 0x2), adata->acp3x_base +
746 rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
751 static int acp3x_pcm_runtime_suspend(struct device *dev)
754 struct i2s_dev_data *adata = dev_get_drvdata(dev);
756 status = acp3x_deinit(adata->acp3x_base);
758 dev_err(dev, "ACP de-init failed\n");
760 dev_info(dev, "ACP de-initialized\n");
762 rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
767 static int acp3x_pcm_runtime_resume(struct device *dev)
770 struct i2s_dev_data *adata = dev_get_drvdata(dev);
772 status = acp3x_init(adata->acp3x_base);
775 rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
779 static const struct dev_pm_ops acp3x_pm_ops = {
780 .runtime_suspend = acp3x_pcm_runtime_suspend,
781 .runtime_resume = acp3x_pcm_runtime_resume,
782 .resume = acp3x_resume,
785 static struct platform_driver acp3x_dma_driver = {
786 .probe = acp3x_audio_probe,
787 .remove = acp3x_audio_remove,
789 .name = "acp3x_rv_i2s",
794 module_platform_driver(acp3x_dma_driver);
796 MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com");
797 MODULE_AUTHOR("Vijendar.Mukunda@amd.com");
798 MODULE_DESCRIPTION("AMD ACP 3.x PCM Driver");
799 MODULE_LICENSE("GPL v2");
800 MODULE_ALIAS("platform:" DRV_NAME);