From patchwork Thu Jun 20 06:18:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 2753121 Return-Path: X-Original-To: patchwork-linux-arm@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 39E889F96B for ; Thu, 20 Jun 2013 06:19:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B3F3201D0 for ; Thu, 20 Jun 2013 06:19:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A639201CE for ; Thu, 20 Jun 2013 06:19:03 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpYCq-0003MO-LM; Thu, 20 Jun 2013 06:18:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpYCo-0004CP-0s; Thu, 20 Jun 2013 06:18:50 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpYCk-0004Av-7n for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 06:18:47 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5K6IIAq010731; Thu, 20 Jun 2013 01:18:18 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5K6IId6006711; Thu, 20 Jun 2013 01:18:18 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Thu, 20 Jun 2013 01:18:17 -0500 Received: from [172.24.145.53] (a0875516lt.apr.dhcp.ti.com [172.24.145.53]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5K6IEW2021699; Thu, 20 Jun 2013 01:18:15 -0500 Message-ID: <51C29EA5.5050507@ti.com> Date: Thu, 20 Jun 2013 11:48:13 +0530 From: Sekhar Nori User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Philip Avinash Subject: Re: [PATCH v2 4/7] ARM: davinci: creation of gpio platform device for dmxxx platforms References: <1371202532-14628-1-git-send-email-avinashphilip@ti.com> <1371202532-14628-5-git-send-email-avinashphilip@ti.com> In-Reply-To: <1371202532-14628-5-git-send-email-avinashphilip@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_021846_365600_929FEDC5 X-CRM114-Status: GOOD ( 18.15 ) X-Spam-Score: -8.2 (--------) Cc: davinci-linux-open-source@linux.davincidsp.com, linux@arm.linux.org.uk, khilman@deeprootsystems.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, grant.likely@secretlab.ca, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 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 X-Virus-Scanned: ClamAV using ClamSMTP On 6/14/2013 3:05 PM, Philip Avinash wrote: > gpio controller resource information being associated with > davinci_soc_info structure and not created any device. Hence davinci > gpio didn't fall under proper device model. This patch creates gpio > davinci as a platform device for dmxxx platforms. > Also add daivinci_register_gpio API to create platform device for dmxxx > platforms. > > Signed-off-by: Philip Avinash > Acked-by: Linus Walleij > Signed-off-by: Sekhar Nori > --- > arch/arm/mach-davinci/devices.c | 13 +++++++++++++ > arch/arm/mach-davinci/include/mach/common.h | 2 ++ > 2 files changed, 15 insertions(+) > > diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c > index a7068a3..b4f345b 100644 > --- a/arch/arm/mach-davinci/devices.c > +++ b/arch/arm/mach-davinci/devices.c > @@ -313,6 +313,19 @@ static void davinci_init_wdt(void) > platform_device_register(&davinci_wdt_device); > } > > +static struct platform_device davinci_gpio_device = { > + .name = "davinci_gpio", > + .id = -1, > +}; > + > +int davinci_gpio_register(struct resource *res, int size, void *pdata) > +{ > + davinci_gpio_device.resource = res; > + davinci_gpio_device.num_resources = size; > + davinci_gpio_device.dev.platform_data = pdata; > + return platform_device_register(&davinci_gpio_device); > +} > + > /*-------------------------------------------------------------------------*/ > > /*-------------------------------------------------------------------------*/ > diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h > index b124b77..bd389ba 100644 > --- a/arch/arm/mach-davinci/include/mach/common.h > +++ b/arch/arm/mach-davinci/include/mach/common.h > @@ -14,6 +14,7 @@ > > #include > #include > +#include > > extern void davinci_timer_init(void); > > @@ -83,6 +84,7 @@ extern void davinci_common_init(struct davinci_soc_info *soc_info); > extern void davinci_init_ide(void); > void davinci_restart(char mode, const char *cmd); > void davinci_init_late(void); > +int davinci_gpio_register(struct resource *res, int size, void *pdata); This declaration should not be inserted into this globally visible header. There is a local davinci.h for the same purpose. I did the fix for you. Here is the updated patch I am committing. I fixed the description in a manner similar to 3/7. Thanks, Sekhar From 505ac35b131a90c721bf82bd1236da7a4f46ba12 Mon Sep 17 00:00:00 2001 From: Philip Avinash Date: Fri, 14 Jun 2013 15:05:29 +0530 Subject: [PATCH 1/1] ARM: davinci: devices.c: support gpio platform device DaVinci GPIO driver now uses platform device model. Add a GPIO platform register API to convert the traditional DaVinci SoCs to use the new model. Signed-off-by: Philip Avinash Acked-by: Linus Walleij [nsekhar@ti.com: move function declaration to local header, simplify commit message] Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/davinci.h | 2 ++ arch/arm/mach-davinci/devices.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h index 1ab3df4..5c0f0c1 100644 --- a/arch/arm/mach-davinci/davinci.h +++ b/arch/arm/mach-davinci/davinci.h @@ -53,6 +53,8 @@ extern void __iomem *davinci_sysmod_base; #define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x)) void davinci_map_sysmod(void); +int davinci_gpio_register(struct resource *res, int size, void *pdata); + /* DM355 base addresses */ #define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000 #define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index a7068a3..b4f345b 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -313,6 +313,19 @@ static void davinci_init_wdt(void) platform_device_register(&davinci_wdt_device); } +static struct platform_device davinci_gpio_device = { + .name = "davinci_gpio", + .id = -1, +}; + +int davinci_gpio_register(struct resource *res, int size, void *pdata) +{ + davinci_gpio_device.resource = res; + davinci_gpio_device.num_resources = size; + davinci_gpio_device.dev.platform_data = pdata; + return platform_device_register(&davinci_gpio_device); +} + /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/