From patchwork Thu Aug 28 07:06:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 4796411 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64277C0338 for ; Thu, 28 Aug 2014 07:56:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DB6D20179 for ; Thu, 28 Aug 2014 07:56:48 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (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 79DE1200DF for ; Thu, 28 Aug 2014 07:56:47 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 46C7B10AD; Thu, 28 Aug 2014 07:29:31 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 31E291015 for ; Thu, 28 Aug 2014 07:29:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 4FC0D20225 for ; Thu, 28 Aug 2014 07:29:29 +0000 (UTC) Received: from ayumi.isobedori.kobe.vergenet.net (p4222-ipbfp1605kobeminato.hyogo.ocn.ne.jp [114.154.95.222]) by kirsty.vergenet.net (Postfix) with ESMTP id D8E772674BE; Thu, 28 Aug 2014 17:09:26 +1000 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 5CECBEDE8E2; Thu, 28 Aug 2014 16:09:25 +0900 (JST) From: Simon Horman To: ltsi-dev@lists.linuxfoundation.org Date: Thu, 28 Aug 2014 16:06:54 +0900 Message-Id: <1409209620-24487-889-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> References: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Cc: Magnus Damm Subject: [LTSI-dev] [PATCH LTSI-3.14 888/894] ARM: shmobile: genmai-reference: Enable MTU2 in device tree X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Laurent Pinchart No more device needs to be added from platform code when booting the reference platform, move MTU2 registration from setup-r7s72100.c to board-genmai.c and remove the now empty r7s72100_add_dt_devices() function. As the genmai_add_standard_devices() function is now identical to the default init_machine implementation, remove it as well. Signed-off-by: Laurent Pinchart Acked-by: Wolfram Sang Signed-off-by: Simon Horman (cherry picked from commit 9394af4314554d15762585a3464cefaa2e6d0420) Signed-off-by: Simon Horman --- arch/arm/boot/dts/r7s72100-genmai.dts | 4 ++++ arch/arm/mach-shmobile/board-genmai-reference.c | 20 -------------------- arch/arm/mach-shmobile/board-genmai.c | 14 +++++++++++++- arch/arm/mach-shmobile/r7s72100.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 21 --------------------- 5 files changed, 17 insertions(+), 43 deletions(-) diff --git a/arch/arm/boot/dts/r7s72100-genmai.dts b/arch/arm/boot/dts/r7s72100-genmai.dts index 2070546..a3ed23c 100644 --- a/arch/arm/boot/dts/r7s72100-genmai.dts +++ b/arch/arm/boot/dts/r7s72100-genmai.dts @@ -43,6 +43,10 @@ clock-frequency = <48000000>; }; +&mtu2 { + status = "ok"; +}; + &i2c2 { status = "okay"; clock-frequency = <400000>; diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c index e5448f7..bc52677 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c @@ -19,29 +19,10 @@ */ #include -#include -#include #include -#include "clock.h" #include "common.h" -#include "r7s72100.h" - -/* - * This is a really crude hack to provide clkdev support to platform - * devices until they get moved to DT. - */ -static const struct clk_name clk_names[] = { - { "mtu2", "fck", "sh-mtu2" }, -}; - -static void __init genmai_add_standard_devices(void) -{ - shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), true); - r7s72100_add_dt_devices(); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); -} static const char * const genmai_boards_compat_dt[] __initconst = { "renesas,genmai", @@ -50,6 +31,5 @@ static const char * const genmai_boards_compat_dt[] __initconst = { DT_MACHINE_START(GENMAI_DT, "genmai") .init_early = shmobile_init_delay, - .init_machine = genmai_add_standard_devices, .dt_compat = genmai_boards_compat_dt, MACHINE_END diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index e2a3ba4..b5dee53 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -126,10 +127,21 @@ R7S72100_SCIF(7, 0xe800a800, gic_iid(249)); &scif##index##_platform_data, \ sizeof(scif##index##_platform_data)) +static struct resource mtu2_resources[] __initdata = { + DEFINE_RES_MEM(0xfcff0000, 0x400), + DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"), +}; + +#define r7s72100_register_mtu2() \ + platform_device_register_resndata(&platform_bus, "sh-mtu2", \ + -1, mtu2_resources, \ + ARRAY_SIZE(mtu2_resources), \ + NULL, 0) + static void __init genmai_add_standard_devices(void) { r7s72100_clock_init(); - r7s72100_add_dt_devices(); + r7s72100_register_mtu2(); platform_device_register_full(ðer_info); diff --git a/arch/arm/mach-shmobile/r7s72100.h b/arch/arm/mach-shmobile/r7s72100.h index efb723c..321ae4e 100644 --- a/arch/arm/mach-shmobile/r7s72100.h +++ b/arch/arm/mach-shmobile/r7s72100.h @@ -1,7 +1,6 @@ #ifndef __ASM_R7S72100_H__ #define __ASM_R7S72100_H__ -void r7s72100_add_dt_devices(void); void r7s72100_clock_init(void); #endif /* __ASM_R7S72100_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index 4a98b23..d898cef 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c @@ -18,32 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include -#include -#include #include #include "common.h" -#include "irqs.h" -#include "r7s72100.h" - -static struct resource mtu2_resources[] __initdata = { - DEFINE_RES_MEM(0xfcff0000, 0x400), - DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"), -}; - -#define r7s72100_register_mtu2() \ - platform_device_register_resndata(&platform_bus, "sh-mtu2", \ - -1, mtu2_resources, \ - ARRAY_SIZE(mtu2_resources), \ - NULL, 0) - -void __init r7s72100_add_dt_devices(void) -{ - r7s72100_register_mtu2(); -} #ifdef CONFIG_USE_OF static const char *r7s72100_boards_compat_dt[] __initdata = {