Added i2c support for omap4. Tested on pcm049.
Driver based on linux kernel implementation.
Also added a shift to access 16-bit registers
to make support for OMAP730/850 possible.
If accessing a non existing slave the bus will go into arbitration mode.
It's unable to recover from it.
Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Modified the i2c_imx driver to support data-only transfers, without
command byte. This allows to construct more complex i2c transfers
and support non genuine devices like Atmel ATxx secure memory, where the
master reads data after a write command.
Signed-off-by: Rosen Kolev <rosen.kolev@amk-drives.bg>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
strange behaviour was observed with actual driver : bus lock, probe of
absent adresses, wrong data read.
This patch sync the driver with linux's one and after a few tests, we
don't see anymore strange behaviour (tested on i.MX27).
Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Makes sure that the STOP condition is transmitted before the I2C
controller is disabled.
This fixes a problem where writing to an external EEPROM was not working
because the EEPROM waits until the STOP before initiating the write
internally.
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Export mc13892_reg_read, mc13892_reg_write and mc13892_set_bits
function instead of exposing the i2c interface.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Export mc9sdz60_reg_read, mc9sdz60_reg_write and mc9sdz60_set_bits
function instead of exposing the i2c interface.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
loop in i2c_imx_acked() in low bit rates it takes some time until the
ACK comes in.
Also add a delay before polling for bus not busy in i2c_imx_read.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
During i2c read the original pattern was:
1. write i2c slave address
2. wait for transmit complete + clear IIF
3. wait for receive acknowledge
4. wait for IIF interrupt
Due to the clear of the I2SR register, the IIF flag was cleared, too. So
in step 4 the Interrupt wasn't detected. To fix this problem, we move
the clean of IIF before the writing of the slave address. So that it
looks this way:
0. clear IIF
1. write i2c slave address
2. wait for transmit complete
3. wait for receive acknowledge
4. wait for IIF interrupt
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>