Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: hisilicon: add acpu driver

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>

authored by

Leo Yan and committed by
Rafael J. Wysocki
5acb972f 09a972d1

+52
+9
drivers/cpufreq/Kconfig.arm
··· 108 108 109 109 If in doubt, say N. 110 110 111 + config ARM_HISI_ACPU_CPUFREQ 112 + tristate "Hisilicon ACPU CPUfreq driver" 113 + depends on ARCH_HISI && CPUFREQ_DT 114 + select PM_OPP 115 + help 116 + This enables the hisilicon ACPU CPUfreq driver. 117 + 118 + If in doubt, say N. 119 + 111 120 config ARM_IMX6Q_CPUFREQ 112 121 tristate "Freescale i.MX6 cpufreq support" 113 122 depends on ARCH_MXC
+1
drivers/cpufreq/Makefile
··· 59 59 arm-exynos-cpufreq-$(CONFIG_ARM_EXYNOS5250_CPUFREQ) += exynos5250-cpufreq.o 60 60 obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o 61 61 obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o 62 + obj-$(CONFIG_ARM_HISI_ACPU_CPUFREQ) += hisi-acpu-cpufreq.o 62 63 obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o 63 64 obj-$(CONFIG_ARM_INTEGRATOR) += integrator-cpufreq.o 64 65 obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o
+42
drivers/cpufreq/hisi-acpu-cpufreq.c
··· 1 + /* 2 + * Hisilicon Platforms Using ACPU CPUFreq Support 3 + * 4 + * Copyright (c) 2015 Hisilicon Limited. 5 + * Copyright (c) 2015 Linaro Limited. 6 + * 7 + * Leo Yan <leo.yan@linaro.org> 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + * 13 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 14 + * kind, whether express or implied; without even the implied warranty 15 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + */ 18 + 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 21 + #include <linux/err.h> 22 + #include <linux/init.h> 23 + #include <linux/kernel.h> 24 + #include <linux/module.h> 25 + #include <linux/of.h> 26 + #include <linux/platform_device.h> 27 + 28 + static int __init hisi_acpu_cpufreq_driver_init(void) 29 + { 30 + struct platform_device *pdev; 31 + 32 + if (!of_machine_is_compatible("hisilicon,hi6220")) 33 + return -ENODEV; 34 + 35 + pdev = platform_device_register_simple("cpufreq-dt", -1, NULL, 0); 36 + return PTR_ERR_OR_ZERO(pdev); 37 + } 38 + module_init(hisi_acpu_cpufreq_driver_init); 39 + 40 + MODULE_AUTHOR("Leo Yan <leo.yan@linaro.org>"); 41 + MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver"); 42 + MODULE_LICENSE("GPL v2");