From patchwork Fri Apr 22 11:08:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: charu@ti.com X-Patchwork-Id: 726911 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3MB53jR028276 for ; Fri, 22 Apr 2011 11:05:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755172Ab1DVLFA (ORCPT ); Fri, 22 Apr 2011 07:05:00 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:60462 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755116Ab1DVLE5 (ORCPT ); Fri, 22 Apr 2011 07:04:57 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p3MB4bG6016226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 22 Apr 2011 06:04:39 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p3MB4WGn028971; Fri, 22 Apr 2011 16:34:36 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Fri, 22 Apr 2011 16:34:17 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with SMTP id p3MB4YOh021597; Fri, 22 Apr 2011 16:34:34 +0530 (IST) Received: from x0084895-pc (unknown [10.24.244.78]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id D3F31158011; Fri, 22 Apr 2011 16:34:31 +0530 (IST) From: Charulatha V To: , CC: , , , Charulatha V Subject: [RFC PATCH 15/18] OMAP: GPIO: cleanup gpio_show_rev Date: Fri, 22 Apr 2011 16:38:29 +0530 Message-ID: <1303470512-19671-16-git-send-email-charu@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1303470512-19671-1-git-send-email-charu@ti.com> References: <1303470512-19671-1-git-send-email-charu@ti.com> 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 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 11:05:03 +0000 (UTC) Remove cpu_is* checks from omap_gpio_show_rev. Also display GPIO IP version only once as it is not required to print the IP version of all the banks as they are the same. Signed-off-by: Charulatha V --- arch/arm/plat-omap/gpio.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 0f48364..637db76 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -1032,12 +1032,10 @@ static void __init omap_gpio_show_rev(struct gpio_bank *bank) { u32 rev; - if (cpu_is_omap16xx() && !(bank->method != METHOD_MPUIO)) - rev = __raw_readw(bank->base + OMAP1610_GPIO_REVISION); - else if (cpu_is_omap24xx() || cpu_is_omap34xx()) - rev = __raw_readl(bank->base + OMAP24XX_GPIO_REVISION); - else if (cpu_is_omap44xx()) - rev = __raw_readl(bank->base + OMAP4_GPIO_REVISION); + if ((bank->method == METHOD_GPIO_24XX) || + (bank->method == METHOD_GPIO_44XX) || + (bank->method == METHOD_GPIO_1610)) + rev = gpio_fn.gpio_read(bank->base, REV); else return; @@ -1170,6 +1168,7 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank) static int __devinit omap_gpio_probe(struct platform_device *pdev) { static int gpio_init_done; + static int show_rev; struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; @@ -1238,7 +1237,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) omap_gpio_mod_init(bank, pdev->id); omap_gpio_chip_init(bank); - omap_gpio_show_rev(bank); list_add_tail(&bank->node, &omap_gpio_list); @@ -1259,6 +1257,11 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) gpio_init_done = 1; } + if ((bank->method != METHOD_MPUIO) && (!show_rev)) { + omap_gpio_show_rev(bank); + show_rev = 1; + } + return 0; }