From b630ed30172a29914e3a3e03c327dcbbc41b6eef Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Tue, 28 Jul 2009 08:27:41 +0900 Subject: [PATCH] s5pc110: I2C code cleanup Signed-off-by: Kyungmin Park --- drivers/i2c/s5pc1xx_i2c.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/s5pc1xx_i2c.c b/drivers/i2c/s5pc1xx_i2c.c index a7ca432..b32ec38 100644 --- a/drivers/i2c/s5pc1xx_i2c.c +++ b/drivers/i2c/s5pc1xx_i2c.c @@ -135,7 +135,7 @@ void i2c_init(int speed, int slaveadd) i2c->IICSTAT = I2C_MODE_MT | I2C_TXRX_ENA; if (cpu_is_s5pc110()) { - /* set I2C0 pad conf */ + /* set I2C pad conf */ switch (default_channel) { case 2: gpio_shift = 16; @@ -149,20 +149,20 @@ void i2c_init(int speed, int slaveadd) reg = S5PC110_GPIO_BASE(S5PC110_GPIO_D1_OFFSET); reg += S5PC1XX_GPIO_CON_OFFSET; - value = readl(reg); - value &= ~(0xff << gpio_shift); - value |= (0x22 << gpio_shift); - writel(value, reg); } else { - /* set I2C0 pad conf */ + /* set I2C pad conf */ if (default_channel) gpio_shift = 20; else gpio_shift = 12; - __REG(S5PC100_GPIO_BASE(S5PC100_GPIO_D_OFFSET)) &= ~(0xff << gpio_shift); - __REG(S5PC100_GPIO_BASE(S5PC100_GPIO_D_OFFSET)) |= (0x22 << gpio_shift); + reg = S5PC100_GPIO_BASE(S5PC100_GPIO_D_OFFSET); + reg += S5PC1XX_GPIO_CON_OFFSET; } + value = readl(reg); + value &= ~(0xff << gpio_shift); + value |= (0x22 << gpio_shift); + writel(value, reg); } /* -- 2.7.4