From 1a4c8af49e6bc5d31abdc823ae9c346696c865ae Mon Sep 17 00:00:00 2001 From: Rebecca Schultz Zavin Date: Thu, 19 Aug 2010 17:12:04 -0700 Subject: [PATCH] [ARM] tegra: nvrm: Remove NvRm reset and clock controls for camera These controls are no longer used. Change-Id: I5259a799777471272b54682d4bfef9a0739964ec Signed-off-by: Rebecca Schultz Zavin --- .../nv/nvrm/core/common/nvrm_module_stub.c | 11 +-- .../nv/nvrm/core/common/nvrm_power.c | 78 +------------------ 2 files changed, 2 insertions(+), 87 deletions(-) diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_module_stub.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_module_stub.c index a38683081ac4..d66fe35451e4 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_module_stub.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_module_stub.c @@ -179,9 +179,6 @@ void NvRmModuleGetBaseAddress( NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID Mo } #define is_avp(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Avp) -#define is_csi(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Csi) -#define is_isp(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Isp) -#define is_vi(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Vi) #define is_vcp(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Vcp) #define is_bsea(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_BseA) #define is_vde(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Vde) @@ -195,13 +192,7 @@ void NvRmModuleReset(NvRmDeviceHandle hRmDevice, NvRmModuleID Module) writel(1<<1, clk_rst + 0x300); udelay(10); writel(1<<1, clk_rst + 0x304); - } else if (is_csi(Module)) - clk = clk_get_sys("csi", NULL); - else if (is_vi(Module)) - clk = clk_get_sys("vi", NULL); - else if (is_isp(Module)) - clk = clk_get_sys("isp", NULL); - else if (is_vcp(Module)) + } else if (is_vcp(Module)) clk = clk_get_sys("vcp", NULL); else if (is_bsea(Module)) clk = clk_get_sys("bsea", NULL); diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_power.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_power.c index c9bf02999034..fd93eb66ea37 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_power.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_power.c @@ -42,12 +42,6 @@ #include "nvrm_power.h" #include "../../../../clock.h" -#define is_vi(module) (NVRM_MODULE_ID_MODULE(module)==NvRmModuleID_Vi) - -#define is_csi(module) (NVRM_MODULE_ID_MODULE(module)==NvRmModuleID_Csi) - -#define is_isp(module) (NVRM_MODULE_ID_MODULE(module)==NvRmModuleID_Isp) - #define is_vcp(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_Vcp) #define is_bsea(_mod) (NVRM_MODULE_ID_MODULE(_mod)==NvRmModuleID_BseA) @@ -68,70 +62,9 @@ NvError NvRmPowerModuleClockConfig( NvRmFreqKHz *CurrentFreq, NvU32 flags) { - struct clk *clk = NULL; - const char *name; - unsigned long rate; - int ret; - if (CurrentFreq) *CurrentFreq = 0; - if (!is_vi(ModuleId)) - return NvSuccess; - - if (flags & NvRmClockConfig_SubConfig) - name = "vi_sensor"; - else - name = "vi"; - - clk = clk_get_sys(name, NULL); - - if (IS_ERR_OR_NULL(clk)) { - pr_err("%s: failed to get struct clk %s\n", __func__, name); - return NvSuccess; - } - - if (PrefFreqListCount) - rate = *PrefFreqList * 1000; - else if (MaxFreq != NvRmFreqUnspecified) - rate = MaxFreq * 1000; - else if (MinFreq != NvRmFreqUnspecified) - rate = MinFreq * 1000; - else - rate = INT_MAX; - - ret = clk_set_rate(clk, rate); - if (ret) { - pr_err("%s: err %d setting %s to %luHz\n", __func__, ret, name, rate); - clk_put(clk); - return NvError_BadParameter; - } - - rate = clk_get_rate(clk); - if (CurrentFreq) - *CurrentFreq = (rate+500) / 1000; - - - if (!(flags & NvRmClockConfig_SubConfig)) { - void __iomem *car = IO_ADDRESS(TEGRA_CLK_RESET_BASE); - u32 val; - - if ((flags & NvRmClockConfig_InternalClockForPads) && - (flags & NvRmClockConfig_ExternalClockForCore)) { - pr_err("%s: invalid VI flag combination: %08x\n", __func__, flags); - clk_put(clk); - return NvError_BadParameter; - } - val = readl(car + clk->reg); - val &= ~(CLK_VI_CORE_EXTERNAL | CLK_VI_PAD_INTERNAL); - if (flags & NvRmClockConfig_InternalClockForPads) - val |= CLK_VI_PAD_INTERNAL; - else if (flags & NvRmClockConfig_ExternalClockForCore) - val |= CLK_VI_CORE_EXTERNAL; - writel(val, car + clk->reg); - } - - clk_put(clk); return NvSuccess; } @@ -141,21 +74,12 @@ NvError NvRmPowerModuleClockControl( NvU32 ClientId, NvBool Enable) { - const char *vi_names[] = { "vi", "vi_sensor", "csus", NULL }; - const char *csi_names[] = { "csi", NULL }; - const char *isp_names[] = { "isp", NULL }; const char *vcp_names[] = { "vcp", NULL }; const char *bsea_names[] = { "bsea", NULL }; const char *vde_names[] = { "vde", NULL }; const char **names = NULL; - if (is_vi(ModuleId)) - names = vi_names; - else if (is_csi(ModuleId)) - names = csi_names; - else if (is_isp(ModuleId)) - names = isp_names; - else if (is_vcp(ModuleId)) + if (is_vcp(ModuleId)) names = vcp_names; else if (is_bsea(ModuleId)) names = bsea_names; -- 2.34.1