From: Finley Xiao Date: Mon, 28 Nov 2016 11:40:09 +0000 (+0800) Subject: MALI: midgard: support sharing regulator with other devices X-Git-Tag: firefly_0821_release~1205 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85b4e1dffa2e7a0bbd092d294043f19f82417d74;p=firefly-linux-kernel-4.4.55.git MALI: midgard: support sharing regulator with other devices If the regulator is shared between several devices then the lowest request voltage that meets the system constraints will be used. Change-Id: I7dda43b24c7e19098db65b51ae0c4386b46ee0b7 Signed-off-by: Finley Xiao --- diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c index fd3c1f58a7d4..083810f853ae 100644 --- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c +++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c @@ -76,7 +76,7 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (kbdev->current_voltage == voltage) return 0; - err = regulator_set_voltage(kbdev->regulator, voltage, voltage); + err = regulator_set_voltage(kbdev->regulator, voltage, INT_MAX); if (err) { dev_err(dev, "Failed to set voltage (%d)\n", err); return err; @@ -89,7 +89,7 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (kbdev->regulator && kbdev->current_voltage != voltage && old_freq < freq) { - err = regulator_set_voltage(kbdev->regulator, voltage, voltage); + err = regulator_set_voltage(kbdev->regulator, voltage, INT_MAX); if (err) { dev_err(dev, "Failed to increase voltage (%d)\n", err); return err; @@ -113,7 +113,7 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (kbdev->regulator && kbdev->current_voltage != voltage && old_freq > freq) { - err = regulator_set_voltage(kbdev->regulator, voltage, voltage); + err = regulator_set_voltage(kbdev->regulator, voltage, INT_MAX); if (err) { dev_err(dev, "Failed to decrease voltage (%d)\n", err); return err;