Skip to content

Commit fa83757

Browse files
Sheetalbroonie
authored andcommitted
ASoC: tegra: ASRC: Update ARAM address
The ARAM address for Tegra264 has been updated. To maintain backward compatibility given its chip-specific nature, it's now included in the soc_data. Signed-off-by: Sheetal <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7668c63 commit fa83757

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

sound/soc/tegra/tegra186_asrc.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
// SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION. All rights reserved.
23
//
34
// tegra186_asrc.c - Tegra186 ASRC driver
4-
//
5-
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
65

76
#include <linux/clk.h>
87
#include <linux/delay.h>
@@ -99,7 +98,7 @@ static int tegra186_asrc_runtime_resume(struct device *dev)
9998
* sync is done after this to restore other settings.
10099
*/
101100
regmap_write(asrc->regmap, TEGRA186_ASRC_GLOBAL_SCRATCH_ADDR,
102-
TEGRA186_ASRC_ARAM_START_ADDR);
101+
asrc->soc_data->aram_start_addr);
103102
regmap_write(asrc->regmap, TEGRA186_ASRC_GLOBAL_ENB,
104103
TEGRA186_ASRC_GLOBAL_EN);
105104

@@ -954,8 +953,17 @@ static const struct regmap_config tegra186_asrc_regmap_config = {
954953
.cache_type = REGCACHE_FLAT,
955954
};
956955

956+
static const struct tegra_asrc_soc_data soc_data_tegra186 = {
957+
.aram_start_addr = TEGRA186_ASRC_ARAM_START_ADDR,
958+
};
959+
960+
static const struct tegra_asrc_soc_data soc_data_tegra264 = {
961+
.aram_start_addr = TEGRA264_ASRC_ARAM_START_ADDR,
962+
};
963+
957964
static const struct of_device_id tegra186_asrc_of_match[] = {
958-
{ .compatible = "nvidia,tegra186-asrc" },
965+
{ .compatible = "nvidia,tegra186-asrc", .data = &soc_data_tegra186 },
966+
{ .compatible = "nvidia,tegra264-asrc", .data = &soc_data_tegra264 },
959967
{},
960968
};
961969
MODULE_DEVICE_TABLE(of, tegra186_asrc_of_match);
@@ -985,6 +993,8 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
985993
return PTR_ERR(asrc->regmap);
986994
}
987995

996+
asrc->soc_data = of_device_get_match_data(&pdev->dev);
997+
988998
regcache_cache_only(asrc->regmap, true);
989999

9901000
regmap_write(asrc->regmap, TEGRA186_ASRC_GLOBAL_CFG,

sound/soc/tegra/tegra186_asrc.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/* SPDX-License-Identifier: GPL-2.0-only */
2-
/*
1+
/* SPDX-License-Identifier: GPL-2.0-only
2+
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION. All rights reserved.
33
* tegra186_asrc.h - Definitions for Tegra186 ASRC driver
44
*
5-
* Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
6-
*
75
*/
86

97
#ifndef __TEGRA186_ASRC_H__
@@ -94,6 +92,7 @@
9492
#define TEGRA186_ASRC_RATIO_SOURCE_SW 0x1
9593

9694
#define TEGRA186_ASRC_ARAM_START_ADDR 0x3f800000
95+
#define TEGRA264_ASRC_ARAM_START_ADDR 0x8a080000
9796

9897
struct tegra186_asrc_lane {
9998
unsigned int int_part;
@@ -104,7 +103,12 @@ struct tegra186_asrc_lane {
104103
unsigned int output_thresh;
105104
};
106105

106+
struct tegra_asrc_soc_data {
107+
unsigned int aram_start_addr;
108+
};
109+
107110
struct tegra186_asrc {
111+
const struct tegra_asrc_soc_data *soc_data;
108112
struct tegra186_asrc_lane lane[TEGRA186_ASRC_STREAM_MAX];
109113
struct regmap *regmap;
110114
};

0 commit comments

Comments
 (0)