[U-Boot] [PATCH 12/31] iMX28: Add I2C bus driver
Marek Vasut
marek.vasut at gmail.com
Fri Sep 9 13:18:40 CEST 2011
On Friday, September 09, 2011 07:45:13 AM Heiko Schocher wrote:
> Hello Marek,
>
> Marek Vasut wrote:
> > Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> > Cc: Heiko Schocher <hs at denx.de>
> > Cc: Stefano Babic <sbabic at denx.de>
> > Cc: Wolfgang Denk <wd at denx.de>
> > Cc: Detlev Zundel <dzu at 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:
I think it's more readable as it is ... what do the others think ?
>
> Acked-by: Heiko Schocher<hs at denx.de>
>
> bye,
> Heiko
More information about the U-Boot
mailing list