.. | .. |
---|
1 | | -/* sound/soc/samsung/smartq_wm8987.c |
---|
2 | | - * |
---|
3 | | - * Copyright 2010 Maurus Cuelenaere <mcuelenaere@gmail.com> |
---|
4 | | - * |
---|
5 | | - * Based on smdk6410_wm8987.c |
---|
6 | | - * Copyright 2007 Wolfson Microelectronics PLC. - linux@wolfsonmicro.com |
---|
7 | | - * Graeme Gregory - graeme.gregory@wolfsonmicro.com |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify it |
---|
10 | | - * under the terms of the GNU General Public License as published by the |
---|
11 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
12 | | - * option) any later version. |
---|
13 | | - * |
---|
14 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +// |
---|
| 3 | +// Copyright 2010 Maurus Cuelenaere <mcuelenaere@gmail.com> |
---|
| 4 | +// |
---|
| 5 | +// Based on smdk6410_wm8987.c |
---|
| 6 | +// Copyright 2007 Wolfson Microelectronics PLC. - linux@wolfsonmicro.com |
---|
| 7 | +// Graeme Gregory - graeme.gregory@wolfsonmicro.com |
---|
15 | 8 | |
---|
16 | 9 | #include <linux/gpio/consumer.h> |
---|
17 | 10 | #include <linux/module.h> |
---|
.. | .. |
---|
31 | 24 | static int smartq_hifi_hw_params(struct snd_pcm_substream *substream, |
---|
32 | 25 | struct snd_pcm_hw_params *params) |
---|
33 | 26 | { |
---|
34 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
35 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
36 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
---|
| 27 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 28 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
| 29 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
---|
37 | 30 | unsigned int clk = 0; |
---|
38 | 31 | int ret; |
---|
39 | 32 | |
---|
.. | .. |
---|
160 | 153 | return err; |
---|
161 | 154 | } |
---|
162 | 155 | |
---|
| 156 | +SND_SOC_DAILINK_DEFS(wm8987, |
---|
| 157 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.0")), |
---|
| 158 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-0x1a", "wm8750-hifi")), |
---|
| 159 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0"))); |
---|
| 160 | + |
---|
163 | 161 | static struct snd_soc_dai_link smartq_dai[] = { |
---|
164 | 162 | { |
---|
165 | 163 | .name = "wm8987", |
---|
166 | 164 | .stream_name = "SmartQ Hi-Fi", |
---|
167 | | - .cpu_dai_name = "samsung-i2s.0", |
---|
168 | | - .codec_dai_name = "wm8750-hifi", |
---|
169 | | - .platform_name = "samsung-i2s.0", |
---|
170 | | - .codec_name = "wm8750.0-0x1a", |
---|
171 | 165 | .init = smartq_wm8987_init, |
---|
172 | 166 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
173 | 167 | SND_SOC_DAIFMT_CBS_CFS, |
---|
174 | 168 | .ops = &smartq_hifi_ops, |
---|
| 169 | + SND_SOC_DAILINK_REG(wm8987), |
---|
175 | 170 | }, |
---|
176 | 171 | }; |
---|
177 | 172 | |
---|