[U-Boot] [PATCH] mx5:Use IMX_GPIO_NR macro

Ashok ashokkourla2000 at gmail.com
Thu Aug 23 18:43:57 CEST 2012


 From 9f76cd6a79c6595fc058e9103d9d4eebd138a2af Mon Sep 17 00:00:00 2001
From: Ashok Kumar Reddy <ashokkourla2000 at gmail.com>
Date: Thu, 23 Aug 2012 21:24:53 +0530
Subject: [PATCH] mx5:Use IMX_GPIO_NR macro

Signed-off-by: Ashok Kumar Reddy <ashokkourla2000 at gmail.com>
---
  board/freescale/mx51evk/mx51evk.c   |   12 ++++++------
  board/freescale/mx53ard/mx53ard.c   |    8 ++++----
  board/freescale/mx53evk/mx53evk.c   |    8 ++++----
  board/freescale/mx53loco/mx53loco.c |    8 ++++----
  board/freescale/mx53smd/mx53smd.c   |    4 ++--
  5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/board/freescale/mx51evk/mx51evk.c 
b/board/freescale/mx51evk/mx51evk.c
index 514a7ac..55cdbed 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -319,11 +319,11 @@ static void power_init(void)
  	pmic_reg_write(p, REG_MODE_1, val);

  	mxc_request_iomux(MX51_PIN_EIM_A20, IOMUX_CONFIG_ALT1);
-	gpio_direction_output(46, 0);
+	gpio_direction_output(IMX_GPIO_NR(2,14), 0);

  	udelay(500);

-	gpio_set_value(46, 1);
+	gpio_set_value(IMX_GPIO_NR(2,14), 1);
  }

  #ifdef CONFIG_FSL_ESDHC
@@ -333,14 +333,14 @@ int board_mmc_getcd(struct mmc *mmc)
  	int ret;

  	mxc_request_iomux(MX51_PIN_GPIO1_0, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(0);
+	gpio_direction_input(IMX_GPIO_NR(1,0));
  	mxc_request_iomux(MX51_PIN_GPIO1_6, IOMUX_CONFIG_ALT0);
-	gpio_direction_input(6);
+	gpio_direction_input(IMX_GPIO_NR(1,6));

  	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-		ret = !gpio_get_value(0);
+		ret = !gpio_get_value(IMX_GPIO_NR(1,0));
  	else
-		ret = !gpio_get_value(6);
+		ret = !gpio_get_value(IMX_GPIO_NR(1,6));

  	return ret;
  }
diff --git a/board/freescale/mx53ard/mx53ard.c 
b/board/freescale/mx53ard/mx53ard.c
index 2d21584..ee5bd43 100644
--- a/board/freescale/mx53ard/mx53ard.c
+++ b/board/freescale/mx53ard/mx53ard.c
@@ -89,14 +89,14 @@ int board_mmc_getcd(struct mmc *mmc)
  	int ret;

  	mxc_request_iomux(MX53_PIN_GPIO_1, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(1);
+	gpio_direction_input(IMX_GPIO_NR(1,1));
  	mxc_request_iomux(MX53_PIN_GPIO_4, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(4);
+	gpio_direction_input(IMX_GPIO_NR(1,4));

  	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-		ret = !gpio_get_value(1); /* GPIO1_1 */
+		ret = !gpio_get_value(IMX_GPIO_NR(1,1));
  	else
-		ret = !gpio_get_value(4); /* GPIO1_4 */
+		ret = !gpio_get_value(IMX_GPIO_NR(1,4));

  	return ret;
  }
diff --git a/board/freescale/mx53evk/mx53evk.c 
b/board/freescale/mx53evk/mx53evk.c
index 8a6e31d..ed23e28 100644
--- a/board/freescale/mx53evk/mx53evk.c
+++ b/board/freescale/mx53evk/mx53evk.c
@@ -214,14 +214,14 @@ int board_mmc_getcd(struct mmc *mmc)
  	int ret;

  	mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(75);
+	gpio_direction_input(IMX_GPIO_NR(3,11));
  	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(77);
+	gpio_direction_input(IMX_GPIO_NR(3,13));

  	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-		ret = !gpio_get_value(77); /* GPIO3_13 */
+		ret = !gpio_get_value(IMX_GPIO_NR(3,13));
  	else
-		ret = !gpio_get_value(75); /* GPIO3_11 */
+		ret = !gpio_get_value(IMX_GPIO_NR(3,11));

  	return ret;
  }
diff --git a/board/freescale/mx53loco/mx53loco.c 
b/board/freescale/mx53loco/mx53loco.c
index cbdcfad..8cb9bd9 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -175,14 +175,14 @@ int board_mmc_getcd(struct mmc *mmc)
  	int ret;

  	mxc_request_iomux(MX53_PIN_EIM_DA11, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(75);
+	gpio_direction_input(IMX_GPIO_NR(3,11));
  	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(77);
+	gpio_direction_input(IMX_GPIO_NR(3,13));

  	if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-		ret = !gpio_get_value(77); /* GPIO3_13 */
+		ret = !gpio_get_value(IMX_GPIO_NR(3,13));
  	else
-		ret = !gpio_get_value(75); /* GPIO3_11 */
+		ret = !gpio_get_value(IMX_GPIO_NR(3,11));

  	return ret;
  }
diff --git a/board/freescale/mx53smd/mx53smd.c 
b/board/freescale/mx53smd/mx53smd.c
index c237980..cca9e99 100644
--- a/board/freescale/mx53smd/mx53smd.c
+++ b/board/freescale/mx53smd/mx53smd.c
@@ -135,8 +135,8 @@ struct fsl_esdhc_cfg esdhc_cfg[1] = {
  int board_mmc_getcd(struct mmc *mmc)
  {
  	mxc_request_iomux(MX53_PIN_EIM_DA13, IOMUX_CONFIG_ALT1);
-	gpio_direction_input(77);
-	return !gpio_get_value(77); /* GPIO3_13 */
+	gpio_direction_input(IMX_GPIO_NR(3,13));
+	return !gpio_get_value(IMX_GPIO_NR(3,13));
  }

  int board_mmc_init(bd_t *bis)
-- 
1.7.9.5



More information about the U-Boot mailing list