Lines Matching +full:tdm +full:- +full:data +full:- +full:out

1 // SPDX-License-Identifier: GPL-2.0
14 #include <sound/soc-dai.h>
16 #include <dt-bindings/sound/meson-g12a-toacodec.h>
17 #include "axg-tdm.h"
18 #include "meson-codec-glue.h"
20 #define G12A_TOACODEC_DRV_NAME "g12a-toacodec"
71 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in g12a_toacodec_mux_put_enum()
74 mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); in g12a_toacodec_mux_put_enum()
75 regmap_field_read(priv->field_dat_sel, &reg); in g12a_toacodec_mux_put_enum()
83 regmap_field_write(priv->field_dat_sel, mux); in g12a_toacodec_mux_put_enum()
84 regmap_field_write(priv->field_lrclk_sel, mux); in g12a_toacodec_mux_put_enum()
85 regmap_field_write(priv->field_bclk_sel, mux); in g12a_toacodec_mux_put_enum()
90 * controller instead of going the through the TDM interface. in g12a_toacodec_mux_put_enum()
94 * find out the clock used by the interface and select the same in g12a_toacodec_mux_put_enum()
98 snd_soc_component_update_bits(component, e->reg, in g12a_toacodec_mux_put_enum()
132 SND_SOC_DAPM_SWITCH("OUT EN", SND_SOC_NOPM, 0, 0,
139 SND_SOC_DAPM_SWITCH("OUT EN", SND_SOC_NOPM, 0, 0,
147 struct meson_codec_glue_input *data; in g12a_toacodec_input_hw_params() local
154 /* The glue will provide 1 lane out of the 4 to the output */ in g12a_toacodec_input_hw_params()
155 data = meson_codec_glue_input_get_data(dai); in g12a_toacodec_input_hw_params()
156 data->params.channels_min = min_t(unsigned int, TOACODEC_OUT_CHMAX, in g12a_toacodec_input_hw_params()
157 data->params.channels_min); in g12a_toacodec_input_hw_params()
158 data->params.channels_max = min_t(unsigned int, TOACODEC_OUT_CHMAX, in g12a_toacodec_input_hw_params()
159 data->params.channels_max); in g12a_toacodec_input_hw_params()
203 TOACODEC_OUTPUT("OUT", TOACODEC_OUT),
224 { "OUT EN", "Switch", "SRC" },
225 { "OUT Capture", NULL, "OUT EN" },
280 .compatible = "amlogic,g12a-toacodec",
281 .data = &g12a_toacodec_match_data,
284 .compatible = "amlogic,sm1-toacodec",
285 .data = &sm1_toacodec_match_data,
293 const struct g12a_toacodec_match_data *data; in g12a_toacodec_probe() local
294 struct device *dev = &pdev->dev; in g12a_toacodec_probe()
300 data = device_get_match_data(dev); in g12a_toacodec_probe()
301 if (!data) { in g12a_toacodec_probe()
303 return -ENODEV; in g12a_toacodec_probe()
308 return -ENOMEM; in g12a_toacodec_probe()
327 priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel); in g12a_toacodec_probe()
328 if (IS_ERR(priv->field_dat_sel)) in g12a_toacodec_probe()
329 return PTR_ERR(priv->field_dat_sel); in g12a_toacodec_probe()
331 priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel); in g12a_toacodec_probe()
332 if (IS_ERR(priv->field_lrclk_sel)) in g12a_toacodec_probe()
333 return PTR_ERR(priv->field_lrclk_sel); in g12a_toacodec_probe()
335 priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel); in g12a_toacodec_probe()
336 if (IS_ERR(priv->field_bclk_sel)) in g12a_toacodec_probe()
337 return PTR_ERR(priv->field_bclk_sel); in g12a_toacodec_probe()
340 data->component_drv, g12a_toacodec_dai_drv, in g12a_toacodec_probe()