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 <gpankaj@codeaurora.org>
Signed-off-by: Indira Biruduraju <ibirudur@codeaurora.org>
This commit is contained in:
Pankaj Gupta 2021-04-07 17:35:29 +05:30
commit 22ef71c22e

View file

@ -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,