.. | .. |
---|
1 | | -/* sound/soc/samsung/jive_wm8750.c |
---|
2 | | - * |
---|
3 | | - * Copyright 2007,2008 Simtec Electronics |
---|
4 | | - * |
---|
5 | | - * Based on sound/soc/pxa/spitz.c |
---|
6 | | - * Copyright 2005 Wolfson Microelectronics PLC. |
---|
7 | | - * Copyright 2005 Openedhand Ltd. |
---|
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 | +// Copyright 2007,2008 Simtec Electronics |
---|
| 4 | +// |
---|
| 5 | +// Based on sound/soc/pxa/spitz.c |
---|
| 6 | +// Copyright 2005 Wolfson Microelectronics PLC. |
---|
| 7 | +// Copyright 2005 Openedhand Ltd. |
---|
13 | 8 | |
---|
14 | 9 | #include <linux/module.h> |
---|
15 | 10 | #include <sound/soc.h> |
---|
.. | .. |
---|
37 | 32 | static int jive_hw_params(struct snd_pcm_substream *substream, |
---|
38 | 33 | struct snd_pcm_hw_params *params) |
---|
39 | 34 | { |
---|
40 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
41 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
42 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 35 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 36 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 37 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
43 | 38 | struct s3c_i2sv2_rate_calc div; |
---|
44 | 39 | unsigned int clk = 0; |
---|
45 | 40 | int ret = 0; |
---|
.. | .. |
---|
83 | 78 | .hw_params = jive_hw_params, |
---|
84 | 79 | }; |
---|
85 | 80 | |
---|
| 81 | +SND_SOC_DAILINK_DEFS(wm8750, |
---|
| 82 | + DAILINK_COMP_ARRAY(COMP_CPU("s3c2412-i2s")), |
---|
| 83 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001a", "wm8750-hifi")), |
---|
| 84 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c2412-i2s"))); |
---|
| 85 | + |
---|
86 | 86 | static struct snd_soc_dai_link jive_dai = { |
---|
87 | 87 | .name = "wm8750", |
---|
88 | 88 | .stream_name = "WM8750", |
---|
89 | | - .cpu_dai_name = "s3c2412-i2s", |
---|
90 | | - .codec_dai_name = "wm8750-hifi", |
---|
91 | | - .platform_name = "s3c2412-i2s", |
---|
92 | | - .codec_name = "wm8750.0-001a", |
---|
93 | 89 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
94 | 90 | SND_SOC_DAIFMT_CBS_CFS, |
---|
95 | 91 | .ops = &jive_ops, |
---|
| 92 | + SND_SOC_DAILINK_REG(wm8750), |
---|
96 | 93 | }; |
---|
97 | 94 | |
---|
98 | 95 | /* jive audio machine driver */ |
---|