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: 46363 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 556A421585 for ; Thu, 26 Mar 2015 11:48:27 +0000 (UTC) Received: by wizj7 with SMTP id j7sf5071802wiz.0 for ; Thu, 26 Mar 2015 04:48:26 -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=dHaL9CN9JEKwfShhJQcy4e7dzOpMVSMVJETK5w/DY1Q=; b=Qx8zhgjOthA0J9jXE5yhNZFymKz28HnG+0lsF+HPEg+SFzdY6gKG8G0llK233XqyCm rfSpvGLCfXNtdeWY4I76KY3VLhoruH3qD/jLH2gDuMWUwGtdNt98M090A0OxySDSbO5n kX6GuObwKHT+pjKfOJMg13BRSZEMyfRQSf94tKciOSs+1UhGh5kQ4fgQi35ZsCbr+Rmo anPb+0jdaaiid0HC4doGe/Nwkz7pdbqAdm/83GOl0rYbyPfd77UN4v4pJ5YpWpmeX/Xe jxg/e5BNq+JxXzVd9J5Zka3mVNEvKu+/CnKUt3FeMxnGj1JkOpnzBWjbGgFw9k2j4Hkm XVaA== X-Gm-Message-State: ALoCoQnODMbh3As1LD84Gpx83lsjSDGAPR+36Bl43EKkjxbBcA/9lfFCthljuFnQg4fYhnyOg4RZ X-Received: by 10.180.80.132 with SMTP id r4mr5467682wix.4.1427370506587; Thu, 26 Mar 2015 04:48:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.50 with SMTP id bd18ls247503lab.108.gmail; Thu, 26 Mar 2015 04:48:26 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr12627094laf.117.1427370506430; Thu, 26 Mar 2015 04:48:26 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id rh2si4359981lbb.141.2015.03.26.04.48.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 04:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcmq2 with SMTP id mq2so38831675lbc.0 for ; Thu, 26 Mar 2015 04:48:26 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr12968002lau.88.1427370506346; Thu, 26 Mar 2015 04:48:26 -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.112.57.201 with SMTP id k9csp547194lbq; Thu, 26 Mar 2015 04:48:25 -0700 (PDT) X-Received: by 10.70.138.42 with SMTP id qn10mr25620054pdb.157.1427370503976; Thu, 26 Mar 2015 04:48:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qh9si1037920pab.98.2015.03.26.04.48.22; Thu, 26 Mar 2015 04:48:23 -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 S1752476AbbCZLsW (ORCPT + 11 others); Thu, 26 Mar 2015 07:48:22 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:33833 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbbCZLsV (ORCPT ); Thu, 26 Mar 2015 07:48:21 -0400 Received: by pdbni2 with SMTP id ni2so60474869pdb.1 for ; Thu, 26 Mar 2015 04:48:20 -0700 (PDT) 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 Cc: Leo Yan 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 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.217.175 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 | 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");