From 85b4e1dffa2e7a0bbd092d294043f19f82417d74 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Mon, 28 Nov 2016 19:40:09 +0800 Subject: [PATCH] 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 --- drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.34.1