Lines Matching +full:tegra210 +full:- +full:sfc
1 // SPDX-License-Identifier: GPL-2.0-only
3 // tegra210_ahub.c - Tegra210 AHUB driver
5 // Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
22 struct soc_enum *e = (struct soc_enum *)kctl->private_value; in tegra_ahub_get_value_enum()
29 for (i = 0; i < ahub->soc_data->reg_count; i++) { in tegra_ahub_get_value_enum()
32 reg = e->reg + (TEGRA210_XBAR_PART1_RX * i); in tegra_ahub_get_value_enum()
34 reg_val &= ahub->soc_data->mask[i]; in tegra_ahub_get_value_enum()
38 (8 * cmpnt->val_bytes * i); in tegra_ahub_get_value_enum()
44 for (i = 0; i < e->items; i++) { in tegra_ahub_get_value_enum()
45 if (bit_pos == e->values[i]) { in tegra_ahub_get_value_enum()
46 uctl->value.enumerated.item[0] = i; in tegra_ahub_get_value_enum()
60 struct soc_enum *e = (struct soc_enum *)kctl->private_value; in tegra_ahub_put_value_enum()
62 unsigned int *item = uctl->value.enumerated.item; in tegra_ahub_put_value_enum()
63 unsigned int value = e->values[item[0]]; in tegra_ahub_put_value_enum()
67 if (item[0] >= e->items) in tegra_ahub_put_value_enum()
68 return -EINVAL; in tegra_ahub_put_value_enum()
72 reg_idx = (value - 1) / (8 * cmpnt->val_bytes); in tegra_ahub_put_value_enum()
73 bit_pos = (value - 1) % (8 * cmpnt->val_bytes); in tegra_ahub_put_value_enum()
82 for (i = 0; i < ahub->soc_data->reg_count; i++) { in tegra_ahub_put_value_enum()
83 update[i].reg = e->reg + (TEGRA210_XBAR_PART1_RX * i); in tegra_ahub_put_value_enum()
85 update[i].mask = ahub->soc_data->mask[i]; in tegra_ahub_put_value_enum()
111 /* XBAR <-> I2S <-> Codec */
117 /* XBAR <- DMIC <- Codec */
121 /* XBAR -> SFC -> XBAR */
130 /* XBAR -> MVC -> XBAR */
135 /* XBAR -> AMX(4:1) -> XBAR */
146 /* XBAR -> ADX(1:4) -> XBAR */
157 /* XBAR -> MIXER(10:5) -> XBAR */
173 /* XBAR -> OPE -> XBAR */
201 /* XBAR <-> I2S <-> Codec */
208 /* XBAR <- DMIC <- Codec */
213 /* XBAR -> DSPK -> Codec */
216 /* XBAR -> SFC -> XBAR */
225 /* XBAR -> MVC -> XBAR */
230 /* XBAR -> AMX(4:1) -> XBAR */
251 /* XBAR -> ADX(1:4) -> XBAR */
272 /* XBAR -> MIXER1(10:5) -> XBAR */
288 /* XBAR -> ASRC -> XBAR */
302 /* XBAR -> OPE -> XBAR */
447 /* SFC */
514 /* SFC */
1000 { name " XBAR-TX", NULL, name " Mux" }, \
1001 { name " Mux", "ADMAIF1", "ADMAIF1 XBAR-RX" }, \
1002 { name " Mux", "ADMAIF2", "ADMAIF2 XBAR-RX" }, \
1003 { name " Mux", "ADMAIF3", "ADMAIF3 XBAR-RX" }, \
1004 { name " Mux", "ADMAIF4", "ADMAIF4 XBAR-RX" }, \
1005 { name " Mux", "ADMAIF5", "ADMAIF5 XBAR-RX" }, \
1006 { name " Mux", "ADMAIF6", "ADMAIF6 XBAR-RX" }, \
1007 { name " Mux", "ADMAIF7", "ADMAIF7 XBAR-RX" }, \
1008 { name " Mux", "ADMAIF8", "ADMAIF8 XBAR-RX" }, \
1009 { name " Mux", "ADMAIF9", "ADMAIF9 XBAR-RX" }, \
1010 { name " Mux", "ADMAIF10", "ADMAIF10 XBAR-RX" }, \
1011 { name " Mux", "I2S1", "I2S1 XBAR-RX" }, \
1012 { name " Mux", "I2S2", "I2S2 XBAR-RX" }, \
1013 { name " Mux", "I2S3", "I2S3 XBAR-RX" }, \
1014 { name " Mux", "I2S4", "I2S4 XBAR-RX" }, \
1015 { name " Mux", "I2S5", "I2S5 XBAR-RX" }, \
1016 { name " Mux", "DMIC1", "DMIC1 XBAR-RX" }, \
1017 { name " Mux", "DMIC2", "DMIC2 XBAR-RX" }, \
1018 { name " Mux", "DMIC3", "DMIC3 XBAR-RX" }, \
1019 { name " Mux", "SFC1", "SFC1 XBAR-RX" }, \
1020 { name " Mux", "SFC2", "SFC2 XBAR-RX" }, \
1021 { name " Mux", "SFC3", "SFC3 XBAR-RX" }, \
1022 { name " Mux", "SFC4", "SFC4 XBAR-RX" }, \
1023 { name " Mux", "MVC1", "MVC1 XBAR-RX" }, \
1024 { name " Mux", "MVC2", "MVC2 XBAR-RX" }, \
1025 { name " Mux", "AMX1", "AMX1 XBAR-RX" }, \
1026 { name " Mux", "AMX2", "AMX2 XBAR-RX" }, \
1027 { name " Mux", "ADX1 TX1", "ADX1 TX1 XBAR-RX" }, \
1028 { name " Mux", "ADX1 TX2", "ADX1 TX2 XBAR-RX" }, \
1029 { name " Mux", "ADX1 TX3", "ADX1 TX3 XBAR-RX" }, \
1030 { name " Mux", "ADX1 TX4", "ADX1 TX4 XBAR-RX" }, \
1031 { name " Mux", "ADX2 TX1", "ADX2 TX1 XBAR-RX" }, \
1032 { name " Mux", "ADX2 TX2", "ADX2 TX2 XBAR-RX" }, \
1033 { name " Mux", "ADX2 TX3", "ADX2 TX3 XBAR-RX" }, \
1034 { name " Mux", "ADX2 TX4", "ADX2 TX4 XBAR-RX" }, \
1035 { name " Mux", "MIXER1 TX1", "MIXER1 TX1 XBAR-RX" }, \
1036 { name " Mux", "MIXER1 TX2", "MIXER1 TX2 XBAR-RX" }, \
1037 { name " Mux", "MIXER1 TX3", "MIXER1 TX3 XBAR-RX" }, \
1038 { name " Mux", "MIXER1 TX4", "MIXER1 TX4 XBAR-RX" }, \
1039 { name " Mux", "MIXER1 TX5", "MIXER1 TX5 XBAR-RX" }, \
1040 { name " Mux", "OPE1", "OPE1 XBAR-RX" },
1043 { name " Mux", "OPE2", "OPE2 XBAR-RX" },
1046 { name " Mux", "ADMAIF11", "ADMAIF11 XBAR-RX" }, \
1047 { name " Mux", "ADMAIF12", "ADMAIF12 XBAR-RX" }, \
1048 { name " Mux", "ADMAIF13", "ADMAIF13 XBAR-RX" }, \
1049 { name " Mux", "ADMAIF14", "ADMAIF14 XBAR-RX" }, \
1050 { name " Mux", "ADMAIF15", "ADMAIF15 XBAR-RX" }, \
1051 { name " Mux", "ADMAIF16", "ADMAIF16 XBAR-RX" }, \
1052 { name " Mux", "ADMAIF17", "ADMAIF17 XBAR-RX" }, \
1053 { name " Mux", "ADMAIF18", "ADMAIF18 XBAR-RX" }, \
1054 { name " Mux", "ADMAIF19", "ADMAIF19 XBAR-RX" }, \
1055 { name " Mux", "ADMAIF20", "ADMAIF20 XBAR-RX" }, \
1056 { name " Mux", "I2S6", "I2S6 XBAR-RX" }, \
1057 { name " Mux", "DMIC4", "DMIC4 XBAR-RX" }, \
1058 { name " Mux", "AMX3", "AMX3 XBAR-RX" }, \
1059 { name " Mux", "AMX4", "AMX4 XBAR-RX" }, \
1060 { name " Mux", "ADX3 TX1", "ADX3 TX1 XBAR-RX" }, \
1061 { name " Mux", "ADX3 TX2", "ADX3 TX2 XBAR-RX" }, \
1062 { name " Mux", "ADX3 TX3", "ADX3 TX3 XBAR-RX" }, \
1063 { name " Mux", "ADX3 TX4", "ADX3 TX4 XBAR-RX" }, \
1064 { name " Mux", "ADX4 TX1", "ADX4 TX1 XBAR-RX" }, \
1065 { name " Mux", "ADX4 TX2", "ADX4 TX2 XBAR-RX" }, \
1066 { name " Mux", "ADX4 TX3", "ADX4 TX3 XBAR-RX" }, \
1067 { name " Mux", "ADX4 TX4", "ADX4 TX4 XBAR-RX" }, \
1068 { name " Mux", "ASRC1 TX1", "ASRC1 TX1 XBAR-RX" }, \
1069 { name " Mux", "ASRC1 TX2", "ASRC1 TX2 XBAR-RX" }, \
1070 { name " Mux", "ASRC1 TX3", "ASRC1 TX3 XBAR-RX" }, \
1071 { name " Mux", "ASRC1 TX4", "ASRC1 TX4 XBAR-RX" }, \
1072 { name " Mux", "ASRC1 TX5", "ASRC1 TX5 XBAR-RX" }, \
1073 { name " Mux", "ASRC1 TX6", "ASRC1 TX6 XBAR-RX" },
1085 { name " XBAR-Playback", NULL, name " Playback" }, \
1086 { name " XBAR-RX", NULL, name " XBAR-Playback"}, \
1087 { name " XBAR-Capture", NULL, name " XBAR-TX" }, \
1088 { name " Capture", NULL, name " XBAR-Capture" },
1315 { .compatible = "nvidia,tegra210-ahub", .data = &soc_data_tegra210 },
1316 { .compatible = "nvidia,tegra186-ahub", .data = &soc_data_tegra186 },
1317 { .compatible = "nvidia,tegra234-ahub", .data = &soc_data_tegra234 },
1326 regcache_cache_only(ahub->regmap, true); in tegra_ahub_runtime_suspend()
1327 regcache_mark_dirty(ahub->regmap); in tegra_ahub_runtime_suspend()
1329 clk_disable_unprepare(ahub->clk); in tegra_ahub_runtime_suspend()
1339 err = clk_prepare_enable(ahub->clk); in tegra_ahub_runtime_resume()
1345 regcache_cache_only(ahub->regmap, false); in tegra_ahub_runtime_resume()
1346 regcache_sync(ahub->regmap); in tegra_ahub_runtime_resume()
1357 ahub = devm_kzalloc(&pdev->dev, sizeof(*ahub), GFP_KERNEL); in tegra_ahub_probe()
1359 return -ENOMEM; in tegra_ahub_probe()
1361 ahub->soc_data = of_device_get_match_data(&pdev->dev); in tegra_ahub_probe()
1365 ahub->clk = devm_clk_get(&pdev->dev, "ahub"); in tegra_ahub_probe()
1366 if (IS_ERR(ahub->clk)) { in tegra_ahub_probe()
1367 dev_err(&pdev->dev, "can't retrieve AHUB clock\n"); in tegra_ahub_probe()
1368 return PTR_ERR(ahub->clk); in tegra_ahub_probe()
1375 ahub->regmap = devm_regmap_init_mmio(&pdev->dev, regs, in tegra_ahub_probe()
1376 ahub->soc_data->regmap_config); in tegra_ahub_probe()
1377 if (IS_ERR(ahub->regmap)) { in tegra_ahub_probe()
1378 dev_err(&pdev->dev, "regmap init failed\n"); in tegra_ahub_probe()
1379 return PTR_ERR(ahub->regmap); in tegra_ahub_probe()
1382 regcache_cache_only(ahub->regmap, true); in tegra_ahub_probe()
1384 err = devm_snd_soc_register_component(&pdev->dev, in tegra_ahub_probe()
1385 ahub->soc_data->cmpnt_drv, in tegra_ahub_probe()
1386 ahub->soc_data->dai_drv, in tegra_ahub_probe()
1387 ahub->soc_data->num_dais); in tegra_ahub_probe()
1389 dev_err(&pdev->dev, "can't register AHUB component, err: %d\n", in tegra_ahub_probe()
1394 pm_runtime_enable(&pdev->dev); in tegra_ahub_probe()
1396 err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); in tegra_ahub_probe()
1398 pm_runtime_disable(&pdev->dev); in tegra_ahub_probe()
1407 pm_runtime_disable(&pdev->dev); in tegra_ahub_remove()
1421 .name = "tegra210-ahub",
1430 MODULE_DESCRIPTION("Tegra210 ASoC AHUB driver");