mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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 <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user