linux-mips
[Top] [All Lists]

[PATCH 4/4] Alchemy: xxs1500: use linux gpio api.

To: Linux-MIPS <linux-mips@linux-mips.org>
Subject: [PATCH 4/4] Alchemy: xxs1500: use linux gpio api.
From: Manuel Lauss <mano@roarinelk.homelinux.net>
Date: Fri, 22 May 2009 22:24:59 +0200
Cc: Manuel Lauss <mano@roarinelk.homelinux.net>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=U8YPYheioI6K8x7dZ7fJEzoza/At6I7gz9stCDokigs=; b=AeLRA3fJrId0y46+AuGfjPUX1jfCVH0hd14JoWd3vdfLbl/7KVcxsZBFMjIvSIaTOq yc19+dRT+DUxD0OaEj2EPxt1ibCsqECo9WnwDoC8NlynY78HiHfN7sIoqRIR/43D/fiT Ptw18PpnpgZIrtKdBKW9ZrknL8sOxJIgmddXE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=YyPK+mBbJ+MbNHzaeN7LkX0nTn+p//aTQy22LpMLTTiNJYt9zT4AIpMbMKjrZn+kXu EYZclDlbPxIY7cDfz/IQU+yqFxTEqx6pjUEgqvW8/ZOaBrlVEZcia+8Xrgq/XtZSplvu g5hI4feNOHYUnkK4Y2ZFLZduPKKXCTZLVBQUU=
In-reply-to: <1243023899-10343-3-git-send-email-mano@roarinelk.homelinux.net>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1243023899-10343-1-git-send-email-mano@roarinelk.homelinux.net> <1243023899-10343-2-git-send-email-mano@roarinelk.homelinux.net> <1243023899-10343-3-git-send-email-mano@roarinelk.homelinux.net>
Sender: linux-mips-bounce@linux-mips.org
Remove a few GPIO register accesses in the board init code with calls
to the gpio api.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
 arch/mips/alchemy/xxs1500/board_setup.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/mips/alchemy/xxs1500/board_setup.c 
b/arch/mips/alchemy/xxs1500/board_setup.c
index a2634fa..ed7d999 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -23,6 +23,7 @@
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 
@@ -65,20 +66,21 @@ void __init board_setup(void)
        au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */
 
 #ifdef CONFIG_PCMCIA_XXS1500
-       /* Setup PCMCIA signals */
-       au_writel(0, SYS_PININPUTEN);
+       alchemy_gpio2_enable();
 
        /* GPIO 0, 1, and 4 are inputs */
-       au_writel(1 | (1 << 1) | (1 << 4), SYS_TRIOUTCLR);
+       alchemy_gpio_direction_input(0);
+       alchemy_gpio_direction_input(1);
+       alchemy_gpio_direction_input(4);
 
-       /* Enable GPIO2 if not already enabled */
-       au_writel(1, GPIO2_ENABLE);
        /* GPIO2 208/9/10/11 are inputs */
-       au_writel((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11), GPIO2_DIR);
+       alchemy_gpio_direction_input(208);
+       alchemy_gpio_direction_input(209);
+       alchemy_gpio_direction_input(210);
+       alchemy_gpio_direction_input(211);
 
        /* Turn off power */
-       au_writel((au_readl(GPIO2_PINSTATE) & ~(1 << 14)) | (1 << 30),
-                 GPIO2_OUTPUT);
+       alchemy_gpio_direction_output(214, 0);
 #endif
 
 #ifdef CONFIG_PCI
-- 
1.6.3.1


<Prev in Thread] Current Thread [Next in Thread>