1
0
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
Lakka-rk322x/projects/Rockchip/devices/RK322x/patches/linux/default/linux-9003-fix-dmc-suspend-ddr2.patch
Moretz 698ae89d26 upd
upd
2024-11-08 17:39:59 -03:00

75 lines
2.1 KiB
Diff

diff -ruPN linux-5.10.76/drivers/devfreq/rk3228_dmc.c linux-new/drivers/devfreq/rk3228_dmc.c
--- linux-5.10.76/drivers/devfreq/rk3228_dmc.c 2022-02-17 11:10:14.196295398 +0100
+++ linux-new/drivers/devfreq/rk3228_dmc.c 2022-02-17 11:13:37.163303895 +0100
@@ -442,17 +442,23 @@
struct rk3228_dmc *rdev = dev_get_drvdata(dev);
int ret = 0;
- ret = devfreq_event_disable_edev(rdev->edev);
- if (ret < 0) {
- dev_err(dev, "failed to disable the devfreq-event devices\n");
- return ret;
- }
-
- ret = devfreq_suspend_device(rdev->devfreq.devfreq);
- if (ret < 0) {
- dev_err(dev, "failed to suspend the devfreq devices\n");
- return ret;
- }
+ if (rdev->dram_type == DDR3 ||
+ rdev->dram_type == LPDDR3 ||
+ rdev->dram_type == DDR4 ||
+ rdev->dram_type == LPDDR4) {
+
+ ret = devfreq_event_disable_edev(rdev->edev);
+ if (ret < 0) {
+ dev_err(dev, "failed to disable the devfreq-event devices\n");
+ return ret;
+ }
+
+ ret = devfreq_suspend_device(rdev->devfreq.devfreq);
+ if (ret < 0) {
+ dev_err(dev, "failed to suspend the devfreq devices\n");
+ return ret;
+ }
+ }
return 0;
}
@@ -462,17 +468,24 @@
struct rk3228_dmc *rdev = dev_get_drvdata(dev);
int ret = 0;
- ret = devfreq_event_enable_edev(rdev->edev);
- if (ret < 0) {
- dev_err(dev, "failed to enable the devfreq-event devices\n");
- return ret;
- }
-
- ret = devfreq_resume_device(rdev->devfreq.devfreq);
- if (ret < 0) {
- dev_err(dev, "failed to resume the devfreq devices\n");
- return ret;
- }
+ if (rdev->dram_type == DDR3 ||
+ rdev->dram_type == LPDDR3 ||
+ rdev->dram_type == DDR4 ||
+ rdev->dram_type == LPDDR4) {
+
+ ret = devfreq_event_enable_edev(rdev->edev);
+ if (ret < 0) {
+ dev_err(dev, "failed to enable the devfreq-event devices\n");
+ return ret;
+ }
+
+ ret = devfreq_resume_device(rdev->devfreq.devfreq);
+ if (ret < 0) {
+ dev_err(dev, "failed to resume the devfreq devices\n");
+ return ret;
+ }
+ }
+
return ret;
}