| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * smdk_wm8580.c |
|---|
| 3 | | - * |
|---|
| 4 | | - * Copyright (c) 2009 Samsung Electronics Co. Ltd |
|---|
| 5 | | - * Author: Jaswinder Singh <jassisinghbrar@gmail.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) 2009 Samsung Electronics Co. Ltd |
|---|
| 4 | +// Author: Jaswinder Singh <jassisinghbrar@gmail.com> |
|---|
| 12 | 5 | |
|---|
| 13 | 6 | #include <linux/module.h> |
|---|
| 14 | 7 | #include <sound/soc.h> |
|---|
| .. | .. |
|---|
| 29 | 22 | static int smdk_hw_params(struct snd_pcm_substream *substream, |
|---|
| 30 | 23 | struct snd_pcm_hw_params *params) |
|---|
| 31 | 24 | { |
|---|
| 32 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 33 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 25 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 26 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
|---|
| 34 | 27 | unsigned int pll_out; |
|---|
| 35 | 28 | int rfs, ret; |
|---|
| 36 | 29 | |
|---|
| .. | .. |
|---|
| 147 | 140 | #define SMDK_DAI_FMT (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \ |
|---|
| 148 | 141 | SND_SOC_DAIFMT_CBM_CFM) |
|---|
| 149 | 142 | |
|---|
| 143 | +SND_SOC_DAILINK_DEFS(paif_rx, |
|---|
| 144 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.2")), |
|---|
| 145 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8580.0-001b", "wm8580-hifi-playback")), |
|---|
| 146 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0"))); |
|---|
| 147 | + |
|---|
| 148 | +SND_SOC_DAILINK_DEFS(paif_tx, |
|---|
| 149 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.2")), |
|---|
| 150 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8580.0-001b", "wm8580-hifi-capture")), |
|---|
| 151 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0"))); |
|---|
| 152 | + |
|---|
| 150 | 153 | static struct snd_soc_dai_link smdk_dai[] = { |
|---|
| 151 | 154 | [PRI_PLAYBACK] = { /* Primary Playback i/f */ |
|---|
| 152 | 155 | .name = "WM8580 PAIF RX", |
|---|
| 153 | 156 | .stream_name = "Playback", |
|---|
| 154 | | - .cpu_dai_name = "samsung-i2s.2", |
|---|
| 155 | | - .codec_dai_name = "wm8580-hifi-playback", |
|---|
| 156 | | - .platform_name = "samsung-i2s.0", |
|---|
| 157 | | - .codec_name = "wm8580.0-001b", |
|---|
| 158 | 157 | .dai_fmt = SMDK_DAI_FMT, |
|---|
| 159 | 158 | .ops = &smdk_ops, |
|---|
| 159 | + SND_SOC_DAILINK_REG(paif_rx), |
|---|
| 160 | 160 | }, |
|---|
| 161 | 161 | [PRI_CAPTURE] = { /* Primary Capture i/f */ |
|---|
| 162 | 162 | .name = "WM8580 PAIF TX", |
|---|
| 163 | 163 | .stream_name = "Capture", |
|---|
| 164 | | - .cpu_dai_name = "samsung-i2s.2", |
|---|
| 165 | | - .codec_dai_name = "wm8580-hifi-capture", |
|---|
| 166 | | - .platform_name = "samsung-i2s.0", |
|---|
| 167 | | - .codec_name = "wm8580.0-001b", |
|---|
| 168 | 164 | .dai_fmt = SMDK_DAI_FMT, |
|---|
| 169 | 165 | .init = smdk_wm8580_init_paiftx, |
|---|
| 170 | 166 | .ops = &smdk_ops, |
|---|
| 167 | + SND_SOC_DAILINK_REG(paif_tx), |
|---|
| 171 | 168 | }, |
|---|
| 172 | 169 | }; |
|---|
| 173 | 170 | |
|---|