Lines Matching full:amx
3 // tegra210_amx.c - Tegra210 AMX driver
25 * received within these clock cycles, the AMX input channel gets
49 static void tegra210_amx_write_map_ram(struct tegra210_amx *amx) in tegra210_amx_write_map_ram() argument
53 regmap_write(amx->regmap, TEGRA210_AMX_CFG_RAM_CTRL, in tegra210_amx_write_map_ram()
59 regmap_write(amx->regmap, TEGRA210_AMX_CFG_RAM_DATA, in tegra210_amx_write_map_ram()
60 amx->map[i]); in tegra210_amx_write_map_ram()
62 regmap_write(amx->regmap, TEGRA210_AMX_OUT_BYTE_EN0, amx->byte_mask[0]); in tegra210_amx_write_map_ram()
63 regmap_write(amx->regmap, TEGRA210_AMX_OUT_BYTE_EN1, amx->byte_mask[1]); in tegra210_amx_write_map_ram()
69 struct tegra210_amx *amx = snd_soc_dai_get_drvdata(dai); in tegra210_amx_startup() local
73 /* Ensure if AMX is disabled */ in tegra210_amx_startup()
74 err = regmap_read_poll_timeout(amx->regmap, TEGRA210_AMX_STATUS, val, in tegra210_amx_startup()
77 dev_err(dai->dev, "failed to stop AMX, err = %d\n", err); in tegra210_amx_startup()
87 regmap_update_bits(amx->regmap, TEGRA210_AMX_SOFT_RESET, in tegra210_amx_startup()
91 err = regmap_read_poll_timeout(amx->regmap, TEGRA210_AMX_SOFT_RESET, in tegra210_amx_startup()
94 dev_err(dai->dev, "failed to reset AMX, err = %d\n", err); in tegra210_amx_startup()
103 struct tegra210_amx *amx = dev_get_drvdata(dev); in tegra210_amx_runtime_suspend() local
105 regcache_cache_only(amx->regmap, true); in tegra210_amx_runtime_suspend()
106 regcache_mark_dirty(amx->regmap); in tegra210_amx_runtime_suspend()
113 struct tegra210_amx *amx = dev_get_drvdata(dev); in tegra210_amx_runtime_resume() local
115 regcache_cache_only(amx->regmap, false); in tegra210_amx_runtime_resume()
116 regcache_sync(amx->regmap); in tegra210_amx_runtime_resume()
118 regmap_update_bits(amx->regmap, in tegra210_amx_runtime_resume()
123 tegra210_amx_write_map_ram(amx); in tegra210_amx_runtime_resume()
132 struct tegra210_amx *amx = snd_soc_dai_get_drvdata(dai); in tegra210_amx_set_audio_cif() local
159 tegra_set_cif(amx->regmap, reg, &cif_conf); in tegra210_amx_set_audio_cif()
168 struct tegra210_amx *amx = snd_soc_dai_get_drvdata(dai); in tegra210_amx_in_hw_params() local
170 if (amx->soc_data->auto_disable) { in tegra210_amx_in_hw_params()
171 regmap_write(amx->regmap, in tegra210_amx_in_hw_params()
174 regmap_write(amx->regmap, TEGRA210_AMX_CYA, 1); in tegra210_amx_in_hw_params()
195 struct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt); in tegra210_amx_get_byte_map() local
196 unsigned char *bytes_map = (unsigned char *)&amx->map; in tegra210_amx_get_byte_map()
201 enabled = amx->byte_mask[1] & (1 << (reg - 32)); in tegra210_amx_get_byte_map()
203 enabled = amx->byte_mask[0] & (1 << reg); in tegra210_amx_get_byte_map()
229 struct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt); in tegra210_amx_put_byte_map() local
230 unsigned char *bytes_map = (unsigned char *)&amx->map; in tegra210_amx_put_byte_map()
233 unsigned int mask_val = amx->byte_mask[reg / 32]; in tegra210_amx_put_byte_map()
240 if (mask_val == amx->byte_mask[reg / 32]) in tegra210_amx_put_byte_map()
245 amx->byte_mask[reg / 32] = mask_val; in tegra210_amx_put_byte_map()
261 .name = "AMX-RX-CIF" #id, \
285 .name = "AMX-TX-CIF", \
526 { .compatible = "nvidia,tegra210-amx", .data = &soc_data_tegra210 },
527 { .compatible = "nvidia,tegra194-amx", .data = &soc_data_tegra194 },
535 struct tegra210_amx *amx; in tegra210_amx_platform_probe() local
539 amx = devm_kzalloc(dev, sizeof(*amx), GFP_KERNEL); in tegra210_amx_platform_probe()
540 if (!amx) in tegra210_amx_platform_probe()
543 amx->soc_data = device_get_match_data(dev); in tegra210_amx_platform_probe()
545 dev_set_drvdata(dev, amx); in tegra210_amx_platform_probe()
551 amx->regmap = devm_regmap_init_mmio(dev, regs, in tegra210_amx_platform_probe()
552 amx->soc_data->regmap_conf); in tegra210_amx_platform_probe()
553 if (IS_ERR(amx->regmap)) { in tegra210_amx_platform_probe()
555 return PTR_ERR(amx->regmap); in tegra210_amx_platform_probe()
558 regcache_cache_only(amx->regmap, true); in tegra210_amx_platform_probe()
564 dev_err(dev, "can't register AMX component, err: %d\n", err); in tegra210_amx_platform_probe()
587 .name = "tegra210-amx",
597 MODULE_DESCRIPTION("Tegra210 AMX ASoC driver");