From 21d227bdc2a5f16cd9232fa103030797a3192004 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Thu, 7 Sep 2017 12:40:56 +0800 Subject: [PATCH] MALI: utgard: 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: I68536a8e9cc5a78c21b55564a2ed540b9c184cb8 Signed-off-by: Finley Xiao --- drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c b/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c index 92a5707d55d7..239720043d99 100644 --- a/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c +++ b/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c @@ -67,7 +67,7 @@ mali_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (mdev->current_voltage == voltage) return 0; - err = regulator_set_voltage(mdev->regulator, voltage, voltage); + err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX); if (err) { dev_err(dev, "Failed to set voltage (%d)\n", err); return err; @@ -80,7 +80,7 @@ mali_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (mdev->regulator && mdev->current_voltage != voltage && old_freq < freq) { - err = regulator_set_voltage(mdev->regulator, voltage, voltage); + err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX); if (err) { MALI_PRINT_ERROR(("Failed to increase voltage (%d)\n", err)); return err; @@ -99,7 +99,7 @@ mali_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) #ifdef CONFIG_REGULATOR if (mdev->regulator && mdev->current_voltage != voltage && old_freq > freq) { - err = regulator_set_voltage(mdev->regulator, voltage, voltage); + err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX); if (err) { MALI_PRINT_ERROR(("Failed to decrease voltage (%d)\n", err)); return err;