From patchwork Thu May 29 07:49:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaku Inami X-Patchwork-Id: 4262651 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26CD99F333 for ; Thu, 29 May 2014 07:53:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4127920256 for ; Thu, 29 May 2014 07:53:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 570932034A for ; Thu, 29 May 2014 07:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751660AbaE2HxU (ORCPT ); Thu, 29 May 2014 03:53:20 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:31923 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751206AbaE2HxS (ORCPT ); Thu, 29 May 2014 03:53:18 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 29 May 2014 16:53:17 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 6FC8643ACD; Thu, 29 May 2014 16:53:17 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 531FD280A6; Thu, 29 May 2014 16:53:17 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 4C484280A0; Thu, 29 May 2014 16:53:17 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id SAN15873; Thu, 29 May 2014 16:53:17 +0900 X-IronPort-AV: E=Sophos;i="4.98,932,1392130800"; d="scan'208";a="160874291" Received: from mail-hk1lp0119.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.119]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES128-SHA; 29 May 2014 16:53:16 +0900 Received: from [10.164.207.238] (211.11.155.149) by HKXPR06MB373.apcprd06.prod.outlook.com (10.141.136.20) with Microsoft SMTP Server (TLS) id 15.0.954.9; Thu, 29 May 2014 07:53:15 +0000 Message-ID: <5386E677.60801@bp.renesas.com> Date: Thu, 29 May 2014 16:49:11 +0900 From: Gaku Inami User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: , Magnus Damm , Simon Horman Subject: [PATCH 4/7] ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile X-Originating-IP: [211.11.155.149] X-ClientProxiedBy: SIXPR04CA018.apcprd04.prod.outlook.com (10.141.119.38) To HKXPR06MB373.apcprd06.prod.outlook.com (10.141.136.20) X-Forefront-PRVS: 022649CC2C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(6009001)(6049001)(428001)(22564002)(189002)(199002)(102836001)(19580395003)(21056001)(83322001)(19580405001)(64126003)(42186004)(74662001)(74502001)(101416001)(46102001)(77982001)(50466002)(81342001)(79102001)(50986999)(54356999)(81542001)(31966008)(76482001)(99396002)(47776003)(64706001)(86362001)(20776003)(85852003)(83072002)(87976001)(83506001)(33656002)(4396001)(23736002)(92726001)(65806001)(92566001)(80022001)(65956001)(65816999)(66066001); DIR:OUT; SFP:; SCL:1; SRVR:HKXPR06MB373; H:[10.164.207.238]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:0; LANG:en; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=gaku.inami.xw@bp.renesas.com; X-OriginatorOrg: bp.renesas.com Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 I add a new file(cpufreq.c) for the following reasons. - Registration of platform_device must be unified in SH-Mobile. - We can't create a node of cpufreq drivers into device tree. (Because cpufreq driver is virtual device.) This time, this patch only supports r8a7790/r8a7791. Signed-off-by: Gaku Inami --- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/cpufreq.c | 21 +++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 arch/arm/mach-shmobile/cpufreq.c diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 0d6a04c..d4fd9a9 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -48,6 +48,7 @@ obj-$(CONFIG_ARCH_SH7372) += entry-intc.o # PM objects obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o +obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o diff --git a/arch/arm/mach-shmobile/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c new file mode 100644 index 0000000..254a920 --- /dev/null +++ b/arch/arm/mach-shmobile/cpufreq.c @@ -0,0 +1,21 @@ +/* + * CPUFreq support code for SH-Mobile ARM + * + * Copyright (C) 2014 Gaku Inami + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include + +int __init shmobile_cpufreq_init(void) +{ + if (!(of_machine_is_compatible("renesas,r8a7790")) || + !(of_machine_is_compatible("renesas,r8a7791"))) + platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); + + return 0; +} diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index f7a360e..921a18e 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -45,12 +45,19 @@ int shmobile_cpuidle_init(void); static inline int shmobile_cpuidle_init(void) { return 0; } #endif +#ifdef CONFIG_CPU_FREQ +int shmobile_cpufreq_init(void); +#else +static inline int shmobile_cpufreq_init(void) { return 0; } +#endif + extern void __iomem *shmobile_scu_base; static inline void __init shmobile_init_late(void) { shmobile_suspend_init(); shmobile_cpuidle_init(); + shmobile_cpufreq_init(); } #endif /* __ARCH_MACH_COMMON_H */