Lines Matching +full:tegra210 +full:- +full:ope
1 // SPDX-License-Identifier: GPL-2.0-only
3 // tegra210_ope.c - Tegra210 OPE driver
33 static int tegra210_ope_set_audio_cif(struct tegra210_ope *ope, in tegra210_ope_set_audio_cif() argument
44 return -EINVAL; in tegra210_ope_set_audio_cif()
54 return -EINVAL; in tegra210_ope_set_audio_cif()
62 tegra_set_cif(ope->regmap, reg, &cif_conf); in tegra210_ope_set_audio_cif()
71 struct device *dev = dai->dev; in tegra210_ope_hw_params()
72 struct tegra210_ope *ope = snd_soc_dai_get_drvdata(dai); in tegra210_ope_hw_params() local
76 err = tegra210_ope_set_audio_cif(ope, params, in tegra210_ope_hw_params()
79 dev_err(dev, "Can't set OPE RX CIF: %d\n", err); in tegra210_ope_hw_params()
83 err = tegra210_ope_set_audio_cif(ope, params, in tegra210_ope_hw_params()
86 dev_err(dev, "Can't set OPE TX CIF: %d\n", err); in tegra210_ope_hw_params()
90 tegra210_mbdrc_hw_params(dai->component); in tegra210_ope_hw_params()
97 struct tegra210_ope *ope = dev_get_drvdata(cmpnt->dev); in tegra210_ope_component_probe() local
103 * The OPE, PEQ and MBDRC functionalities are combined under one in tegra210_ope_component_probe()
104 * device registered by OPE driver. In fact OPE HW block includes in tegra210_ope_component_probe()
109 * the DAPM routes depend on OPE regmap only, below explicit in tegra210_ope_component_probe()
113 snd_soc_component_init_regmap(cmpnt, ope->regmap); in tegra210_ope_component_probe()
124 .name = "OPE-RX-CIF",
126 .stream_name = "RX-CIF-Playback",
135 .stream_name = "RX-CIF-Capture",
145 .name = "OPE-TX-CIF",
147 .stream_name = "TX-CIF-Playback",
156 .stream_name = "TX-CIF-Capture",
175 { "RX XBAR-" sname, NULL, "XBAR-TX" }, \
176 { "RX-CIF-" sname, NULL, "RX XBAR-" sname }, \
177 { "RX", NULL, "RX-CIF-" sname }, \
178 { "TX-CIF-" sname, NULL, "TX" }, \
179 { "TX XBAR-" sname, NULL, "TX-CIF-" sname }, \
180 { "XBAR-RX", NULL, "TX XBAR-" sname }
201 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); in tegra210_ope_get_data_dir() local
203 ucontrol->value.enumerated.item[0] = ope->data_dir; in tegra210_ope_get_data_dir()
212 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); in tegra210_ope_put_data_dir() local
213 unsigned int value = ucontrol->value.enumerated.item[0]; in tegra210_ope_put_data_dir()
215 if (value == ope->data_dir) in tegra210_ope_put_data_dir()
218 ope->data_dir = value; in tegra210_ope_put_data_dir()
300 struct device *dev = &pdev->dev; in tegra210_ope_probe()
301 struct tegra210_ope *ope; in tegra210_ope_probe() local
305 ope = devm_kzalloc(dev, sizeof(*ope), GFP_KERNEL); in tegra210_ope_probe()
306 if (!ope) in tegra210_ope_probe()
307 return -ENOMEM; in tegra210_ope_probe()
313 ope->regmap = devm_regmap_init_mmio(dev, regs, in tegra210_ope_probe()
315 if (IS_ERR(ope->regmap)) { in tegra210_ope_probe()
317 return PTR_ERR(ope->regmap); in tegra210_ope_probe()
320 regcache_cache_only(ope->regmap, true); in tegra210_ope_probe()
322 dev_set_drvdata(dev, ope); in tegra210_ope_probe()
340 dev_err(dev, "can't register OPE component, err: %d\n", err); in tegra210_ope_probe()
351 pm_runtime_disable(&pdev->dev); in tegra210_ope_remove()
356 struct tegra210_ope *ope = dev_get_drvdata(dev); in tegra210_ope_runtime_suspend() local
358 tegra210_peq_save(ope->peq_regmap, ope->peq_biquad_gains, in tegra210_ope_runtime_suspend()
359 ope->peq_biquad_shifts); in tegra210_ope_runtime_suspend()
361 regcache_cache_only(ope->mbdrc_regmap, true); in tegra210_ope_runtime_suspend()
362 regcache_cache_only(ope->peq_regmap, true); in tegra210_ope_runtime_suspend()
363 regcache_cache_only(ope->regmap, true); in tegra210_ope_runtime_suspend()
365 regcache_mark_dirty(ope->regmap); in tegra210_ope_runtime_suspend()
366 regcache_mark_dirty(ope->peq_regmap); in tegra210_ope_runtime_suspend()
367 regcache_mark_dirty(ope->mbdrc_regmap); in tegra210_ope_runtime_suspend()
374 struct tegra210_ope *ope = dev_get_drvdata(dev); in tegra210_ope_runtime_resume() local
376 regcache_cache_only(ope->regmap, false); in tegra210_ope_runtime_resume()
377 regcache_cache_only(ope->peq_regmap, false); in tegra210_ope_runtime_resume()
378 regcache_cache_only(ope->mbdrc_regmap, false); in tegra210_ope_runtime_resume()
380 regcache_sync(ope->regmap); in tegra210_ope_runtime_resume()
381 regcache_sync(ope->peq_regmap); in tegra210_ope_runtime_resume()
382 regcache_sync(ope->mbdrc_regmap); in tegra210_ope_runtime_resume()
384 tegra210_peq_restore(ope->peq_regmap, ope->peq_biquad_gains, in tegra210_ope_runtime_resume()
385 ope->peq_biquad_shifts); in tegra210_ope_runtime_resume()
398 { .compatible = "nvidia,tegra210-ope" },
405 .name = "tegra210-ope",
415 MODULE_DESCRIPTION("Tegra210 OPE ASoC driver");