| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS |
|---|
| 3 | | - * |
|---|
| 4 | | - * Copyright (c) 2010 Wolfson Microelectronics plc |
|---|
| 5 | | - * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * Based on an earlier driver for the same hardware by Liam Girdwood. |
|---|
| 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 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 2 | +// |
|---|
| 3 | +// wm1133-ev1.c - Audio for WM1133-EV1 on i.MX31ADS |
|---|
| 4 | +// |
|---|
| 5 | +// Copyright (c) 2010 Wolfson Microelectronics plc |
|---|
| 6 | +// Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
|---|
| 7 | +// |
|---|
| 8 | +// Based on an earlier driver for the same hardware by Liam Girdwood. |
|---|
| 14 | 9 | |
|---|
| 15 | 10 | #include <linux/platform_device.h> |
|---|
| 16 | 11 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 80 | 75 | static int wm1133_ev1_hw_params(struct snd_pcm_substream *substream, |
|---|
| 81 | 76 | struct snd_pcm_hw_params *params) |
|---|
| 82 | 77 | { |
|---|
| 83 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 84 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 85 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
|---|
| 78 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 79 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
|---|
| 80 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
|---|
| 86 | 81 | int i, found = 0; |
|---|
| 87 | 82 | snd_pcm_format_t format = params_format(params); |
|---|
| 88 | 83 | unsigned int rate = params_rate(params); |
|---|
| .. | .. |
|---|
| 201 | 196 | |
|---|
| 202 | 197 | static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd) |
|---|
| 203 | 198 | { |
|---|
| 204 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
|---|
| 199 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
|---|
| 205 | 200 | |
|---|
| 206 | 201 | /* Headphone jack detection */ |
|---|
| 207 | 202 | snd_soc_card_jack_new(rtd->card, "Headphone", SND_JACK_HEADPHONE, |
|---|
| .. | .. |
|---|
| 221 | 216 | } |
|---|
| 222 | 217 | |
|---|
| 223 | 218 | |
|---|
| 219 | +SND_SOC_DAILINK_DEFS(ev1, |
|---|
| 220 | + DAILINK_COMP_ARRAY(COMP_CPU("imx-ssi.0")), |
|---|
| 221 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8350-codec.0-0x1a", "wm8350-hifi")), |
|---|
| 222 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("imx-ssi.0"))); |
|---|
| 223 | + |
|---|
| 224 | 224 | static struct snd_soc_dai_link wm1133_ev1_dai = { |
|---|
| 225 | 225 | .name = "WM1133-EV1", |
|---|
| 226 | 226 | .stream_name = "Audio", |
|---|
| 227 | | - .cpu_dai_name = "imx-ssi.0", |
|---|
| 228 | | - .codec_dai_name = "wm8350-hifi", |
|---|
| 229 | | - .platform_name = "imx-ssi.0", |
|---|
| 230 | | - .codec_name = "wm8350-codec.0-0x1a", |
|---|
| 231 | 227 | .init = wm1133_ev1_init, |
|---|
| 232 | 228 | .ops = &wm1133_ev1_ops, |
|---|
| 233 | 229 | .symmetric_rates = 1, |
|---|
| 234 | 230 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
|---|
| 235 | 231 | SND_SOC_DAIFMT_CBM_CFM, |
|---|
| 232 | + SND_SOC_DAILINK_REG(ev1), |
|---|
| 236 | 233 | }; |
|---|
| 237 | 234 | |
|---|
| 238 | 235 | static struct snd_soc_card wm1133_ev1 = { |
|---|