From patchwork Sun Aug 18 05:19:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2846153 Return-Path: X-Original-To: patchwork-davinci@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 C69DE9F271 for ; Sun, 18 Aug 2013 05:23:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2EDB20263 for ; Sun, 18 Aug 2013 05:23:03 +0000 (UTC) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D807720214 for ; Sun, 18 Aug 2013 05:23:02 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7I5LnDl008521; Sun, 18 Aug 2013 00:21:49 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7I5Lnx2029493; Sun, 18 Aug 2013 00:21:49 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Sun, 18 Aug 2013 00:21:48 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r7I5Lm7X015364; Sun, 18 Aug 2013 00:21:48 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A3DC480628; Sun, 18 Aug 2013 00:21:48 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 4F95C8062A for ; Sun, 18 Aug 2013 00:20:54 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r7I5Ks9d027915 for ; Sun, 18 Aug 2013 00:20:54 -0500 (CDT) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7I5Krhk017522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 18 Aug 2013 00:20:53 -0500 Received: from [216.82.242.131:30137] by server-17.bemta-8.messagelabs.com id FC/89-17748-5B950125; Sun, 18 Aug 2013 05:20:53 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-6.tower-76.messagelabs.com!1376803251!31949796!1 X-Originating-IP: [209.85.220.46] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19387 invoked from network); 18 Aug 2013 05:20:52 -0000 Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by server-6.tower-76.messagelabs.com with RC4-SHA encrypted SMTP; 18 Aug 2013 05:20:52 -0000 Received: by mail-pa0-f46.google.com with SMTP id fa1so3433645pad.19 for ; Sat, 17 Aug 2013 22:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D4yGCawammSmUl2uIE+GUgHn05ClHnxXjWIpQpgVsiE=; b=z+m89E88Ep9OYU6zNs7/UaqxTm+iORmPN2KGM4EvPDVaB3Oxhk10tgPNaJ+g2/Y3vX 32+7S0Tz+OYAp8EPPp15GAzlR2FA3IY6gHhSBtzbh/f4+A6HsoJyE2OJ0MeiKwqXrPhy IymefNr6ggp7hz2NKqo8yBXHsQkteKjn3HW7LzfG5QgHa/sB5Oln71H47f2F4L5M1oIH HtJYw1joLg+OEu5VsLpSlodnK+SS472TRCRUhOa+dcSvk/jO5swV5QWAf4aCEj/1XQzH ahKXLvZSPQgACtI+ze0TsliHfoX7NZRUyY9koj5jeDt1H3KrZNPZPo7rsRizH+PBzWBa Y0Hg== X-Received: by 10.68.189.5 with SMTP id ge5mr6350893pbc.42.1376803251418; Sat, 17 Aug 2013 22:20:51 -0700 (PDT) Received: from localhost.localdomain ([112.79.40.224]) by mx.google.com with ESMTPSA id pq1sm7175496pbb.26.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 Aug 2013 22:20:50 -0700 (PDT) From: "Lad, Prabhakar" To: DLOS , Sekhar Nori Subject: [PATCH v3 4/7] ARM: davinci: devices.c: support gpio platform device Date: Sun, 18 Aug 2013 10:49:00 +0530 Message-ID: <1376803143-13738-5-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376803143-13738-1-git-send-email-prabhakar.csengg@gmail.com> References: <1376803143-13738-1-git-send-email-prabhakar.csengg@gmail.com> CC: Linus Walleij , LKML , Philip Avinash , Grant Likely , LAK X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 From: Philip Avinash 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 Signed-off-by: Lad, Prabhakar --- 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 2ab5d57..6dfc038 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 111573c..b0fac4e 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -318,6 +318,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); +} + /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/