[SRU][J/allwinner-5.17][PATCH v3 3/4] UBUNTU: SAUCE: PM / devfreq: Add dummy R329/D1 MBUS driver
Emil Renner Berthing
emil.renner.berthing at canonical.com
Mon Jul 11 11:49:50 UTC 2022
From: Samuel Holland <samuel at sholland.org>
BugLink: https://bugs.launchpad.net/bugs/1981074
Signed-off-by: Samuel Holland <samuel at sholland.org>
(cherry-pick from https://github.com/smaeul/linux.git riscv/d1-wip)
Signed-off-by: Emil Renner Berthing <emil.renner.berthing at canonical.com>
---
drivers/devfreq/Kconfig | 6 ++++++
drivers/devfreq/Makefile | 1 +
drivers/devfreq/sun50i-r329-mbus.c | 27 +++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
create mode 100644 drivers/devfreq/sun50i-r329-mbus.c
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 87eb2b837e68..2823d72dae16 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -141,6 +141,12 @@ config ARM_SUN8I_A33_MBUS_DEVFREQ
This adds the DEVFREQ driver for the MBUS controller in some
Allwinner sun8i (A33 through H3) and sun50i (A64 and H5) SoCs.
+config ARM_SUN50I_R329_MBUS_DEVFREQ
+ tristate "Allwinner R329 MBUS DEVFREQ Driver"
+ help
+ This adds the DEVFREQ driver for the MBUS controller in some
+ Allwinner sun20i (D1) and sun50i (R329) SoCs.
+
source "drivers/devfreq/event/Kconfig"
endif # PM_DEVFREQ
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index 0b6be92a25d9..017ce88f6d0b 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o
obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o
obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o
obj-$(CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ) += sun8i-a33-mbus.o
+obj-$(CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ) += sun50i-r329-mbus.o
obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o
# DEVFREQ Event Drivers
diff --git a/drivers/devfreq/sun50i-r329-mbus.c b/drivers/devfreq/sun50i-r329-mbus.c
new file mode 100644
index 000000000000..983a366a1f13
--- /dev/null
+++ b/drivers/devfreq/sun50i-r329-mbus.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-only
+//
+// Copyright (C) 2022 Samuel Holland <samuel at sholland.org>
+//
+
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+static const struct of_device_id sun50i_r329_mbus_of_match[] = {
+ { .compatible = "allwinner,sun20i-d1-mbus" },
+ { .compatible = "allwinner,sun50i-r329-mbus" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, sun50i_r329_mbus_of_match);
+
+static struct platform_driver sun50i_r329_mbus_driver = {
+ .driver = {
+ .name = "sun50i-r329-mbus",
+ .of_match_table = sun50i_r329_mbus_of_match,
+ },
+};
+module_platform_driver(sun50i_r329_mbus_driver);
+
+MODULE_AUTHOR("Samuel Holland <samuel at sholland.org>");
+MODULE_DESCRIPTION("Allwinner R329 MBUS DEVFREQ Driver");
+MODULE_LICENSE("GPL v2");
--
2.36.1
More information about the kernel-team
mailing list