Lines Matching +full:dai +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0
62 #define SSIREG(reg) (*(unsigned long *)(ssi->mmio + (reg)))
86 * track usage of the SSI; it is simplex-only so prevent attempts of
90 struct snd_soc_dai *dai) in ssi_startup() argument
92 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_startup()
93 if (ssi->inuse) { in ssi_startup()
95 return -EBUSY; in ssi_startup()
97 ssi->inuse = 1; in ssi_startup()
102 struct snd_soc_dai *dai) in ssi_shutdown() argument
104 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_shutdown()
106 ssi->inuse = 0; in ssi_shutdown()
110 struct snd_soc_dai *dai) in ssi_trigger() argument
112 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_trigger()
122 return -EINVAL; in ssi_trigger()
130 struct snd_soc_dai *dai) in ssi_hw_params() argument
132 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_hw_params()
134 unsigned int bits, channels, swl, recv, i; in ssi_hw_params() local
136 channels = params_channels(params); in ssi_hw_params()
137 bits = params->msbits; in ssi_hw_params()
138 recv = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1; in ssi_hw_params()
141 pr_debug("bits: %u channels: %u\n", bits, channels); in ssi_hw_params()
150 /* channels */ in ssi_hw_params()
151 if ((channels < 2) || (channels > 8) || (channels & 1)) { in ssi_hw_params()
152 pr_debug("ssi: invalid number of channels\n"); in ssi_hw_params()
153 return -EINVAL; in ssi_hw_params()
155 ssicr |= ((channels >> 1) - 1) << CR_CHNL_SHIFT; in ssi_hw_params()
170 return -EINVAL; in ssi_hw_params()
175 * wires. This is usually bits_per_sample x channels/2; i.e. in in ssi_hw_params()
180 * Waiting for ASoC to get TDM support ;-) in ssi_hw_params()
187 swl = (bits * channels) / 2; in ssi_hw_params()
199 return -EINVAL; in ssi_hw_params()
211 struct ssi_priv *ssi = &ssi_cpu_data[cpu_dai->id]; in ssi_set_sysclk()
213 ssi->sysclk = freq; in ssi_set_sysclk()
222 static int ssi_set_clkdiv(struct snd_soc_dai *dai, int did, int div) in ssi_set_clkdiv() argument
224 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_set_clkdiv()
239 return -EINVAL; in ssi_set_clkdiv()
245 static int ssi_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) in ssi_set_fmt() argument
247 struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; in ssi_set_fmt()
266 return -EINVAL; in ssi_set_fmt()
291 return -EINVAL; in ssi_set_fmt()
308 return -EINVAL; in ssi_set_fmt()
324 /* the SSI can do 8-32 bit samples, with 8 possible channels */
344 .name = "ssi-dai.0",
361 .name = "ssi-dai.1",
380 .name = "sh4-ssi",
386 return devm_snd_soc_register_component(&pdev->dev, &sh4_ssi_component, in sh4_soc_dai_probe()
393 .name = "sh4-ssi-dai",