From patchwork Thu Jul 4 20:40:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2823931 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 BBCC19F3C3 for ; Thu, 4 Jul 2013 20:40:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD30820153 for ; Thu, 4 Jul 2013 20:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CECA42014B for ; Thu, 4 Jul 2013 20:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756921Ab3GDUkm (ORCPT ); Thu, 4 Jul 2013 16:40:42 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:58953 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756759Ab3GDUkl (ORCPT ); Thu, 4 Jul 2013 16:40:41 -0400 Received: from axis700.grange (dslb-088-076-026-213.pools.arcor-ip.net [88.76.26.213]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MJWCh-1UxJIp2SF9-0032rk; Thu, 04 Jul 2013 22:40:40 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 3BEA640BB3; Thu, 4 Jul 2013 22:40:39 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UuqKV-0005c3-02; Thu, 04 Jul 2013 22:40:39 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Simon Horman , Magnus Damm , Guennadi Liakhovetski Subject: [PATCH 1/2] ARM: shmobile: r8a73a4: reorganise device instantiation in DT case Date: Thu, 4 Jul 2013 22:40:37 +0200 Message-Id: <1372970438-21549-2-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1372970438-21549-1-git-send-email-g.liakhovetski@gmx.de> References: <1372970438-21549-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:4bmybPSpkfYzwHZ7XWmcIIPl8X4Zgs5Cxq77t3p2wtU LJFfvzToxJRfPPRsgmnRr0/X/si0LE2VhlqL8t2B6YGJJdbcgG KvmN3Okipv5DVmY1a1a5j79k1oP348WGzypiWfIRLhAiIP6+Gt RtUn5vifMv4wT7+2i3zp6mdTw38s4xlfbYzAR4P32m2yvsNUBn prg/VO+C8hffqet4aheXz6JwqqsV9MZh8fYcVNy7y05IkyJUh9 JD19Tp3x79xL3s9eYPpesxst2SrAiz4YKaT2Svs+EA3Oc85tdP UyXXzSS9AtiQQ1Z4G0LvwRXIHBJhfhY51BnewbmqwnnvN+YWRO g63o6juoVev8/kR7VKk+VwhZ/8Qz3qroE3nnkGKj/A5SIOqd4+ qfYaHdK5ZjA4w== 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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 Extract serial interface and CMT device instantiation into a separate function to be called in both full DT and dummy DT modes. This doesn't change the behaviour in the dummy DT case, only the instantiation order changes slightly. The full DT case is extended, previously these devices were not available there. Also following the r8a7790 example we remove the call to of_platform_populate() from the exported method to let platforms extend its parameters if needed. Signed-off-by: Guennadi Liakhovetski --- arch/arm/mach-shmobile/include/mach/r8a73a4.h | 1 + arch/arm/mach-shmobile/setup-r8a73a4.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h index 12a4ee9..2266747 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a73a4.h +++ b/arch/arm/mach-shmobile/include/mach/r8a73a4.h @@ -17,6 +17,7 @@ enum { }; void r8a73a4_add_standard_devices(void); +void r8a73a4_add_standard_devices_dt(void); void r8a73a4_clock_init(void); void r8a73a4_pinmux_init(void); void r8a73a4_init_delay(void); diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index 6aa80645..52bf60c 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c @@ -302,7 +302,7 @@ static struct resource dma_resources[] = { }, }; -void __init r8a73a4_add_standard_devices(void) +static void __init r8a73a4_add_common_devices(void) { r8a73a4_register_scif(SCIFA0); r8a73a4_register_scif(SCIFA1); @@ -310,10 +310,15 @@ void __init r8a73a4_add_standard_devices(void) r8a73a4_register_scif(SCIFB1); r8a73a4_register_scif(SCIFB2); r8a73a4_register_scif(SCIFB3); + r8a7790_register_cmt(10); +} + +void __init r8a73a4_add_standard_devices(void) +{ r8a73a4_register_irqc(0); r8a73a4_register_irqc(1); + r8a73a4_add_common_devices(); r8a73a4_register_thermal(); - r8a7790_register_cmt(10); platform_device_register_resndata(&platform_bus, "sh-dma-engine", 0, dma_resources, ARRAY_SIZE(dma_resources), &dma_platform_data, sizeof(dma_platform_data)); @@ -329,7 +334,13 @@ void __init r8a73a4_init_delay(void) #ifdef CONFIG_USE_OF void __init r8a73a4_add_standard_devices_dt(void) { + r8a73a4_add_common_devices(); platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); +} + +static void __init add_devices_dt(void) +{ + r8a73a4_add_standard_devices_dt(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } @@ -340,7 +351,7 @@ static const char *r8a73a4_boards_compat_dt[] __initdata = { DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)") .init_early = r8a73a4_init_delay, - .init_machine = r8a73a4_add_standard_devices_dt, + .init_machine = add_devices_dt, .init_time = shmobile_timer_init, .dt_compat = r8a73a4_boards_compat_dt, MACHINE_END