From: l.fu@pengutronix.de (Luotao Fu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM/MX2: clean up GPIO pin multiplexing for pca100 board
Date: Thu, 3 Jun 2010 15:55:48 +0200 [thread overview]
Message-ID: <1275573348-26564-3-git-send-email-l.fu@pengutronix.de> (raw)
In-Reply-To: <1275573348-26564-1-git-send-email-l.fu@pengutronix.de>
cleaned up some duplicated mxc_gpio_mode calls and move the correpsonding
pin multiplexing either into the initial pin config table or ifdef blocks.
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
---
arch/arm/mach-mx2/mach-pca100.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-mx2/mach-pca100.c b/arch/arm/mach-mx2/mach-pca100.c
index cf3d57b..dcd6555 100644
--- a/arch/arm/mach-mx2/mach-pca100.c
+++ b/arch/arm/mach-mx2/mach-pca100.c
@@ -55,6 +55,9 @@
#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
+#define SPI1_SS0 (GPIO_PORTD + 28)
+#define SPI1_SS1 (GPIO_PORTD + 27)
+#define SD2_CD (GPIO_PORTC + 29)
static int pca100_pins[] = {
/* UART1 */
@@ -69,6 +72,7 @@ static int pca100_pins[] = {
PB7_PF_SD2_D3,
PB8_PF_SD2_CMD,
PB9_PF_SD2_CLK,
+ SD2_CD | GPIO_GPIO | GPIO_IN,
/* FEC */
PD0_AIN_FEC_TXD0,
PD1_AIN_FEC_TXD1,
@@ -158,6 +162,10 @@ static int pca100_pins[] = {
PA31_PF_OE_ACD,
/* LVDS Transceiver */
LVDS_PWR_DWN_GPIO | GPIO_GPIO | GPIO_IN,
+ /* free GPIO */
+ GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN, /* GPIO0_IRQ */
+ GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN, /* GPIO1_IRQ */
+ GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN, /* GPIO2_IRQ */
};
static struct imxuart_platform_data uart_pdata = {
@@ -215,7 +223,7 @@ static struct spi_board_info pca100_spi_board_info[] __initdata = {
},
};
-static int pca100_spi_cs[] = {GPIO_PORTD + 28, GPIO_PORTD + 27};
+static int pca100_spi_cs[] = {SPI1_SS0, SPI1_SS1};
static struct spi_imx_master pca100_spi_0_data = {
.chipselect = pca100_spi_cs,
@@ -387,7 +395,6 @@ static void __init pca100_init(void)
mxc_register_device(&mxc_uart_device0, &uart_pdata);
- mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
mxc_register_device(&imx27_nand_device, &pca100_nand_board_info);
@@ -398,17 +405,9 @@ static void __init pca100_init(void)
mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data);
- mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
- mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_OUT);
-
- /* GPIO0_IRQ */
- mxc_gpio_mode(GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN);
- /* GPIO1_IRQ */
- mxc_gpio_mode(GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN);
- /* GPIO2_IRQ */
- mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN);
-
#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
+ mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
+ mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
spi_register_board_info(pca100_spi_board_info,
ARRAY_SIZE(pca100_spi_board_info));
mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);
--
1.7.1
next prev parent reply other threads:[~2010-06-03 13:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-03 13:55 few patches for PhyCARD-S board(pca100) with mx27 SOC Luotao Fu
2010-06-03 13:55 ` [PATCH 1/2] ARM/MX2: add framebuffer device support and TFT to pca100 board Luotao Fu
2010-06-03 13:55 ` Luotao Fu [this message]
2010-06-18 7:23 ` pca100 patches [V2] Luotao Fu
2010-06-18 7:23 ` [PATCH 1/2 V2] pca100: add framebuffer device support and TFT Luotao Fu
2010-06-18 7:23 ` [PATCH 2/2 V2] pca100: clean up GPIO pin multiplexing Luotao Fu
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=1275573348-26564-3-git-send-email-l.fu@pengutronix.de \
--to=l.fu@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).