.. | .. |
---|
1 | | -/* |
---|
2 | | - * Modifications by Christian Pellegrin <chripell@evolware.org> |
---|
3 | | - * |
---|
4 | | - * s3c24xx_uda134x.c -- S3C24XX_UDA134X ALSA SoC Audio board driver |
---|
5 | | - * |
---|
6 | | - * Copyright 2007 Dension Audio Systems Ltd. |
---|
7 | | - * Author: Zoltan Devai |
---|
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 | +// Modifications by Christian Pellegrin <chripell@evolware.org> |
---|
| 4 | +// |
---|
| 5 | +// s3c24xx_uda134x.c - S3C24XX_UDA134X ALSA SoC Audio board driver |
---|
| 6 | +// |
---|
| 7 | +// Copyright 2007 Dension Audio Systems Ltd. |
---|
| 8 | +// Author: Zoltan Devai |
---|
13 | 9 | |
---|
14 | 10 | #include <linux/clk.h> |
---|
15 | 11 | #include <linux/gpio.h> |
---|
.. | .. |
---|
53 | 49 | |
---|
54 | 50 | static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) |
---|
55 | 51 | { |
---|
56 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
| 52 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
57 | 53 | struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card); |
---|
58 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 54 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
59 | 55 | int ret = 0; |
---|
60 | 56 | |
---|
61 | 57 | mutex_lock(&priv->clk_lock); |
---|
.. | .. |
---|
105 | 101 | |
---|
106 | 102 | static void s3c24xx_uda134x_shutdown(struct snd_pcm_substream *substream) |
---|
107 | 103 | { |
---|
108 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
| 104 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
109 | 105 | struct s3c24xx_uda134x *priv = snd_soc_card_get_drvdata(rtd->card); |
---|
110 | 106 | |
---|
111 | 107 | mutex_lock(&priv->clk_lock); |
---|
.. | .. |
---|
122 | 118 | static int s3c24xx_uda134x_hw_params(struct snd_pcm_substream *substream, |
---|
123 | 119 | struct snd_pcm_hw_params *params) |
---|
124 | 120 | { |
---|
125 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
126 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
127 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 121 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 122 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 123 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
128 | 124 | unsigned int clk = 0; |
---|
129 | 125 | int ret = 0; |
---|
130 | 126 | int clk_source, fs_mode; |
---|
.. | .. |
---|
205 | 201 | .hw_params = s3c24xx_uda134x_hw_params, |
---|
206 | 202 | }; |
---|
207 | 203 | |
---|
| 204 | +SND_SOC_DAILINK_DEFS(uda134x, |
---|
| 205 | + DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")), |
---|
| 206 | + DAILINK_COMP_ARRAY(COMP_CODEC("uda134x-codec", "uda134x-hifi")), |
---|
| 207 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis"))); |
---|
| 208 | + |
---|
208 | 209 | static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = { |
---|
209 | 210 | .name = "UDA134X", |
---|
210 | 211 | .stream_name = "UDA134X", |
---|
211 | | - .codec_name = "uda134x-codec", |
---|
212 | | - .codec_dai_name = "uda134x-hifi", |
---|
213 | | - .cpu_dai_name = "s3c24xx-iis", |
---|
214 | 212 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
215 | 213 | SND_SOC_DAIFMT_CBS_CFS, |
---|
216 | 214 | .ops = &s3c24xx_uda134x_ops, |
---|
217 | | - .platform_name = "s3c24xx-iis", |
---|
| 215 | + SND_SOC_DAILINK_REG(uda134x), |
---|
218 | 216 | }; |
---|
219 | 217 | |
---|
220 | 218 | static struct snd_soc_card snd_soc_s3c24xx_uda134x = { |
---|