summaryrefslogtreecommitdiff
path: root/drivers/i2c/fsl_i2c.c
AgeCommit message (Collapse)AuthorFilesLines
2010-04-19fsl_i2c: Added a callpoint for i2c_board_late_initRichard Retanubun1-3/+13
This patch adds a callpoint in i2c_init that allows board specific i2c board initialization (typically for i2c bus reset) that is called after i2c_init operations, allowing the i2c_board_late_init function to use the pre-configured i2c bus speed and slave address.
2009-09-28fsl_i2c: Do not generate STOP after read.Joakim Tjernlund1-5/+6
__i2c_read always ends with a STOP condition thereby releasing the bus. It is cleaner to do the STOP magic in i2c_read(), like i2c_write() does. This may also help future multimaster systems which wants to hold on to the bus until all transactions are finished. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
2009-09-28fsl_i2c: Impl. AN2919, rev 5 to calculate FDR/DFSRJoakim Tjernlund1-35/+55
The latest AN2919 has changed the way FDR/DFSR should be calculated. Update the driver according to spec. However, Condition 2 is not accounted for as it is not clear how to do so. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
2009-09-28fsl_i2c: Add CONFIG_FSL_I2C_CUSTOM_{DFSR/FDR}Joakim Tjernlund1-3/+11
Some boards need a higher DFSR value than the spec currently recommends so give these boards the means to define there own. For completeness, add CONFIG_FSL_I2C_CUSTOM_FDR too. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
2009-09-28fsl_i2c: Wait for STOP condition to propagateJoakim Tjernlund1-4/+8
After issuing a STOP one must wait until the STOP has completed on the bus before doing something new to the controller. Also add an extra read of SR as the manual mentions doing that is a good idea. Remove surplus write of CR just before a write, isn't required and could potentially disturb the I2C bus. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
2009-09-06fsl_i2c: increase I2C timeout values and make them configurableTimur Tabi1-4/+20
The value of I2C_TIMEOUT in fsl_i2c.c has several problems. First, it is defined as CONFIG_HZ/4, but it is used as a count of microseconds, so it makes no sense to derive it from a clock rate. Second, the current value (250) is too low for some boards, so it needs to be increased. Third, the timeout necessary for multiple-master arbitration is larger than the timeout for basic read/write operations, so we shouldn't have a single constant for both timeouts. Finally, it would be nice if we could override these values on a per-board basis. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Wolfgang Denk <wd@denx.de> Tested-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Peter Tyser <ptyser@xes-inc.com>
2009-07-21i2c, mpc83xx: add CONFIG_SYS_I2C_INIT_BOARD for fsl_i2cHeiko Schocher1-0/+6
This patch adds the possibility to call a board specific i2c bus reset routine for the fsl_i2c bus driver, and adds this option for the keymile kmeter1 board. The deblock sequence for this board is implemented and tested in the following way: CR = 0x20 (release SDA and SCL pin) CR = 0xa0 (start read) dummy read dummy read if 2. dummy read == 0x00 3. dummy read CR = 0x80 (SDA and SCL now 1 SR = 0x86) CR = 0x00 (Modul reset SR=0x81) CR = 0x80 (SDA and SCL = 1, SR = 0x81) Signed-off-by: Heiko Schocher <hs@denx.de>
2009-03-0683xx, i2c: add mux support for fsl_i2cHeiko Schocher1-1/+21
This patch adds I2C mux support for the fsl_i2c driver. This allows you to add "new" i2c busses, which are reached over i2c muxes. For more infos, please look in the README and search for CONFIG_I2C_MUX. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2008-12-16i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functionsTimur Tabi1-16/+0
All implementations of the functions i2c_reg_read() and i2c_reg_write() are identical. We can save space and simplify the code by converting these functions into inlines and putting them in i2c.h. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-By: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-12-09Section name should be ".data", not "data"Trent Piepho1-4/+3
Signed-off-by: Trent Piepho <tpiepho@freescale.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD1-11/+11
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-28Add I2C frequency dividers for ColdFireTsiChung Liew1-1/+33
The existing I2C freqency dividers for FDR does not apply to ColdFire platforms; thus, a seperate table is added based on MCF5xxx Reference Manual Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com> Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com> Acked-by: Tabi Timur <timur@freescale.com>
2008-08-19i2c: Clean drivers/i2c/ MakefileMichal Simek1-2/+0
Signed-off-by: Michal Simek <monstr@monstr.eu>
2008-08-06Fix merge problemsStefan Roese1-7/+11
Signed-off-by: Stefan Roese <sr@denx.de>
2008-04-14Fix warnings introduced by I2C bus speed setting patchKumar Gala1-4/+3
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-03-27Add support for setting the I2C bus speed in fsl_i2c.cTimur Tabi1-9/+105
Add support to the Freescale I2C driver (fsl_i2c.c) for setting and querying the I2C bus speed. Current 8[356]xx boards define the CFG_I2C_SPEED macro, but fsl_i2c.c ignores it and uses conservative value when programming the I2C bus speed. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Andy Fleming <afleming@freescale.com>
2007-11-20drivers/i2c : move i2c drivers to drivers/i2cJean-Christophe PLAGNIOL-VILLARD1-0/+295
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>