| .. | .. |
|---|
| 1 | | -/* sound/soc/samsung/pcm.c |
|---|
| 2 | | - * |
|---|
| 3 | | - * ALSA SoC Audio Layer - S3C PCM-Controller driver |
|---|
| 4 | | - * |
|---|
| 5 | | - * Copyright (c) 2009 Samsung Electronics Co. Ltd |
|---|
| 6 | | - * Author: Jaswinder Singh <jassisinghbrar@gmail.com> |
|---|
| 7 | | - * based upon I2S drivers by Ben Dooks. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 11 | | - * published by the Free Software Foundation. |
|---|
| 12 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | +// |
|---|
| 3 | +// ALSA SoC Audio Layer - S3C PCM-Controller driver |
|---|
| 4 | +// |
|---|
| 5 | +// Copyright (c) 2009 Samsung Electronics Co. Ltd |
|---|
| 6 | +// Author: Jaswinder Singh <jassisinghbrar@gmail.com> |
|---|
| 7 | +// based upon I2S drivers by Ben Dooks. |
|---|
| 13 | 8 | |
|---|
| 14 | 9 | #include <linux/clk.h> |
|---|
| 15 | 10 | #include <linux/io.h> |
|---|
| .. | .. |
|---|
| 109 | 104 | |
|---|
| 110 | 105 | /** |
|---|
| 111 | 106 | * struct s3c_pcm_info - S3C PCM Controller information |
|---|
| 107 | + * @lock: Spin lock |
|---|
| 112 | 108 | * @dev: The parent device passed to use from the probe. |
|---|
| 113 | 109 | * @regs: The pointer to the device register block. |
|---|
| 110 | + * @sclk_per_fs: number of sclk per frame sync |
|---|
| 111 | + * @idleclk: Whether to keep PCMSCLK enabled even when idle (no active xfer) |
|---|
| 112 | + * @pclk: the PCLK_PCM (pcm) clock pointer |
|---|
| 113 | + * @cclk: the SCLK_AUDIO (audio-bus) clock pointer |
|---|
| 114 | 114 | * @dma_playback: DMA information for playback channel. |
|---|
| 115 | 115 | * @dma_capture: DMA information for capture channel. |
|---|
| 116 | 116 | */ |
|---|
| .. | .. |
|---|
| 216 | 216 | static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, |
|---|
| 217 | 217 | struct snd_soc_dai *dai) |
|---|
| 218 | 218 | { |
|---|
| 219 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 220 | | - struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
|---|
| 219 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 220 | + struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); |
|---|
| 221 | 221 | unsigned long flags; |
|---|
| 222 | 222 | |
|---|
| 223 | 223 | dev_dbg(pcm->dev, "Entered %s\n", __func__); |
|---|
| .. | .. |
|---|
| 260 | 260 | struct snd_pcm_hw_params *params, |
|---|
| 261 | 261 | struct snd_soc_dai *socdai) |
|---|
| 262 | 262 | { |
|---|
| 263 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 264 | | - struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
|---|
| 263 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 264 | + struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); |
|---|
| 265 | 265 | void __iomem *regs = pcm->regs; |
|---|
| 266 | 266 | struct clk *clk; |
|---|
| 267 | 267 | int sclk_div, sync_div; |
|---|
| .. | .. |
|---|
| 553 | 553 | pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; |
|---|
| 554 | 554 | |
|---|
| 555 | 555 | ret = samsung_asoc_dma_platform_register(&pdev->dev, filter, |
|---|
| 556 | | - NULL, NULL); |
|---|
| 556 | + NULL, NULL, NULL); |
|---|
| 557 | 557 | if (ret) { |
|---|
| 558 | 558 | dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret); |
|---|
| 559 | 559 | goto err_dis_pclk; |
|---|