tegra: hwpm: add clk rate as chip variable

LA clock rate is specific to a chip. Move LA clock rate macro as a chip
specific variable. Set la_clk_rate variable to correct value for T234
and TH500 chips.

Jira THWPM-112

Change-Id: I962cf579aed33d91d0abbfb8a44fc4063dc8444c
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3140419
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2024-05-16 22:36:09 -07:00
committed by mobile promotions
parent ab110e5f27
commit 095fc3dea0
4 changed files with 8 additions and 4 deletions

View File

@@ -23,8 +23,6 @@
#include <tegra_hwpm_clk_rst.h>
#include <os/linux/driver.h>
#define LA_CLK_RATE 625000000UL
int tegra_hwpm_clk_rst_prepare(struct tegra_hwpm_os_linux *hwpm_linux)
{
int ret = 0;
@@ -93,8 +91,9 @@ int tegra_hwpm_clk_rst_set_rate_enable(struct tegra_hwpm_os_linux *hwpm_linux)
goto fail;
}
}
/* set la_clk rate to 625 MHZ */
ret = clk_set_rate(hwpm_linux->la_clk, LA_CLK_RATE);
/* set la_clk rate */
ret = clk_set_rate(hwpm_linux->la_clk,
hwpm->active_chip->la_clk_rate);
if (ret < 0) {
tegra_hwpm_err(hwpm, "la clock set rate failed");
goto fail;