Lines Matching +full:dai +full:- +full:format

1 // SPDX-License-Identifier: GPL-2.0-only
3 * sound/soc/codecs/si476x.c -- Codec driver for SI476X chips
21 #include <linux/mfd/si476x-core.h>
68 struct si476x_core *core = i2c_mfd_cell_to_core(codec_dai->dev); in si476x_codec_set_dai_fmt()
70 u16 format = 0; in si476x_codec_set_dai_fmt() local
73 return -EINVAL; in si476x_codec_set_dai_fmt()
77 format |= SI476X_DAUDIO_MODE_DSP_A; in si476x_codec_set_dai_fmt()
80 format |= SI476X_DAUDIO_MODE_DSP_B; in si476x_codec_set_dai_fmt()
83 format |= SI476X_DAUDIO_MODE_I2S; in si476x_codec_set_dai_fmt()
86 format |= SI476X_DAUDIO_MODE_RIGHT_J; in si476x_codec_set_dai_fmt()
89 format |= SI476X_DAUDIO_MODE_LEFT_J; in si476x_codec_set_dai_fmt()
92 return -EINVAL; in si476x_codec_set_dai_fmt()
102 format |= SI476X_DAUDIO_MODE_IB; in si476x_codec_set_dai_fmt()
105 return -EINVAL; in si476x_codec_set_dai_fmt()
115 format |= SI476X_DAUDIO_MODE_IB | in si476x_codec_set_dai_fmt()
119 format |= SI476X_DAUDIO_MODE_IB; in si476x_codec_set_dai_fmt()
122 format |= SI476X_DAUDIO_MODE_IF; in si476x_codec_set_dai_fmt()
125 return -EINVAL; in si476x_codec_set_dai_fmt()
129 return -EINVAL; in si476x_codec_set_dai_fmt()
134 err = snd_soc_component_update_bits(codec_dai->component, SI476X_DIGITAL_IO_OUTPUT_FORMAT, in si476x_codec_set_dai_fmt()
136 format); in si476x_codec_set_dai_fmt()
141 dev_err(codec_dai->component->dev, "Failed to set output format\n"); in si476x_codec_set_dai_fmt()
150 struct snd_soc_dai *dai) in si476x_codec_hw_params() argument
152 struct si476x_core *core = i2c_mfd_cell_to_core(dai->dev); in si476x_codec_hw_params()
157 dev_err(dai->component->dev, "Rate: %d is not supported\n", rate); in si476x_codec_hw_params()
158 return -EINVAL; in si476x_codec_hw_params()
175 return -EINVAL; in si476x_codec_hw_params()
180 err = snd_soc_component_write(dai->component, SI476X_DIGITAL_IO_OUTPUT_SAMPLE_RATE, in si476x_codec_hw_params()
183 dev_err(dai->component->dev, "Failed to set sample rate\n"); in si476x_codec_hw_params()
187 err = snd_soc_component_update_bits(dai->component, SI476X_DIGITAL_IO_OUTPUT_FORMAT, in si476x_codec_hw_params()
192 dev_err(dai->component->dev, "Failed to set output width\n"); in si476x_codec_hw_params()
208 .name = "si476x-codec",
228 dev_get_regmap(component->dev->parent, NULL)); in si476x_probe()
246 return devm_snd_soc_register_component(&pdev->dev, in si476x_platform_probe()
251 MODULE_ALIAS("platform:si476x-codec");
255 .name = "si476x-codec",