aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2011-06-01I2C: Add driver for ST-Ericsson U8500 i2cMichael Brandt
Signed-off-by: John Rigby <john.rigby@linaro.org> CC: Heiko Schocher <hs@denx.de>
2011-04-28i2c, soft_i2c: deblock bus if switching to another i2c busHeiko Schocher
Deblock i2c bus when switching to another i2c bus, if using i2c_set_bus_num(). Signed-off-by: Heiko Schocher <hs@denx.de> cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-27Replace obsolete e-mail addressAlbert ARIBAUD
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-04-27I2C: mv_i2c: add multi bus supportLei Wen
Add the ability to support multiple i2c bus for mv_i2c Acked-by: Heiko Schocher <hs@denx.de> Acked-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-04-27mv_i2c: use structure to replace the direclty defineLei Wen
Add i2c_clk_enable in the cpu specific code, since previous platform it, while new platform don't need. In the pantheon and armada100 platform, this function is defined as NULL one. Acked-by: Heiko Schocher <hs@denx.de> Acked-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-04-27mv_i2c: fix timeout value to be consistent with commentsLei Wen
The original 10000 value would be 100ms, which is not the comments said. Acked-by: Heiko Schocher <hs@denx.de> Acked-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-04-27pxa: move i2c driver to the common placeLei Wen
For better sharing with other platform other than pxa's, it is more convenient to put the driver to the common place. Acked-by: Heiko Schocher <hs@denx.de> Acked-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-04-27IMX: MX31: Cleanup include files and drop nasty #ifdef in driversStefano Babic
As exception among the i.MX processors, the i.MX31 has headers without general names (mx31-regs.h, mx31.h instead of imx-regs.h and clock.h). This requires several nasty #ifdef in the drivers to include the correct header. The patch cleans up the driver and renames the header files as for the other i.MX processors. Signed-off-by: Stefano Babic <sbabic@denx.de>
2011-04-14I2C: OMAP: detect more devices when probing an i2c busNick Thompson
The omap24xx driver only seems to support devices that have a single subaddress byte. With these types of devices, the first access in a bus transaction is usually a write (writes the subaddress) followed by either a read or write to access the devices registers. Many such devices will respond to a read as the first access, but there are at least some that will NACK such a read. (e.g. ADV7180.) The probe function attempts to detect a devices ACK to a read access only and fails to find devices that NACK a read. This commit modifies the probe function to start a write instead. This detects devices that respond to reads (since they must also respond to writes) as well as those that only respond to writes. The bus is immediately set to idle after a (N)ACK avoiding actually writing anything to the device. Signed-off-by: Nick Thompson <nick.thompson@ge.com>
2011-02-02I2C: mxc_i2c: address failure with mx35 processorStefano Babic
There is sporadic failures when more as one I2C slave is on the bus and the processor tries to communicate with more as one slave. The problem was seen on a mx35pdk (two I2C slaves, PMIC controller and CAN/RTC chip). The current driver uses the IIF bit in the status register to check if the bus is busy or not. According to the manual, this is not correct, because the IIB bit should be checked. Not only, to check if a transfer is finished must be checked the ICF bit, and this is not tested at all. This patch comes from analyse with a corresponding driver provided by Freescale as part of the LTIB tool. Comparing the two drivers, it appears that the current u-boot driver checks the wrong bits, and depending on race condition, the transfer can be successful or not. The patch gets rid also of own debug function (DPRINTF), replaced with the general debug(). Tested on Freescale mx35pdk. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
2011-02-02I2C: mxc_i2c: get rid of __REG accessStefano Babic
This driver accesses to processor's register via __REG macros, that are removed (or are planned to be removed) and replaced by C structures. This patches replaces all occurrencies of __REG macros. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
2011-02-02mxc_i2c: Add support for the i.MX35 processorStefano Babic
Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
2011-02-02mxc_i2c: add support for MX53 processorLiu Hui-R64343
This patch add I2C support for Freescale MX53 processor Signed-off-by: Jason Liu <r64343@freescale.com>
2011-01-27Fix at91 includes in soft_i2c driverRyan Mallon
Make at91 header includes in soft_i2c depend only on CONFIG_AT91FAMILY rather than individual SoCs. Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> Acked-by: Reinhard Meyer<u-boot@emk-elektronik.de>
2010-12-21Move DECLARE_GLOBAL_DATA_PTR to file scopeJohn Rigby
It can be optimised out by the compiler otherwise resulting in obscure errors like a board not booting. This has been documented in README since 2006 when these were first fixed up for GCC 4.x. Signed-off-by: John Rigby <john.rigby@linaro.org> Fix some additional places. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-By: Albert ARIBAUD <albert.aribaud@free.fr>
2010-11-17Switch from archive libraries to partial linkingSebastien Carlier
Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
2010-10-29Merge branch 'master' of git://git.denx.de/u-boot-samsungWolfgang Denk
2010-10-28Add generic support for samsung s3c2440C Nauman
This patch adds generic support for the Samsung s3c2440 processor. Global s3c24x0 changes to struct members converting from upper case to lower case. Signed-off-by: Craig Nauman <cnauman@diagraph.com> Cc: kevin.morfitt@fearnside-systems.co.uk Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2010-10-25ARMV7: OMAP: I2C driver: Fix bug found in 37XX testingSteve Sakoman
On OMAP36/37XX the standard on chip pullups are not sufficient to ensure proper i2c operation without external pullups or switching to high speed mode and enabling special on chip pullups. This is an issue for Beagle xM, which does not have external pullups on the expansion board i2c lines. The issue manifests itself as an AL (arbitration lost) error when probing for a non-existent device (i.e. on a Beagle xM with no expansion boards attached). This issue does not occur on expansion boards that include pullups or on Overo 37XX COM's since they include pull-ups. This patch fixes the issue by checking for the AL bit in the i2c_probe function. Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
2010-10-20ARMV7: OMAP: I2C driver: Restructure i2c_probe functionSteve Sakoman
This patch removes the "magic number" delays and instead monitors state changes in the status register bits. Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org> Tested-by: Heiko Schocher <hs@denx.de>
2010-10-20ARMV7: OMAP: I2C driver: Restructure i2c_write_byte functionSteve Sakoman
This patch removes the "magic number" delays and instead monitors state changes in the status register bits. Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org> Tested-by: Heiko Schocher <hs@denx.de>
2010-10-20ARMV7: OMAP: I2C driver: Restructure i2c_read_byte functionSteve Sakoman
This patch removes the "magic number" delays and instead monitors state changes in the status register bits. Signed-off-by: Steve Sakoman <steve.sakomanlinaro.org> Tested-by: Heiko Schocher <hs@denx.de>
2010-10-20ARMV7: OMAP: I2C driver: Use same timeout value as linux kernel driverSteve Sakoman
This patch matches the poll interval (1 millisecond) and timeout (1 second) used in the linux driver. It also adds a return value of 0 in the event of a timeout error and cleans up some formatting errors in that section of the code. Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org> Tested-by: Heiko Schocher <hs@denx.de>
2010-09-23ppc4xx: Move ppc4xx headers to powerpc include directoryStefan Roese
This patch moves some ppc4xx related headers from the common include directory (include/) to the powerpc specific one (arch/powerpc/include/asm/). This way to common include directory is not so cluttered with files. Signed-off-by: Stefan Roese <sr@denx.de>
2010-09-19i2c, omap24xx: set bus_initialized only after relocation.Heiko Schocher
Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher <hs@denx.de>
2010-09-10Prepare v2010.09-rc1Wolfgang Denk
Coding style cleanup. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-08-30i2c: rewrite mvtwsi, support orion5x and kirkwoodAlbert Aribaud
This rewrite of the mvtwsi driver is 25% smaller and much faster and simpler than the previous code. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr> Acked-by: Prafulla Wadaskar<prafulla@marvell.com> Acked-by: Heiko Schocher<hs@denx.de>
2010-08-30i2c: rename kirkwood_i2c to mvtwsiAlbert Aribaud
This driver is not kirkwood-specific and can also be used e.g. by orion5x. Rename to a SoC-neutral name. Signed-off-by: Albert Aribaud <albert.aribaud@free.fr> Acked-by: Prafulla Wadaskar<prafulla@marvell.com> Acked-by: Heiko Schocher<hs@denx.de>
2010-08-23i2c: omap2+: change header guard to be genericNishanth Menon
Make the header guard to be generic to stop conflicting with omap2 i2c header file arch/arm/include/asm/arch-omap24xx/i2c.h Cc: Steve Sakoman <steve@sakoman.com> Cc: Heiko <hs@denx.de> Cc: Sandeep Paulraj <s-paulraj@ti.com> Cc: Wolfang Denk <wd@denx.de> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Steve Sakoman <steve@sakoman.com>
2010-08-05ARMV7: Modify i2c driver for more reliable operation on OMAP4Steve Sakoman
This patch modifies the init routine to follow the TRM recommendations. It also modifies the i2c_read_byte function to reflect subtle differences between the i2c controller in OMAP3 and OMAP4. Signed-off-by: Steve Sakoman <steve@sakoman.com> Acked-by: Nishanth Menon <menon.nishanth@gmail.com> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-07-22i2c: soft_i2c: add simple GPIO implementationMike Frysinger
Since the vast majority of GPIO I2C implementations behave the same way, support the common GPIO framework with default settings. This adds two new defines CONFIG_SOFT_I2C_GPIO_{SCL,SDA} so that boards which want GPIO I2C support need only define these. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Tested-by: Thomas Chou <thomas@wytron.com.tw>
2010-07-05ARMV7: Restructure OMAP i2c driver to allow code sharing between OMAP3 and OMAP4Steve Sakoman
This patch modifies the omap24xx driver so that it will also work with OMAP4. Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-05-05Blackfin: TWI/I2C: implement multibus supportMike Frysinger
In order to do this cleanly, the register accesses have to be converted to a C struct (base pointer), so do that in the process. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-04-19fsl_i2c: Added a callpoint for i2c_board_late_initRichard Retanubun
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.
2010-04-13Replace "#include <asm-$ARCH/$FILE>" with "#include <asm/$FILE>"Peter Tyser
The appropriate include/asm-$ARCH directory should already by symlinked to include/asm so using the whole "asm-$ARCH" path is unnecessary. This change should also allow us to move the include/asm-$ARCH directories into their appropriate lib/$ARCH/ directories. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-04-06i2c: Move PPC4xx I2C driver into drivers/i2c directoryStefan Roese
This patch moves the PPC4xx specific I2C device driver into the I2C drivers directory. All 4xx config headers are updated to include this driver. Signed-off-by: Stefan Roese <sr@denx.de>
2010-03-21mod change 755 => 644 for multiple filesThomas Weber
I executed 'find . -name "*.[chS]" -perm 755 -exec chmod 644 {} \;' Signed-off-by: Thomas Weber <swirl@gmx.li> Add some more: neither Makefile nor config.mk need execute permissions. Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-02-12convert common files to new SoC accessJens Scharsig
* add's a warning to all files, which need update to new SoC access * convert common files in cpu/../at91 and a lot of drivers to use c stucture SoC access Signed-off-by: Jens Scharsig <js_at_ng@scharsoft.de>
2010-01-23SPEAr : i2c driver support added for SPEAr SoCsVipin KUMAR
SPEAr SoCs contain a synopsys i2c controller. This patch adds the driver for this IP. Signed-off-by: Vipin <vipin.kumar@st.com>
2010-01-23Kirkwood: Upgated licencing for files imported from linux source to GPLv2 or ↵Prafulla Wadaskar
later These are few files directly imported from Linux kernel source. Those are not modifyed at all ar per strategy. These files contains source with GPLv2 only whereas u-boot expects GPLv2 or latter These files are updated for the same from prior permission from original writes Acked-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2009-11-27Add a unified s3c24x0 header filekevin.morfitt@fearnside-systems.co.uk
This patch adds a unified s3c24x0 cpu header file that selects the header file for the specific s3c24x0 cpu from the SOC and CPU configs defined in board config file. This removes the current chain of s3c24-type #ifdef's from the s3c24x0 code. Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2009-11-27Move s3c24x0 header files to asm-arm/arch-s3c24x0/kevin.morfitt@fearnside-systems.co.uk
This patch moves the s3c24x0 header files from include/ to include/asm-arm/arch-s3c24x0/. checkpatch.pl showed 2 errors and 3 warnings. The 2 errors were both due to a non-UTF8 character in David M?ller's name: ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #489: FILE: include/asm-arm/arch-s3c24x0/s3c2410.h:3: + * David M?ller ELSOFT AG Switzerland. d.mueller@elsoft.ch As David's name correctly contains a non-UTF8 character I haven't fixed these errors. The 3 warnings were all because of the use of 'volatile' in s3c24x0.h: WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #673: FILE: include/asm-arm/arch-s3c24x0/s3c24x0.h:35: +typedef volatile u8 S3C24X0_REG8; +typedef volatile u16 S3C24X0_REG16; +typedef volatile u32 S3C24X0_REG32; I'll fix these errors in another patch. Tested by running MAKEALL for ARM8 targets and ensuring there were no new errors or warnings. Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2009-11-23at91: Extended soft_i2c driver for AT91SAM9263 SoCDaniel Gorsulowski
While hard_i2c support is not available (see http://lists.denx.de/pipermail/u-boot/2009-March/049751.html), this patch enables soft_i2c on AT91SAM9263 SoC. Signed-off-by: Daniel Gorsulowski <Daniel.Gorsulowski@esd.eu>
2009-11-16OMAP2/3: I2C: Add support for second and third busDirk Behme
Add support to use second and third I2C bus, too. Bus 0 is still the default, but by calling i2c_set_bus_num(1/2) before doing I2C accesses, code can switch to bus 1 and 2, too. Don't forget to switch back afterwards, then. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
2009-10-30new PCA9564 i2c bridge driverValentin Yakovenkov
Signed-off-by: Valentin Yakovenkov <yakovenkov@niistt.ru> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-30Blackfin: TWI/I2C: implement bus speed get/set functionsMike Frysinger
While we're here, improve the speed calculation a bit to match the HRM. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-30Blackfin: TWI/I2C: add timeout to transferMike Frysinger
The current transfer code relies on ctrlc() to abort transfers, but this requires user interactivity. Naturalize the process with a timeout. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-13Clean-up of s3c24x0 drivers excluding nand driverkevin.morfitt@fearnside-systems.co.uk
This patch re-formats the arm920t s3c24x0 driver files, excluding the nand driver, in preparation for changes to add support for the Embest SBC2440-II Board. The changes are as follows: - re-indent the code using Lindent - make sure register layouts are defined using a C struct - replace the upper-case typedef'ed C struct names with lower case non-typedef'ed ones - make sure registers are accessed using the proper accessor functions - run checkpatch.pl and fix any error reports It assumes the following patch has been applied first: - [U-Boot][PATCH-ARM] CONFIG_SYS_HZ fix for ARM902T S3C24X0 Boards, 05/09/2009 - patches 1/4 and 2/4 of this series Tested on an Embest SBC2440-II Board with local u-boot patches as I don't have any s3c2400 or s3c2410 boards but need this patch applying before I can submit patches for the SBC2440-II Board. Also, temporarily modified sbc2410x, smdk2400, smdk2410 and trab configs to use the mtd nand driver (which isn't used by any board at the moment), ran MAKEALL for all ARM9 targets and no new warnings or errors were found. Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2009-09-28fsl_i2c: Do not generate STOP after read.Joakim Tjernlund
__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 Tjernlund
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>