diff mbox

[U-Boot,v2,12/21] km-arm: i2c support for suenx based boards

Message ID 1300179844-8951-13-git-send-email-hs@denx.de
State Superseded
Headers show

Commit Message

Heiko Schocher March 15, 2011, 9:03 a.m. UTC
This patch renames the suen3 defines and functions to suenx
which is more generic and more precise, because these values
and functions where used by all suenX boards and not only sune3.

Signed-off-by: Lukas Roggli <lukas.roggli@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
---
Changes for v2:
  - fix checkpatch.pl errors and warnings

 board/keymile/km_arm/km_arm.c |   20 ++++++++++----------
 include/configs/km_arm.h      |   18 +++++++++---------
 2 files changed, 19 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 5c1e822..2ba1cbe 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -96,7 +96,7 @@  u32 kwmpp_config[] = {
 	MPP41_GPIO,		/* Piggy3 LED[4] */
 	MPP42_GPIO,		/* Piggy3 LED[5] */
 	MPP43_GPIO,		/* Piggy3 LED[6] */
-	MPP44_GPIO,		/* Piggy3 LED[7] */
+	MPP44_GPIO,		/* Piggy3 LED[7], BIST_EN_L */
 	MPP45_GPIO,		/* Piggy3 LED[8] */
 	MPP46_GPIO,		/* Reserved */
 	MPP47_GPIO,		/* Reserved */
@@ -162,14 +162,14 @@  int board_early_init_f(void)
 
 #if defined(CONFIG_SOFT_I2C)
 	/* init the GPIO for I2C Bitbang driver */
-	kw_gpio_set_valid(SUEN3_SDA_PIN, 1);
-	kw_gpio_set_valid(SUEN3_SCL_PIN, 1);
-	kw_gpio_direction_output(SUEN3_SDA_PIN, 0);
-	kw_gpio_direction_output(SUEN3_SCL_PIN, 0);
+	kw_gpio_set_valid(SUENx_SDA_PIN, 1);
+	kw_gpio_set_valid(SUENx_SCL_PIN, 1);
+	kw_gpio_direction_output(SUENx_SDA_PIN, 0);
+	kw_gpio_direction_output(SUENx_SCL_PIN, 0);
 #endif
 #if defined(CONFIG_SYS_EEPROM_WREN)
-	kw_gpio_set_valid(SUEN3_ENV_WP, 38);
-	kw_gpio_direction_output(SUEN3_ENV_WP, 1);
+	kw_gpio_set_valid(SUENx_ENV_WP, 38);
+	kw_gpio_direction_output(SUENx_ENV_WP, 1);
 #endif
 
 	return 0;
@@ -322,15 +322,15 @@  int get_sda (void)
 
 int get_scl (void)
 {
-	return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0);
+	return kw_gpio_get_value(SUENx_SCL_PIN) ? 1 : 0;
 }
 #endif
 
 #if defined(CONFIG_SYS_EEPROM_WREN)
 int eeprom_write_enable (unsigned dev_addr, int state)
 {
-	kw_gpio_set_value(SUEN3_ENV_WP, !state);
+	kw_gpio_set_value(SUENx_ENV_WP, !state);
 
-	return !kw_gpio_get_value(SUEN3_ENV_WP);
+	return !kw_gpio_get_value(SUENx_ENV_WP);
 }
 #endif
diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h
index 6e8e8b7..8b429a1 100644
--- a/include/configs/km_arm.h
+++ b/include/configs/km_arm.h
@@ -177,15 +177,15 @@  void set_sda (int state);
 void set_scl (int state);
 int get_sda (void);
 int get_scl (void);
-#define SUEN3_SDA_PIN	8
-#define SUEN3_SCL_PIN	9
-#define SUEN3_ENV_WP	38
-
-#define I2C_ACTIVE	__set_direction(SUEN3_SDA_PIN, 0)
-#define I2C_TRISTATE	__set_direction(SUEN3_SDA_PIN, 1)
-#define I2C_READ	(kw_gpio_get_value(SUEN3_SDA_PIN) ? 1 : 0)
-#define I2C_SDA(bit)	kw_gpio_set_value(SUEN3_SDA_PIN, bit);
-#define I2C_SCL(bit)	kw_gpio_set_value(SUEN3_SCL_PIN, bit);
+#define SUENx_SDA_PIN	8
+#define SUENx_SCL_PIN	9
+#define SUENx_ENV_WP	38
+
+#define I2C_ACTIVE	__set_direction(SUENx_SDA_PIN, 0)
+#define I2C_TRISTATE	__set_direction(SUENx_SDA_PIN, 1)
+#define I2C_READ	(kw_gpio_get_value(SUENx_SDA_PIN) ? 1 : 0)
+#define I2C_SDA(bit)	kw_gpio_set_value(SUENx_SDA_PIN, bit);
+#define I2C_SCL(bit)	kw_gpio_set_value(SUENx_SCL_PIN, bit);
 #endif
 
 #define I2C_DELAY	udelay(3)	/* 1/4 I2C clock duration */