.. | .. |
---|
1 | | -/* |
---|
2 | | - * sound/soc/samsung/smdk_wm8994pcm.c |
---|
3 | | - * |
---|
4 | | - * Copyright (c) 2011 Samsung Electronics Co., Ltd |
---|
5 | | - * http://www.samsung.com |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify it |
---|
8 | | - * under the terms of the GNU General Public License as published by the |
---|
9 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
10 | | - * option) any later version. |
---|
11 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +// |
---|
| 3 | +// Copyright (c) 2011 Samsung Electronics Co., Ltd |
---|
| 4 | +// http://www.samsung.com |
---|
| 5 | + |
---|
12 | 6 | #include <linux/module.h> |
---|
13 | 7 | #include <sound/soc.h> |
---|
14 | 8 | #include <sound/pcm.h> |
---|
.. | .. |
---|
49 | 43 | static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream, |
---|
50 | 44 | struct snd_pcm_hw_params *params) |
---|
51 | 45 | { |
---|
52 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
53 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
54 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 46 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 47 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 48 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
55 | 49 | unsigned long mclk_freq; |
---|
56 | 50 | int rfs, ret; |
---|
57 | 51 | |
---|
.. | .. |
---|
95 | 89 | .hw_params = smdk_wm8994_pcm_hw_params, |
---|
96 | 90 | }; |
---|
97 | 91 | |
---|
| 92 | +SND_SOC_DAILINK_DEFS(paif_pcm, |
---|
| 93 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-pcm.0")), |
---|
| 94 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8994-codec", "wm8994-aif1")), |
---|
| 95 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-pcm.0"))); |
---|
| 96 | + |
---|
98 | 97 | static struct snd_soc_dai_link smdk_dai[] = { |
---|
99 | 98 | { |
---|
100 | 99 | .name = "WM8994 PAIF PCM", |
---|
101 | 100 | .stream_name = "Primary PCM", |
---|
102 | | - .cpu_dai_name = "samsung-pcm.0", |
---|
103 | | - .codec_dai_name = "wm8994-aif1", |
---|
104 | | - .platform_name = "samsung-pcm.0", |
---|
105 | | - .codec_name = "wm8994-codec", |
---|
106 | 101 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | |
---|
107 | 102 | SND_SOC_DAIFMT_CBS_CFS, |
---|
108 | 103 | .ops = &smdk_wm8994_pcm_ops, |
---|
| 104 | + SND_SOC_DAILINK_REG(paif_pcm), |
---|
109 | 105 | }, |
---|
110 | 106 | }; |
---|
111 | 107 | |
---|
.. | .. |
---|
123 | 119 | smdk_pcm.dev = &pdev->dev; |
---|
124 | 120 | ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm); |
---|
125 | 121 | if (ret) |
---|
126 | | - dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret); |
---|
| 122 | + dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n"); |
---|
127 | 123 | |
---|
128 | 124 | return ret; |
---|
129 | 125 | } |
---|