aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2/mach-pca100.c
diff options
context:
space:
mode:
authorLuotao Fu <l.fu@pengutronix.de>2010-06-18 03:23:19 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:18:27 -0400
commitb725abad348d1f4fea8771eb23452eec2b7fe65f (patch)
tree0c44e56ce25d2fc635d1a0c9d5314b9eaa2297eb /arch/arm/mach-mx2/mach-pca100.c
parent42216fc59db7dada1d622dfed36e7e56b1b68b04 (diff)
pca100: clean up GPIO pin multiplexing
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2/mach-pca100.c')
-rw-r--r--arch/arm/mach-mx2/mach-pca100.c23
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 a94343663997..2164b7f96ef2 100644
--- a/arch/arm/mach-mx2/mach-pca100.c
+++ b/arch/arm/mach-mx2/mach-pca100.c
@@ -55,6 +55,9 @@
55 55
56#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23) 56#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
57#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24) 57#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
58#define SPI1_SS0 (GPIO_PORTD + 28)
59#define SPI1_SS1 (GPIO_PORTD + 27)
60#define SD2_CD (GPIO_PORTC + 29)
58 61
59static int pca100_pins[] = { 62static int pca100_pins[] = {
60 /* UART1 */ 63 /* UART1 */
@@ -69,6 +72,7 @@ static int pca100_pins[] = {
69 PB7_PF_SD2_D3, 72 PB7_PF_SD2_D3,
70 PB8_PF_SD2_CMD, 73 PB8_PF_SD2_CMD,
71 PB9_PF_SD2_CLK, 74 PB9_PF_SD2_CLK,
75 SD2_CD | GPIO_GPIO | GPIO_IN,
72 /* FEC */ 76 /* FEC */
73 PD0_AIN_FEC_TXD0, 77 PD0_AIN_FEC_TXD0,
74 PD1_AIN_FEC_TXD1, 78 PD1_AIN_FEC_TXD1,
@@ -156,6 +160,10 @@ static int pca100_pins[] = {
156 PA28_PF_HSYNC, 160 PA28_PF_HSYNC,
157 PA29_PF_VSYNC, 161 PA29_PF_VSYNC,
158 PA31_PF_OE_ACD, 162 PA31_PF_OE_ACD,
163 /* free GPIO */
164 GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN, /* GPIO0_IRQ */
165 GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN, /* GPIO1_IRQ */
166 GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN, /* GPIO2_IRQ */
159}; 167};
160 168
161static struct imxuart_platform_data uart_pdata = { 169static struct imxuart_platform_data uart_pdata = {
@@ -214,7 +222,7 @@ static struct spi_board_info pca100_spi_board_info[] __initdata = {
214 }, 222 },
215}; 223};
216 224
217static int pca100_spi_cs[] = {GPIO_PORTD + 28, GPIO_PORTD + 27}; 225static int pca100_spi_cs[] = {SPI1_SS0, SPI1_SS1};
218 226
219static struct spi_imx_master pca100_spi_0_data = { 227static struct spi_imx_master pca100_spi_0_data = {
220 .chipselect = pca100_spi_cs, 228 .chipselect = pca100_spi_cs,
@@ -388,7 +396,6 @@ static void __init pca100_init(void)
388 396
389 mxc_register_device(&mxc_uart_device0, &uart_pdata); 397 mxc_register_device(&mxc_uart_device0, &uart_pdata);
390 398
391 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
392 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); 399 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
393 400
394 mxc_register_device(&imx27_nand_device, &pca100_nand_board_info); 401 mxc_register_device(&imx27_nand_device, &pca100_nand_board_info);
@@ -399,17 +406,9 @@ static void __init pca100_init(void)
399 406
400 mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data); 407 mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data);
401 408
402 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
403 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_OUT);
404
405 /* GPIO0_IRQ */
406 mxc_gpio_mode(GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN);
407 /* GPIO1_IRQ */
408 mxc_gpio_mode(GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN);
409 /* GPIO2_IRQ */
410 mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN);
411
412#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) 409#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
410 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
411 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
413 spi_register_board_info(pca100_spi_board_info, 412 spi_register_board_info(pca100_spi_board_info,
414 ARRAY_SIZE(pca100_spi_board_info)); 413 ARRAY_SIZE(pca100_spi_board_info));
415 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data); 414 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);