From 23fa18eaa71266feff7ba8d83022d9e1cc83c65a Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 07:42:03 +0000
Subject: [PATCH] disable pwm7
---
kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c b/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c
index 260c2a8..7438cb4 100644
--- a/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c
+++ b/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c
@@ -12,6 +12,7 @@
#include "mali_kernel_common.h"
#include <linux/clk.h>
+#include <linux/clk-provider.h>
#include <linux/devfreq.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/driver.h>
@@ -40,7 +41,7 @@
#include <soc/rockchip/rockchip_system_monitor.h>
static struct monitor_dev_profile mali_mdevp = {
- .type = MONITOR_TPYE_DEV,
+ .type = MONITOR_TYPE_DEV,
.low_temp_adjust = rockchip_monitor_dev_low_temp_adjust,
.high_temp_adjust = rockchip_monitor_dev_high_temp_adjust,
};
@@ -87,13 +88,17 @@
return 0;
}
+ err = clk_bulk_enable(mdev->num_clks, mdev->clks);
+ if (err)
+ return err;
+
#ifdef CONFIG_REGULATOR
if (mdev->regulator && mdev->current_voltage != voltage &&
old_freq < freq) {
err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX);
if (err) {
MALI_PRINT_ERROR(("Failed to increase voltage (%d)\n", err));
- return err;
+ goto err;
}
}
#endif
@@ -101,8 +106,9 @@
err = clk_set_rate(mdev->clock, freq);
if (err) {
MALI_PRINT_ERROR(("Failed to set clock %lu (target %lu)\n", freq, *target_freq));
- return err;
+ goto err;
}
+
*target_freq = freq;
mdev->current_freq = freq;
if (mdev->devfreq)
@@ -114,7 +120,7 @@
err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX);
if (err) {
MALI_PRINT_ERROR(("Failed to decrease voltage (%d)\n", err));
- return err;
+ goto err;
}
}
#endif
@@ -122,6 +128,8 @@
mdev->current_voltage = voltage;
mali_pm_reset_dvfs_utilisation(mdev);
+err:
+ clk_bulk_disable(mdev->num_clks, mdev->clks);
return err;
}
--
Gitblit v1.6.2