| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/sound/soc/pxa/brownstone.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2011 Marvell International Ltd. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | 6 | */ |
|---|
| 12 | 7 | |
|---|
| 13 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 48 | 43 | static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream, |
|---|
| 49 | 44 | struct snd_pcm_hw_params *params) |
|---|
| 50 | 45 | { |
|---|
| 51 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 52 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 53 | | - 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); |
|---|
| 54 | 49 | int freq_out, sspa_mclk, sysclk; |
|---|
| 55 | 50 | |
|---|
| 56 | 51 | if (params_rate(params) > 11025) { |
|---|
| .. | .. |
|---|
| 78 | 73 | .hw_params = brownstone_wm8994_hw_params, |
|---|
| 79 | 74 | }; |
|---|
| 80 | 75 | |
|---|
| 76 | +SND_SOC_DAILINK_DEFS(wm8994, |
|---|
| 77 | + DAILINK_COMP_ARRAY(COMP_CPU("mmp-sspa-dai.0")), |
|---|
| 78 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8994-codec", "wm8994-aif1")), |
|---|
| 79 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("mmp-pcm-audio"))); |
|---|
| 80 | + |
|---|
| 81 | 81 | static struct snd_soc_dai_link brownstone_wm8994_dai[] = { |
|---|
| 82 | 82 | { |
|---|
| 83 | 83 | .name = "WM8994", |
|---|
| 84 | 84 | .stream_name = "WM8994 HiFi", |
|---|
| 85 | | - .cpu_dai_name = "mmp-sspa-dai.0", |
|---|
| 86 | | - .codec_dai_name = "wm8994-aif1", |
|---|
| 87 | | - .platform_name = "mmp-pcm-audio", |
|---|
| 88 | | - .codec_name = "wm8994-codec", |
|---|
| 89 | 85 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
|---|
| 90 | 86 | SND_SOC_DAIFMT_CBS_CFS, |
|---|
| 91 | 87 | .ops = &brownstone_ops, |
|---|
| 88 | + SND_SOC_DAILINK_REG(wm8994), |
|---|
| 92 | 89 | }, |
|---|
| 93 | 90 | }; |
|---|
| 94 | 91 | |
|---|