From patchwork Mon Mar 30 05:26:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 46471 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A9DF2214AF for ; Mon, 30 Mar 2015 05:26:56 +0000 (UTC) Received: by pdkb3 with SMTP id b3sf213772986pdk.0 for ; Sun, 29 Mar 2015 22:26:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=DVPMU1YDWkm6ydBIsQM00an6XyppSrIVYnJSjG3ySOQ=; b=GPLU+VTccWdT13NeetLkRrZBXhZbGKqlCxQYFNGxu8/C3dAQsMYW5qyGmi8YuXSlOZ K1W3GXyAAVVEhp3kS+662ExJm/U7ycU0+q3nDkDxuVUuQteOsCXn8aUP648hEKju+CAK bCoowxkDmvnv1MsSIlW+57e7Kux6kNnt5p1LvZ5lpSDyOjsOFaF0IYX4GD3xcYf41xdX w/ar4m4Ug3hxiVU77/B59cAHpGqEJhhk+TYDF505cGA51rk0/jVKFPNuX3KmFS7WcA4h sH4Q8TBjLB80RGdri+4biMLHaomr02s9IRupaCTbcYiBJQuQ/oi36kINl1FpylpXkKv3 TDMA== X-Gm-Message-State: ALoCoQnbIeSOBrDPFm5d+gY4S2HTOW/SyGWfJhqYET0RKjsLOq57GX18fYWafvikbuddm5s9ZrDU X-Received: by 10.70.90.4 with SMTP id bs4mr36208547pdb.7.1427693216035; Sun, 29 Mar 2015 22:26:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.47 with SMTP id a44ls2093374qge.83.gmail; Sun, 29 Mar 2015 22:26:55 -0700 (PDT) X-Received: by 10.229.87.68 with SMTP id v4mr8636702qcl.6.1427693215913; Sun, 29 Mar 2015 22:26:55 -0700 (PDT) Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com. [209.85.192.48]) by mx.google.com with ESMTPS id a7si9410582qgf.104.2015.03.29.22.26.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Mar 2015 22:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.48 as permitted sender) client-ip=209.85.192.48; Received: by qgep97 with SMTP id p97so178727257qge.1 for ; Sun, 29 Mar 2015 22:26:55 -0700 (PDT) X-Received: by 10.55.55.7 with SMTP id e7mr15855271qka.52.1427693215812; Sun, 29 Mar 2015 22:26:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.155.231 with SMTP id vz7csp1208346qdb; Sun, 29 Mar 2015 22:26:55 -0700 (PDT) X-Received: by 10.66.159.167 with SMTP id xd7mr9194858pab.74.1427693214468; Sun, 29 Mar 2015 22:26:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gz5si12682125pbc.124.2015.03.29.22.26.53; Sun, 29 Mar 2015 22:26:54 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbbC3F0w (ORCPT + 11 others); Mon, 30 Mar 2015 01:26:52 -0400 Received: from mail-yh0-f51.google.com ([209.85.213.51]:33953 "EHLO mail-yh0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbbC3F0w (ORCPT ); Mon, 30 Mar 2015 01:26:52 -0400 Received: by yhch68 with SMTP id h68so54587871yhc.1 for ; Sun, 29 Mar 2015 22:26:51 -0700 (PDT) X-Received: by 10.170.194.2 with SMTP id l2mr22045989yke.17.1427693211550; Sun, 29 Mar 2015 22:26:51 -0700 (PDT) Received: from localhost.localdomain ([104.207.83.1]) by mx.google.com with ESMTPSA id c14sm9853536yho.44.2015.03.29.22.26.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Mar 2015 22:26:50 -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 Cc: Leo Yan Subject: [PATCH v3] cpufreq: hisilicon: add acpu driver Date: Mon, 30 Mar 2015 13:26:37 +0800 Message-Id: <1427693197-12290-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leo.yan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 52 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..026d5b2 --- /dev/null +++ b/drivers/cpufreq/hisi-acpu-cpufreq.c @@ -0,0 +1,42 @@ +/* + * 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 *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 "); +MODULE_DESCRIPTION("Hisilicon acpu cpufreq driver"); +MODULE_LICENSE("GPL v2");