From 22ef71c22e5b3c0f79327192b88247f5e35ca5a2 Mon Sep 17 00:00:00 2001 From: Pankaj Gupta Date: Wed, 7 Apr 2021 17:35:29 +0530 Subject: [PATCH] msm: kgsl: Use regulator_is_enabled api for cx gdsc in a640 and a680 In a640 and a680 cx_gdsc will not be disabled from kernel, so use regulator_is_enabled api to get the logical status of cx_gdsc. Change-Id: Ied2a54687d9438610116bf4a96a4843fdbc05c56 Signed-off-by: Pankaj Gupta Signed-off-by: Indira Biruduraju --- drivers/gpu/msm/adreno_a6xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/msm/adreno_a6xx.c b/drivers/gpu/msm/adreno_a6xx.c index c80e8cb98c73..b1d03eec5e37 100644 --- a/drivers/gpu/msm/adreno_a6xx.c +++ b/drivers/gpu/msm/adreno_a6xx.c @@ -285,12 +285,22 @@ bool a6xx_cx_regulator_disable_wait(struct regulator *reg, ktime_t tout = ktime_add_us(ktime_get(), timeout * 1000); unsigned int val; struct adreno_device *adreno_dev = ADRENO_DEVICE(device); + struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev); if (IS_ERR_OR_NULL(reg)) return true; regulator_disable(reg); + /* + * Check logical enable state of CX GDSC using regulator_is_enabled() + * instead of checking physical state by CX_GDSCR register because + * in a640 and a680, CX_GDSCR will not be disabled from kernel. It can + * be turned off by AOP for CX Power collapse. + */ + if (adreno_is_a640(adreno_dev) || adreno_is_a680(adreno_dev)) + return !(regulator_is_enabled(gmu->cx_gdsc)); + for (;;) { if (adreno_is_a619_holi(adreno_dev)) adreno_read_gmu_wrapper(adreno_dev,