From patchwork Sat Jun 14 16:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 4353161 Return-Path: X-Original-To: patchwork-linux-arm@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 B38FABEEAA for ; Sat, 14 Jun 2014 16:34:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBD2120211 for ; Sat, 14 Jun 2014 16:34:36 +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 D9829201FB for ; Sat, 14 Jun 2014 16:34:35 +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 1WvqsO-0002c8-Mj; Sat, 14 Jun 2014 16:32:20 +0000 Received: from perceval.ideasonboard.com ([95.142.166.194]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvqnI-0004jw-VM for linux-arm-kernel@lists.infradead.org; Sat, 14 Jun 2014 16:27:06 +0000 Received: from avalon.ideasonboard.com (unknown [91.178.211.37]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E6C5363F3; Sat, 14 Jun 2014 18:22:37 +0200 (CEST) From: Laurent Pinchart To: linux-sh@vger.kernel.org Subject: [PATCH v3 19/19] ARM: shmobile: genmai-reference: Enable MTU2 in device tree Date: Sat, 14 Jun 2014 18:23:41 +0200 Message-Id: <1402763021-4067-20-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1402763021-4067-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1402763021-4067-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140614_092705_440174_9FE33B60 X-CRM114-Status: GOOD ( 13.01 ) X-Spam-Score: -0.7 (/) Cc: Thomas Gleixner , Daniel Lezcano , linux-arm-kernel@lists.infradead.org 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=-2.5 required=5.0 tests=BAYES_00,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 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 --- arch/arm/boot/dts/r7s72100-genmai.dts | 4 ++++ arch/arm/mach-shmobile/board-genmai-reference.c | 16 ---------------- arch/arm/mach-shmobile/board-genmai.c | 14 +++++++++++++- arch/arm/mach-shmobile/include/mach/r7s72100.h | 1 - arch/arm/mach-shmobile/setup-r7s72100.c | 21 --------------------- 5 files changed, 17 insertions(+), 39 deletions(-) diff --git a/arch/arm/boot/dts/r7s72100-genmai.dts b/arch/arm/boot/dts/r7s72100-genmai.dts index 56849b5..a352734 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 627539e..a80df03 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c @@ -26,21 +26,6 @@ #include #include -/* - * 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", NULL, @@ -48,6 +33,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 11f3cd1..bd0785f 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 #include @@ -124,10 +125,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/include/mach/r7s72100.h b/arch/arm/mach-shmobile/include/mach/r7s72100.h index efb723c..321ae4e 100644 --- a/arch/arm/mach-shmobile/include/mach/r7s72100.h +++ b/arch/arm/mach-shmobile/include/mach/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 427ae1c..a55c13b 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c @@ -18,31 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include -#include #include -#include -#include #include -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 = { "renesas,r7s72100",