diff --git a/drivers/tegra/hwpm/hal/t234/t234_interface.c b/drivers/tegra/hwpm/hal/t234/t234_interface.c index 1406565..05b5140 100644 --- a/drivers/tegra/hwpm/hal/t234/t234_interface.c +++ b/drivers/tegra/hwpm/hal/t234/t234_interface.c @@ -31,6 +31,7 @@ #include static struct tegra_soc_hwpm_chip t234_chip_info = { + .la_clk_rate = 625000000, .chip_ips = NULL, /* HALs */ diff --git a/drivers/tegra/hwpm/hal/th500/th500_interface.c b/drivers/tegra/hwpm/hal/th500/th500_interface.c index 2242151..64f531e 100644 --- a/drivers/tegra/hwpm/hal/th500/th500_interface.c +++ b/drivers/tegra/hwpm/hal/th500/th500_interface.c @@ -30,6 +30,7 @@ #include static struct tegra_soc_hwpm_chip th500_chip_info = { + .la_clk_rate = 625000000, .chip_ips = NULL, /* HALs */ diff --git a/drivers/tegra/hwpm/include/tegra_hwpm.h b/drivers/tegra/hwpm/include/tegra_hwpm.h index 623a2d0..158d9e4 100644 --- a/drivers/tegra/hwpm/include/tegra_hwpm.h +++ b/drivers/tegra/hwpm/include/tegra_hwpm.h @@ -463,6 +463,9 @@ struct hwpm_ip { struct tegra_soc_hwpm; struct tegra_soc_hwpm_chip { + /* Max LA Clock rate */ + u64 la_clk_rate; + /* Array of pointers to active IP structures */ struct hwpm_ip **chip_ips; diff --git a/drivers/tegra/hwpm/os/linux/clk_rst_utils.c b/drivers/tegra/hwpm/os/linux/clk_rst_utils.c index 3a37d1a..c2f269f 100644 --- a/drivers/tegra/hwpm/os/linux/clk_rst_utils.c +++ b/drivers/tegra/hwpm/os/linux/clk_rst_utils.c @@ -23,8 +23,6 @@ #include #include -#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;