From: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>,
Ralf Baechle <ralf@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Subject: [PATCH 4/5] Alchemy: xxs1500: use linux gpio api.
Date: Wed, 3 Jun 2009 18:18:07 +0200 [thread overview]
Message-ID: <1244045888-16259-5-git-send-email-manuel.lauss@gmail.com> (raw)
In-Reply-To: <1244045888-16259-4-git-send-email-manuel.lauss@gmail.com>
Replace a few GPIO register accesses in the board init code with calls
to the gpio api.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
---
arch/mips/alchemy/xxs1500/board_setup.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index a2634fa..4de2d48 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>
@@ -50,6 +51,9 @@ void __init board_setup(void)
}
#endif
+ alchemy_gpio1_input_enable();
+ alchemy_gpio2_enable();
+
/* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */
pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
pin_func |= SYS_PF_UR3;
@@ -65,20 +69,19 @@ 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);
-
/* 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
next prev parent reply other threads:[~2009-06-03 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-03 16:18 [PATCH 0/5] Alchemy GPIO rewrite v6 Manuel Lauss
2009-06-03 16:18 ` [PATCH 1/5] Alchemy: remove unused au1000_gpio.h header Manuel Lauss
2009-06-03 16:18 ` [PATCH 2/5] Alchemy: rewrite GPIO support Manuel Lauss
2009-06-03 16:18 ` [PATCH 3/5] Alchemy: mtx-1: use linux gpio api Manuel Lauss
2009-06-03 16:18 ` Manuel Lauss [this message]
2009-06-03 16:18 ` [PATCH 5/5] Alchemy: devboards: convert to gpio calls Manuel Lauss
2009-06-04 9:26 ` [PATCH 0/5] Alchemy GPIO rewrite v6 Florian Fainelli
-- strict thread matches above, loose matches on Subject: below --
2009-06-06 12:09 [PATCH 0/5] Alchemy GPIO rewrite v7 Manuel Lauss
2009-06-06 12:09 ` [PATCH 1/5] Alchemy: remove unused au1000_gpio.h header Manuel Lauss
2009-06-06 12:09 ` [PATCH 2/5] Alchemy: rewrite GPIO support Manuel Lauss
2009-06-06 12:09 ` [PATCH 3/5] Alchemy: mtx-1: use linux gpio api Manuel Lauss
2009-06-06 12:09 ` [PATCH 4/5] Alchemy: xxs1500: " Manuel Lauss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244045888-16259-5-git-send-email-manuel.lauss@gmail.com \
--to=manuel.lauss@googlemail.com \
--cc=linux-mips@linux-mips.org \
--cc=manuel.lauss@gmail.com \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.