Lines Matching +full:tegra210 +full:- +full:amixer

1 // SPDX-License-Identifier: GPL-2.0-only
3 // tegra210_mixer.c - Tegra210 MIXER driver
80 regcache_cache_only(mixer->regmap, true); in tegra210_mixer_runtime_suspend()
81 regcache_mark_dirty(mixer->regmap); in tegra210_mixer_runtime_suspend()
90 regcache_cache_only(mixer->regmap, false); in tegra210_mixer_runtime_resume()
91 regcache_sync(mixer->regmap); in tegra210_mixer_runtime_resume()
104 err = regmap_read_poll_timeout(mixer->regmap, in tegra210_mixer_write_ram()
116 regmap_write(mixer->regmap, in tegra210_mixer_write_ram()
119 regmap_write(mixer->regmap, in tegra210_mixer_write_ram()
133 pm_runtime_get_sync(cmpnt->dev); in tegra210_mixer_configure_gain()
146 mixer->gain_value[id]); in tegra210_mixer_configure_gain()
171 pm_runtime_put(cmpnt->dev); in tegra210_mixer_configure_gain()
180 (struct soc_mixer_control *)kcontrol->private_value; in tegra210_mixer_get_gain()
183 unsigned int reg = mc->reg; in tegra210_mixer_get_gain()
186 i = (reg - TEGRA210_MIXER_GAIN_CFG_RAM_ADDR_0) / in tegra210_mixer_get_gain()
189 ucontrol->value.integer.value[0] = mixer->gain_value[i]; in tegra210_mixer_get_gain()
199 (struct soc_mixer_control *)kcontrol->private_value; in tegra210_mixer_apply_gain()
202 unsigned int reg = mc->reg, id; in tegra210_mixer_apply_gain()
206 id = (reg - TEGRA210_MIXER_GAIN_CFG_RAM_ADDR_0) / in tegra210_mixer_apply_gain()
209 if (mixer->gain_value[id] == ucontrol->value.integer.value[0]) in tegra210_mixer_apply_gain()
212 mixer->gain_value[id] = ucontrol->value.integer.value[0]; in tegra210_mixer_apply_gain()
216 dev_err(cmpnt->dev, "Failed to apply gain\n"); in tegra210_mixer_apply_gain()
255 return -EINVAL; in tegra210_mixer_set_audio_cif()
263 tegra_set_cif(mixer->regmap, in tegra210_mixer_set_audio_cif()
279 dai->id); in tegra210_mixer_in_hw_params()
283 return tegra210_mixer_configure_gain(dai->component, dai->id, false); in tegra210_mixer_in_hw_params()
294 dai->id - TEGRA210_MIXER_RX_MAX); in tegra210_mixer_out_hw_params()
307 .name = "MIXER-RX-CIF"#id, \
309 .stream_name = "RX" #id "-CIF-Playback",\
318 .stream_name = "RX" #id "-CIF-Capture", \
331 .name = "MIXER-TX-CIF" #id, \
333 .stream_name = "TX" #id "-CIF-Playback",\
342 .stream_name = "TX" #id "-CIF-Capture", \
396 MIXER_GAIN_CFG_RAM_ADDR((id) - 1), 0, \
400 MIXER_GAIN_CFG_RAM_ADDR((id) - 1), 0, \
447 { "RX" #id " XBAR-" sname, NULL, "RX" #id " XBAR-TX" }, \
448 { "RX" #id "-CIF-" sname, NULL, "RX" #id " XBAR-" sname }, \
449 { "RX" #id, NULL, "RX" #id "-CIF-" sname }
467 { "TX" #id "-CIF-" sname, NULL, "TX" #id }, \
468 { "TX" #id " XBAR-" sname, NULL, "TX" #id "-CIF-" sname }, \
469 { "TX" #id " XBAR-RX", NULL, "TX" #id " XBAR-" sname } \
610 { .compatible = "nvidia,tegra210-amixer" },
617 struct device *dev = &pdev->dev; in tegra210_mixer_platform_probe()
624 return -ENOMEM; in tegra210_mixer_platform_probe()
630 mixer->gain_value[i] = gain_params.gain_value; in tegra210_mixer_platform_probe()
636 mixer->regmap = devm_regmap_init_mmio(dev, regs, in tegra210_mixer_platform_probe()
638 if (IS_ERR(mixer->regmap)) { in tegra210_mixer_platform_probe()
640 return PTR_ERR(mixer->regmap); in tegra210_mixer_platform_probe()
643 regcache_cache_only(mixer->regmap, true); in tegra210_mixer_platform_probe()
660 pm_runtime_disable(&pdev->dev); in tegra210_mixer_platform_remove()
682 MODULE_DESCRIPTION("Tegra210 MIXER ASoC driver");