Merge "msm: kgsl: 'qcom,kgsl-3d0' device does not need to get regulators"

This commit is contained in:
qctecmdr 2020-06-03 17:08:18 -07:00 • committed by Gerrit - the friendly Code Review server
commit 92fe4104ee
3 changed files with 12 additions and 6 deletions

View file

@ -1783,11 +1783,11 @@ static bool regulators_left_on(struct kgsl_device *device)
if (gmu_core_gpmu_isenabled(device))
return false;
if (!IS_ERR(pwr->cx_gdsc))
if (!IS_ERR_OR_NULL(pwr->cx_gdsc))
if (regulator_is_enabled(pwr->cx_gdsc))
return true;
if (!IS_ERR(pwr->gx_gdsc))
if (!IS_ERR_OR_NULL(pwr->gx_gdsc))
return regulator_is_enabled(pwr->gx_gdsc);
return false;

View file

@ -1305,7 +1305,7 @@ static int enable_regulator(struct device *dev, struct regulator *regulator,
{
int ret;
if (IS_ERR(regulator))
if (IS_ERR_OR_NULL(regulator))
return 0;
ret = regulator_enable(regulator);
@ -1547,8 +1547,11 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
_isense_clk_set_rate(pwr, pwr->num_pwrlevels - 1);
pwr->cx_gdsc = devm_regulator_get(&pdev->dev, "vddcx");
pwr->gx_gdsc = devm_regulator_get(&pdev->dev, "vdd");
if (of_property_read_bool(pdev->dev.of_node, "vddcx-supply"))
pwr->cx_gdsc = devm_regulator_get(&pdev->dev, "vddcx");
if (of_property_read_bool(pdev->dev.of_node, "vdd-supply"))
pwr->gx_gdsc = devm_regulator_get(&pdev->dev, "vdd");
pwr->power_flags = 0;

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
@ -17,6 +17,9 @@ bool kgsl_regulator_disable_wait(struct regulator *reg, u32 timeout)
{
ktime_t tout = ktime_add_us(ktime_get(), timeout * 1000);
if (IS_ERR_OR_NULL(reg))
return true;
regulator_disable(reg);
for (;;) {