platform: nvadsp: adsp_cpu_abus to set freq on t21x

Using adsp_cpu_abus which is a virtual clk (ADSP_CPU_ABUS clock) to set
frequency on t21x platform. Earlier the physical ADSP clk was used which
only provides a constant frequency.

Bug 1955157

Change-Id: Ifcf42b50a543a95e934e651e68056cb1c8d6c654
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1520261
(cherry picked from commit c1c8d713cd723b20f890cfbd205e38a90007e847)
Reviewed-on: https://git-master.nvidia.com/r/1542708
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
Ajay Nandakumar
2017-07-14 11:06:44 +05:30
committed by Laxman Dewangan
parent 9b73ee3d3e
commit 3fbe739b6f
4 changed files with 39 additions and 19 deletions

View File

@@ -37,7 +37,12 @@ static void nvadsp_clocks_disable(struct platform_device *pdev)
clk_disable_unprepare(drv_data->adsp_clk);
dev_dbg(dev, "adsp clocks disabled\n");
drv_data->adsp_clk = NULL;
drv_data->adsp_cpu_clk = NULL;
}
if (drv_data->adsp_cpu_abus_clk) {
clk_disable_unprepare(drv_data->adsp_cpu_abus_clk);
dev_dbg(dev, "adsp cpu abus clock disabled\n");
drv_data->adsp_cpu_abus_clk = NULL;
}
if (drv_data->adsp_neon_clk) {
@@ -95,7 +100,18 @@ static int nvadsp_clocks_enable(struct platform_device *pdev)
dev_err(dev, "unable to enable adsp clock\n");
goto end;
}
drv_data->adsp_cpu_clk = drv_data->adsp_clk;
drv_data->adsp_cpu_abus_clk = devm_clk_get(dev, "adsp_cpu_abus");
if (IS_ERR_OR_NULL(drv_data->adsp_cpu_abus_clk)) {
dev_err(dev, "unable to find adsp cpu abus clock\n");
ret = PTR_ERR(drv_data->adsp_cpu_abus_clk);
goto end;
}
ret = clk_prepare_enable(drv_data->adsp_cpu_abus_clk);
if (ret) {
dev_err(dev, "unable to enable adsp cpu abus clock\n");
goto end;
}
drv_data->adsp_neon_clk = devm_clk_get(dev, "adspneon");
if (IS_ERR_OR_NULL(drv_data->adsp_neon_clk)) {