From patchwork Mon Jun 27 23:06:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 922682 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5RNAmbJ029502 for ; Mon, 27 Jun 2011 23:10:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755248Ab1F0XHV (ORCPT ); Mon, 27 Jun 2011 19:07:21 -0400 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]:43444 "EHLO na3sys009aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755203Ab1F0XGF (ORCPT ); Mon, 27 Jun 2011 19:06:05 -0400 Received: from mail-pw0-f47.google.com ([209.85.160.47]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTgkM3KRnhhxBPqmDKQaG8vijaEcRnu75@postini.com; Mon, 27 Jun 2011 16:06:04 PDT Received: by pwi1 with SMTP id 1so4537562pwi.34 for ; Mon, 27 Jun 2011 16:06:03 -0700 (PDT) Received: by 10.68.1.103 with SMTP id 7mr3494252pbl.81.1309215963613; Mon, 27 Jun 2011 16:06:03 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id g8sm4636337pba.21.2011.06.27.16.06.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Jun 2011 16:06:02 -0700 (PDT) From: Kevin Hilman To: "DebBarma\, Tarun Kanti" Cc: "linux-omap\@vger.kernel.org" , "Shilimkar\, Santosh" , "tony\@atomide.com" Subject: Re: [PATCH v2 12/18] GPIO: OMAP: Clean omap_gpio_mod_init function Organization: Texas Instruments, Inc. References: <1308111806-29152-1-git-send-email-tarun.kanti@ti.com> <1308111806-29152-3-git-send-email-tarun.kanti@ti.com> <87fwn9mzu0.fsf@ti.com> <5A47E75E594F054BAF48C5E4FC4B92AB037BC15847@dbde02.ent.ti.com> Date: Mon, 27 Jun 2011 16:06:00 -0700 In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB037BC15847@dbde02.ent.ti.com> (Tarun Kanti DebBarma's message of "Mon, 27 Jun 2011 16:18:51 +0530") Message-ID: <8762nq7u3r.fsf@ti.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 27 Jun 2011 23:10:49 +0000 (UTC) "DebBarma, Tarun Kanti" writes: > Kevin, > [...] >> > >> > With register offsets now defined for respective OMAP versions we can >> get rid >> > of cpu_class_* checks. In addition, organized common initialization for >> the >> > different OMAP silicon versions. >> > >> > Signed-off-by: Charulatha V >> > Signed-off-by: Tarun Kanti DebBarma >> >> Since the SYSCONFIG register settings are OMAP1-only and init-time only, >> they could be done in the OMAP1-specific init functions. > BTW, I needed some more clarifications here... > The omap_gpio_mod_init() is called only once from _probe(). > So, does it make sense to have a separate init function? > If yes, I have to call __init omap1_gpio_mod_init() from _probe() again. > This is because I need the bank information supplied to it. What I was thinking is something like the patch below (16xx only for example, but would need to be done for other OMAP1 also). This patch will obviously not work, but read the comment in the patch to make it work. Kevin the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c index c69b3b1..1d34a4c 100644 --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c @@ -218,8 +218,12 @@ static int __init omap16xx_gpio_init(void) if (!cpu_is_omap16xx()) return -EINVAL; - for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) + for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) { + u32 base = 0; /* get base from device's struct resource */ + + __raw_writew(0x0014, base + OMAP1610_GPIO_SYSCONFIG); platform_device_register(omap16xx_gpio_dev[i]); + } gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev); -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in