From patchwork Thu Mar 26 11:48:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 6098131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 356759F2A9 for ; Thu, 26 Mar 2015 11:54:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4130B203B7 for ; Thu, 26 Mar 2015 11:54:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B67F203F1 for ; Thu, 26 Mar 2015 11:54:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yb6K3-00026T-6d; Thu, 26 Mar 2015 11:51:39 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yb6HE-0007go-AV for linux-arm-kernel@lists.infradead.org; Thu, 26 Mar 2015 11:48:45 +0000 Received: by pdbcz9 with SMTP id cz9so60389751pdb.3 for ; Thu, 26 Mar 2015 04:48:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dzZTpvjJuEbaeuO4vRaeDvuSSeGWFMyxa0Erv7YbFa8=; b=RtcDQKsx0ApidyNavgNVj064nHcQePZWKwMlmcSDkEMIq+Tj6p08J4VpmRH8O0FeA/ uSSbbhzUUwTUvHAYFTfWY4vTjlNZWS74gQlrMlGM6ADZygq83dronIH/LsdKUARzcKHg 7nx0SoaWLWPcYoa+kpghMI2Wsu5zA5fEmCEDk4UUnqZz93I2RuXOrdeqnVkfpYFueUUc WLNln/UXTnNnq9dJ4WKUEZPRAXt9c4sWJg5tEaWinYA9rT1WMAwUlUmFvt2N2M2at9gG zAxiv2Y3Z1Og2MTVjCIi2V94AVwVtVYiEzZoRpbTNY7ROYfSmzHH5+Nrx6FwzTl79D+i p3zA== X-Gm-Message-State: ALoCoQmpy50U9YsD665QN5ok8IIIJHahtGzf3QbY3aInWMIAjGR0hNM2d4zui2oXorA7PXn432bS X-Received: by 10.66.55.104 with SMTP id r8mr25270442pap.75.1427370500882; Thu, 26 Mar 2015 04:48:20 -0700 (PDT) Received: from localhost.localdomain (119.81.160.152-static.reverse.softlayer.com. [119.81.160.152]) by mx.google.com with ESMTPSA id ey10sm5389547pab.47.2015.03.26.04.48.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 04:48:20 -0700 (PDT) From: Leo Yan To: "Rafael J . Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dan Zhao , zhenwei.wang@hisilicon.com, mohaoju@hisilicon.com, Haojian Zhuang , Wei Xu Subject: [PATCH v2] cpufreq: hisilicon: add acpu driver Date: Thu, 26 Mar 2015 19:48:06 +0800 Message-Id: <1427370486-14823-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150326_044844_424407_6393DAB7 X-CRM114-Status: GOOD ( 13.25 ) X-Spam-Score: -0.7 (/) Cc: Leo Yan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Viresh Kumar --- drivers/cpufreq/Kconfig.arm | 9 ++++++++ drivers/cpufreq/Makefile | 1 + drivers/cpufreq/hisi-acpu-cpufreq.c | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 drivers/cpufreq/hisi-acpu-cpufreq.c diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 1b06fc4..4f3dbc8 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -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 diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 82a1821..6b7a3f0 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -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 index 0000000..2c7a705 --- /dev/null +++ b/drivers/cpufreq/hisi-acpu-cpufreq.c @@ -0,0 +1,43 @@ +/* + * Hisilicon Platforms Using ACPU CPUFreq Support + * + * Copyright (c) 2015 Hisilicon Limited. + * Copyright (c) 2015 Linaro Limited. + * + * Leo Yan + * + * 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 +#include +#include +#include +#include +#include + +static int __init hisi_acpu_cpufreq_driver_init(void) +{ + struct platform_device_info devinfo = { .name = "cpufreq-dt", }; + struct platform_device *pdev; + + if (!of_machine_is_compatible("hisilicon,hi6220")) + return -ENODEV; + + pdev = platform_device_register_full(&devinfo); + return PTR_ERR_OR_ZERO(pdev); +} +module_init(hisi_acpu_cpufreq_driver_init); + +MODULE_AUTHOR("Leo Yan "); +MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver"); +MODULE_LICENSE("GPL v2");