| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * bytcht_nocodec.c - ASoc Machine driver for MinnowBoard Max and Up |
|---|
| 3 | 4 | * to make I2S signals observable on the Low-Speed connector. Audio codec |
|---|
| .. | .. |
|---|
| 6 | 7 | * Copyright (C) 2015-2017 Intel Corp |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 12 | | - * the Free Software Foundation; version 2 of the License. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 15 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 17 | | - * General Public License for more details. |
|---|
| 18 | 10 | * |
|---|
| 19 | 11 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 20 | 12 | */ |
|---|
| .. | .. |
|---|
| 66 | 58 | * with explicit setting to I2S 2ch 24-bit. The word length is set with |
|---|
| 67 | 59 | * dai_set_tdm_slot() since there is no other API exposed |
|---|
| 68 | 60 | */ |
|---|
| 69 | | - ret = snd_soc_dai_set_fmt(rtd->cpu_dai, |
|---|
| 61 | + ret = snd_soc_dai_set_fmt(asoc_rtd_to_cpu(rtd, 0), |
|---|
| 70 | 62 | SND_SOC_DAIFMT_I2S | |
|---|
| 71 | 63 | SND_SOC_DAIFMT_NB_NF | |
|---|
| 72 | 64 | SND_SOC_DAIFMT_CBS_CFS); |
|---|
| .. | .. |
|---|
| 76 | 68 | return ret; |
|---|
| 77 | 69 | } |
|---|
| 78 | 70 | |
|---|
| 79 | | - ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, 24); |
|---|
| 71 | + ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_cpu(rtd, 0), 0x3, 0x3, 2, 24); |
|---|
| 80 | 72 | if (ret < 0) { |
|---|
| 81 | 73 | dev_err(rtd->dev, "can't set I2S config, err %d\n", ret); |
|---|
| 82 | 74 | return ret; |
|---|
| .. | .. |
|---|
| 105 | 97 | .startup = aif1_startup, |
|---|
| 106 | 98 | }; |
|---|
| 107 | 99 | |
|---|
| 100 | +SND_SOC_DAILINK_DEF(dummy, |
|---|
| 101 | + DAILINK_COMP_ARRAY(COMP_DUMMY())); |
|---|
| 102 | + |
|---|
| 103 | +SND_SOC_DAILINK_DEF(media, |
|---|
| 104 | + DAILINK_COMP_ARRAY(COMP_CPU("media-cpu-dai"))); |
|---|
| 105 | + |
|---|
| 106 | +SND_SOC_DAILINK_DEF(deepbuffer, |
|---|
| 107 | + DAILINK_COMP_ARRAY(COMP_CPU("deepbuffer-cpu-dai"))); |
|---|
| 108 | + |
|---|
| 109 | +SND_SOC_DAILINK_DEF(ssp2_port, |
|---|
| 110 | + DAILINK_COMP_ARRAY(COMP_CPU("ssp2-port"))); |
|---|
| 111 | + |
|---|
| 112 | +SND_SOC_DAILINK_DEF(platform, |
|---|
| 113 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("sst-mfld-platform"))); |
|---|
| 114 | + |
|---|
| 108 | 115 | static struct snd_soc_dai_link dais[] = { |
|---|
| 109 | 116 | [MERR_DPCM_AUDIO] = { |
|---|
| 110 | 117 | .name = "Audio Port", |
|---|
| 111 | 118 | .stream_name = "Audio", |
|---|
| 112 | | - .cpu_dai_name = "media-cpu-dai", |
|---|
| 113 | | - .codec_dai_name = "snd-soc-dummy-dai", |
|---|
| 114 | | - .codec_name = "snd-soc-dummy", |
|---|
| 115 | | - .platform_name = "sst-mfld-platform", |
|---|
| 116 | 119 | .ignore_suspend = 1, |
|---|
| 117 | 120 | .nonatomic = true, |
|---|
| 118 | 121 | .dynamic = 1, |
|---|
| 119 | 122 | .dpcm_playback = 1, |
|---|
| 120 | 123 | .dpcm_capture = 1, |
|---|
| 121 | 124 | .ops = &aif1_ops, |
|---|
| 125 | + SND_SOC_DAILINK_REG(media, dummy, platform), |
|---|
| 122 | 126 | }, |
|---|
| 123 | 127 | [MERR_DPCM_DEEP_BUFFER] = { |
|---|
| 124 | 128 | .name = "Deep-Buffer Audio Port", |
|---|
| 125 | 129 | .stream_name = "Deep-Buffer Audio", |
|---|
| 126 | | - .cpu_dai_name = "deepbuffer-cpu-dai", |
|---|
| 127 | | - .codec_dai_name = "snd-soc-dummy-dai", |
|---|
| 128 | | - .codec_name = "snd-soc-dummy", |
|---|
| 129 | | - .platform_name = "sst-mfld-platform", |
|---|
| 130 | 130 | .ignore_suspend = 1, |
|---|
| 131 | 131 | .nonatomic = true, |
|---|
| 132 | 132 | .dynamic = 1, |
|---|
| 133 | 133 | .dpcm_playback = 1, |
|---|
| 134 | 134 | .ops = &aif1_ops, |
|---|
| 135 | + SND_SOC_DAILINK_REG(deepbuffer, dummy, platform), |
|---|
| 135 | 136 | }, |
|---|
| 136 | 137 | /* CODEC<->CODEC link */ |
|---|
| 137 | 138 | /* back ends */ |
|---|
| 138 | 139 | { |
|---|
| 139 | 140 | .name = "SSP2-LowSpeed Connector", |
|---|
| 140 | 141 | .id = 0, |
|---|
| 141 | | - .cpu_dai_name = "ssp2-port", |
|---|
| 142 | | - .platform_name = "sst-mfld-platform", |
|---|
| 143 | 142 | .no_pcm = 1, |
|---|
| 144 | | - .codec_dai_name = "snd-soc-dummy-dai", |
|---|
| 145 | | - .codec_name = "snd-soc-dummy", |
|---|
| 146 | 143 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
|---|
| 147 | 144 | | SND_SOC_DAIFMT_CBS_CFS, |
|---|
| 148 | 145 | .be_hw_params_fixup = codec_fixup, |
|---|
| .. | .. |
|---|
| 150 | 147 | .nonatomic = true, |
|---|
| 151 | 148 | .dpcm_playback = 1, |
|---|
| 152 | 149 | .dpcm_capture = 1, |
|---|
| 150 | + SND_SOC_DAILINK_REG(ssp2_port, dummy, platform), |
|---|
| 153 | 151 | }, |
|---|
| 154 | 152 | }; |
|---|
| 155 | 153 | |
|---|