diff mbox

[U-Boot,15/24] mxc_i2c: add i2c_regs argument to i2c_imx_stop

Message ID 1340338339-11626-15-git-send-email-troy.kisky@boundarydevices.com
State Superseded
Delegated to: Heiko Schocher
Headers show

Commit Message

Troy Kisky June 22, 2012, 4:12 a.m. UTC
This is prep work for CONFIG_I2C_MULTI_BUS.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
 drivers/i2c/mxc_i2c.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Marek Vasut June 22, 2012, 5:06 p.m. UTC | #1
Dear Troy Kisky,

> This is prep work for CONFIG_I2C_MULTI_BUS.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

Acked-by: Marek Vasut <marex@denx.de>


> ---
>  drivers/i2c/mxc_i2c.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index 802f70f..cb061f7 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -199,9 +199,8 @@ static int tx_byte(struct mxc_i2c_regs *i2c_regs, u8
> byte) /*
>   * Stop I2C transaction
>   */
> -void i2c_imx_stop(void)
> +static void i2c_imx_stop(struct mxc_i2c_regs *i2c_regs)
>  {
> -	struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE;
>  	unsigned int temp = readb(&i2c_regs->i2cr);
> 
>  	temp &= ~(I2CR_MSTA | I2CR_MTX);
> @@ -331,7 +330,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar
> *buf, int len) buf[i] = readb(&i2c_regs->i2dr);
>  	}
> 
> -	i2c_imx_stop();
> +	i2c_imx_stop(i2c_regs);
> 
>  	return ret;
>  }
> @@ -355,7 +354,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar
> *buf, int len) return ret;
>  	}
> 
> -	i2c_imx_stop();
> +	i2c_imx_stop(i2c_regs);
> 
>  	return ret;
>  }

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index 802f70f..cb061f7 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -199,9 +199,8 @@  static int tx_byte(struct mxc_i2c_regs *i2c_regs, u8 byte)
 /*
  * Stop I2C transaction
  */
-void i2c_imx_stop(void)
+static void i2c_imx_stop(struct mxc_i2c_regs *i2c_regs)
 {
-	struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE;
 	unsigned int temp = readb(&i2c_regs->i2cr);
 
 	temp &= ~(I2CR_MSTA | I2CR_MTX);
@@ -331,7 +330,7 @@  int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
 		buf[i] = readb(&i2c_regs->i2dr);
 	}
 
-	i2c_imx_stop();
+	i2c_imx_stop(i2c_regs);
 
 	return ret;
 }
@@ -355,7 +354,7 @@  int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
 			return ret;
 	}
 
-	i2c_imx_stop();
+	i2c_imx_stop(i2c_regs);
 
 	return ret;
 }