Lines Matching +full:soc +full:- +full:glue
1 // SPDX-License-Identifier: GPL-2.0
13 #include <sound/soc.h>
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 if (ucontrol->value.enumerated.item[0] >= e->items) in g12a_toacodec_mux_put_enum()
75 return -EINVAL; in g12a_toacodec_mux_put_enum()
77 mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); in g12a_toacodec_mux_put_enum()
78 regmap_field_read(priv->field_dat_sel, ®); in g12a_toacodec_mux_put_enum()
86 regmap_field_write(priv->field_dat_sel, mux); in g12a_toacodec_mux_put_enum()
87 regmap_field_write(priv->field_lrclk_sel, mux); in g12a_toacodec_mux_put_enum()
88 regmap_field_write(priv->field_bclk_sel, mux); in g12a_toacodec_mux_put_enum()
92 * On this soc, the glue gets the MCLK directly from the clock in g12a_toacodec_mux_put_enum()
96 * true for now, it could be different. Instead the glue should in g12a_toacodec_mux_put_enum()
101 snd_soc_component_update_bits(component, e->reg, in g12a_toacodec_mux_put_enum()
157 /* The glue will provide 1 lane out of the 4 to the output */ in g12a_toacodec_input_hw_params()
159 data->params.channels_min = min_t(unsigned int, TOACODEC_OUT_CHMAX, in g12a_toacodec_input_hw_params()
160 data->params.channels_min); in g12a_toacodec_input_hw_params()
161 data->params.channels_max = min_t(unsigned int, TOACODEC_OUT_CHMAX, in g12a_toacodec_input_hw_params()
162 data->params.channels_max); in g12a_toacodec_input_hw_params()
283 .compatible = "amlogic,g12a-toacodec",
287 .compatible = "amlogic,sm1-toacodec",
297 struct device *dev = &pdev->dev; in g12a_toacodec_probe()
306 return -ENODEV; in g12a_toacodec_probe()
311 return -ENOMEM; in g12a_toacodec_probe()
330 priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel); in g12a_toacodec_probe()
331 if (IS_ERR(priv->field_dat_sel)) in g12a_toacodec_probe()
332 return PTR_ERR(priv->field_dat_sel); in g12a_toacodec_probe()
334 priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel); in g12a_toacodec_probe()
335 if (IS_ERR(priv->field_lrclk_sel)) in g12a_toacodec_probe()
336 return PTR_ERR(priv->field_lrclk_sel); in g12a_toacodec_probe()
338 priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel); in g12a_toacodec_probe()
339 if (IS_ERR(priv->field_bclk_sel)) in g12a_toacodec_probe()
340 return PTR_ERR(priv->field_bclk_sel); in g12a_toacodec_probe()
343 data->component_drv, g12a_toacodec_dai_drv, in g12a_toacodec_probe()