cpufreq: hisilicon: add acpu driver
authorLeo Yan <leo.yan@linaro.org>
Mon, 30 Mar 2015 05:26:37 +0000 (13:26 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Apr 2015 00:24:54 +0000 (02:24 +0200)
Add acpu driver for hisilicon SoC, acpu is application processor
subsystem. Currently the acpu has the coupled clock domain for two
clusters, so this driver will directly use cpufreq-dt driver as
backend.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/Kconfig.arm
drivers/cpufreq/Makefile
drivers/cpufreq/hisi-acpu-cpufreq.c [new file with mode: 0644]

index 1b06fc4640e23c2840cda6011d7c061eedd64a49..4f3dbc8cf7292773d9fcc442edfc8ef695a4a432 100644 (file)
@@ -108,6 +108,15 @@ config ARM_HIGHBANK_CPUFREQ
 
          If in doubt, say N.
 
+config ARM_HISI_ACPU_CPUFREQ
+       tristate "Hisilicon ACPU CPUfreq driver"
+       depends on ARCH_HISI && CPUFREQ_DT
+       select PM_OPP
+       help
+         This enables the hisilicon ACPU CPUfreq driver.
+
+         If in doubt, say N.
+
 config ARM_IMX6Q_CPUFREQ
        tristate "Freescale i.MX6 cpufreq support"
        depends on ARCH_MXC
index 26df0ad00e32de3e471bf330530a4e83e6c9492f..cdce92ae2e8b7fdb81e4d25e3ab03ced14e63aac 100644 (file)
@@ -59,6 +59,7 @@ arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ)   += exynos4x12-cpufreq.o
 arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS5250_CPUFREQ)    += exynos5250-cpufreq.o
 obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ)   += exynos5440-cpufreq.o
 obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ)     += highbank-cpufreq.o
+obj-$(CONFIG_ARM_HISI_ACPU_CPUFREQ)    += hisi-acpu-cpufreq.o
 obj-$(CONFIG_ARM_IMX6Q_CPUFREQ)                += imx6q-cpufreq.o
 obj-$(CONFIG_ARM_INTEGRATOR)           += integrator-cpufreq.o
 obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ)     += kirkwood-cpufreq.o
diff --git a/drivers/cpufreq/hisi-acpu-cpufreq.c b/drivers/cpufreq/hisi-acpu-cpufreq.c
new file mode 100644 (file)
index 0000000..026d5b2
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Hisilicon Platforms Using ACPU CPUFreq Support
+ *
+ * Copyright (c) 2015 Hisilicon Limited.
+ * Copyright (c) 2015 Linaro Limited.
+ *
+ * Leo Yan <leo.yan@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+static int __init hisi_acpu_cpufreq_driver_init(void)
+{
+       struct platform_device *pdev;
+
+       if (!of_machine_is_compatible("hisilicon,hi6220"))
+               return -ENODEV;
+
+       pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
+       return PTR_ERR_OR_ZERO(pdev);
+}
+module_init(hisi_acpu_cpufreq_driver_init);
+
+MODULE_AUTHOR("Leo Yan <leo.yan@linaro.org>");
+MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver");
+MODULE_LICENSE("GPL v2");