[U-Boot] [PATCH 12/31] iMX28: Add I2C bus driver

Heiko Schocher
2011-09-09T05:45:13Z

Hello Marek,

Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Detlev Zundel <dzu@denx.de>
> ---
> drivers/i2c/Makefile | 1 +
> drivers/i2c/mxs_i2c.c | 243 +++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 244 insertions(+), 0 deletions(-)
> create mode 100644 drivers/i2c/mxs_i2c.c

only one minor comment ...

[...]
> diff --git a/drivers/i2c/mxs_i2c.c b/drivers/i2c/mxs_i2c.c
> new file mode 100644
> index 0000000..cae50b1
> --- /dev/null
> +++ b/drivers/i2c/mxs_i2c.c
> @@ -0,0 +1,243 @@
[...]
> +int mxs_i2c_wait_for_ack(void)
> +{
> + struct mx28_i2c_regs *i2c_regs = (struct mx28_i2c_regs *)MXS_I2C0_BASE;
> + uint32_t tmp;
> + int timeout = MXS_I2C_MAX_TIMEOUT;
> +
> + for (;;) {
> + tmp = readl(&i2c_regs->hw_i2c_ctrl1);
> + if (tmp & I2C_CTRL1_NO_SLAVE_ACK_IRQ) {
> + debug("MXS I2C: No slave ACK\n");
> + goto err;
> + }
> +
> + if (tmp & (
> + I2C_CTRL1_EARLY_TERM_IRQ | I2C_CTRL1_MASTER_LOSS_IRQ |
> + I2C_CTRL1_SLAVE_STOP_IRQ | I2C_CTRL1_SLAVE_IRQ
> + )) {

Checkpatch don;t beats here, but I think, two line are not necessary
here, just do a:

I2C_CTRL1_SLAVE_STOP_IRQ | I2C_CTRL1_SLAVE_IRQ)) {

Beside of that, patch looks good to me, so:

Acked-by: Heiko Schocher<hs@denx.de>

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany