aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2013-01-08I2C: Driver changes for FDT supportRajeshwari Shinde
Functions added to get the I2C bus number and reset I2C bus using FDT node. Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2012-12-11designware_i2c.h: Define IC_CLK only if not already defined in config fileArmando Visconti
Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c.h: Fixed the correct values for SCL low/high timeArmando Visconti
Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c: Fixed the setting of the i2c bus speedArmando Visconti
There are three couple (hcnt/lcnt) of registers for each speed (SS/FS/HS). The driver needs to set the proper couple of regs according to what speed we are setting. Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c: Added s/w generation of stop bitArmando Visconti
In the newer versions of designware i2c IP there is the possibility of configuring it with IC_EMPTYFIFO_HOLD_MASTER_EN=1, which basically requires the s/w to generate the stop bit condition directly, as the h/w will not automatically generate it when TX_FIFO is empty. To avoid generation of an extra 0x0 byte sent as data, the IC_STOP command must be sent along with the last IC_CMD. This patch always writes bit[9] of ic_data_cmd even in the older versions, assuming that it is a noop there. Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11designware_i2c.c: Added the support for MULTI_BUSArmando Visconti
This patch adds the capability to switch between 10 different I2C busses (from 0 to 9). Signed-off-by: Armando Visconti <armando.visconti@st.com>
2012-12-11drivers:i2c: Modify I2C driver for Exynos4Piotr Wilczek
This patch modifies the S3C i2c driver to support both Exynos4 and Exynos5 Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Minkyu Kang <mk7.kang@samsung.com>
2012-12-11omap24xx_i2c: Handle OMAP5 like OMAP2,3,4Vincent Stehlé
OMAP5 has 8b i2c data register field, like OMAP2, 3 and 4. Handle in the same way. This fixes the following error on OMAP5: OMAP5430 EVM # mmc rescan timed out in wait_for_bb: I2C_STAT=1410 twl6035: could not turn on LDO9. Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
2012-12-11mxs: i2c: Implement algorithm to set up arbitrary i2c speedMarek Vasut
This algorithm computes the values of TIMING{0,1,2} registers for the MX28 I2C block. This algorithm was derived by using a scope, but the result seems correct. The resulting values programmed into the registers do not correlate with the contents in datasheet. When using the values from the datasheet, the I2C clock were completely wrong. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Wolfgang Denk <wd@denx.de>
2012-12-11mxs: i2c: Restore speed setting after block resetMarek Vasut
The I2C block reset configures the I2C bus speed to strange value. Read the I2C speed from the block before reseting the block and restore it afterwards, so the I2C operates correctly. This issue can be replicated by doing unsuccessful I2C transfer, after such transfer finishes, the I2C block clock speed is misconfigured. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-11i2c: mxs: Fix TIMING2 register valueMarek Vasut
According to FSL, the value in the TIMING2 register shall be 0x00300030 instead of what's written in the datasheet. This new value correlates with older STMP36xx datasheet. Issues were detected in Linux when this register was misconfigured, so write this correct value. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-11i2c: mxs: Use i2c_set_bus_speed() in i2c_init()Marek Vasut
Use i2c_set_bus_speed() in i2c_init() within the mxs i2c driver to avoid duplication of code. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-11i2c: mxs: Implement i2c_get/set_bus_speed()Marek Vasut
This patch implements the setup and retrieval functions for the I2C bus speed on the MXS I2C IP. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-11i2c: mxs: Abstract out the MXS I2C speed setupMarek Vasut
This patch pulls out the I2C speed setup from the i2c_init() call and implements the bus configuration lookup table with register values that needs to be programmed into the I2C IP to run at particular speed. This patch is a first step towards implementing run-time I2C bus speed configuration for the MXS I2C IP. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com>
2012-12-11i2c: Staticize local functions in mxc i2c driverMarek Vasut
Some functions in the MXC i2c driver were not static, fix this by making them so. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Stefano Babic <sbabic@denx.de>
2012-12-11soft_i2c: add necessary includes for AVR32Andreas Bießmann
Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
2012-10-26Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2012-10-26arm: Remove support for lpc2292Marek Vasut
This stuff has been rotting in the tree for a year now. Remove it. Signed-off-by: Marek Vasut <marex@denx.de>
2012-10-25drivers/i2c/fsl_i2c.c: sparse fixKim Phillips
fsl_i2c.c:217:14: warning: symbol 'get_i2c_clock' was not declared. Should it be static? Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Acked-by: Heiko Schocher <hs@denx.de>
2012-10-16i2c: sh_i2c: use setbits/clrbits macroTetsuyuki Kobayashi
Use setbits/clrbits macro when read-modify-write register. Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2012-10-16i2c: sh_i2c.c: check error in i2c_read and i2c_writeTetsuyuki Kobayashi
Before this patch, i2c_{read,write} always returned 0. Check TACK in i2c_raw_{read,write} so that i2c_{read,write} return non-zero when error. Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-16i2c: sh_i2c: enable i2c_probeTetsuyuki Kobayashi
Before this patch i2c_probe() always returned 0 and "i2c probe" command did not work properly. Modify i2c_set_addr() to check TACK when waiting DTE and make i2c_probe() call this function. Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-16i2c: sh_i2c.c: support I2C2, I2C3 and I2C4Tetsuyuki Kobayashi
sh_i2c.c support I2C0 and I2C1. This patch extends it to I2C4. Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-16i2c: sh_i2c.c: adjust for SH73A0Tetsuyuki Kobayashi
Adjust i2c_raw_read() in sh_i2c.c to work for SH73A0. After this patch, "i2c md" and "i2c mw" command on U-Boot work properly on KZM-A9-GT board. Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-16i2c: sh_i2c.c: correct BUSY bit define in ICSRTetsuyuki Kobayashi
Correct BUSY bit define in ICSR from (1<<3) to (1<<4). Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-16i2c: sh_i2c.c: support iccl and icch extensionTetsuyuki Kobayashi
R-mobile SoC (at least SH73A0) has extension bits to store 8th bit of iccl and icch. This patch add support for the extentin bits. Acked-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
2012-10-15imx: Use MXC_I2C_CLK in imx i2c driverMatthias Weisser
i2c didn't work on imx25 due to missing MXC_IPG_PERCLK. Now using MXC_I2C_CLK on all imx systems using i2c. Signed-off-by: Matthias Weisser <weisserm@arcor.de> Acked-by: Stefano Babic <sbabic@denx.de>
2012-10-15Tegra20: Move some include files to arch-tegra for sharing with Tegra30Tom Warren
The move is pretty straight-forward. ap20.h and tegra20.h were renamed to ap.h and tegra.h. Some files remain in arch-tegra20 but 'include' a file in 'arch-tegra' with #defines & structs that will be common between T20 and T30 HW. HW-specific #defines, etc. stay in the 'arch-tegra20' 'root' file. All boards build OK w/MAKEALL -s tegra20. Checkpatch.pl runs clean. Seaboard works OK. Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-10-03i2c: sh: Remove irq_wait functionNobuhiro Iwamatsu
irq_wait function is not referred to from anywhere. Reported-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2012-09-21Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2012-09-10Tegra: Change Tegra20 to Tegra in common code, prep for T30Tom Warren
Convert TEGRA20_ defines to either TEGRA_ or NV_PA_ where appropriate. Convert tegra20_ source file and function names to tegra_, also. Upcoming Tegra30 port will use common code/defines/names where possible. Signed-off-by: Tom Warren <twarren@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2012-09-06omap4 i2c: add support for i2c bus 4Koen Kooi
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
2012-09-01mxs: Convert sys_proto.h prefixes to 'mxs'Otavio Salvador
The sys_proto.h functions (except the boot modes) are compatible with i.MX233 and i.MX28 so we use 'mxs' prefix for its methods. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-09-01tegra20: rename tegra2 -> tegra20Allen Martin
This is make naming consistent with the kernel and devicetree and in preparation of pulling out the common tegra20 code. Signed-off-by: Allen Martin <amartin@nvidia.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-09-01mxs: prefix register structs with 'mxs' prefixOtavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-09-01omap24xx_i2c: add 2-byte address supportIlya Yanok
Various devices like EEPROMs require 2-byte address support to be properly accessed. This patch adds this support for OMAP2/3/4 I2C controller driver. I've tested it with EEPROM (16 bit address) and TPS65217 chip (8 bit address) on TI Beaglebone board. Unfortunately I don't have access to any compatible hardware with 16bit data register so I can't test if those #ifdef clauses really work. CC: Tom Rini <trini@ti.com> Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
2012-07-31I2C: Add support for Multi channelRajeshwari Shinde
This adds multiple i2c channel support for I2C. Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-07-31I2C: Modify the I2C driver for EXYNOS5Rajeshwari Shinde
This patch modifies the S3C I2C driver to suppport EXYNOS5. The cahnges made to driver are as follows: - I2C base address is passed as a parameter to many functions to avoid multiple #ifdef - Channel initialisation is moved to a commom funation as it is required by i2c_init. - Hardcoding for I2CCON_ACKGEN removed. - Replaced printf with debug. - Checkpatch issues resolved. - Pinmux setting will be done in board/samsung/smdk5250/smdk5250.c to avoid repeated setting of gpio lines, as it have multi bus support. Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-07-31I2C: Move struct s3c24x0_i2c to a common place.Rajeshwari Shinde
struct s3c24x0_i2c is being moved to common local header file so that the same can be used by s3c series and exynos series SoCs. Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-07-31mxc_i2c: finish adding CONFIG_I2C_MULTI_BUS supportTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: add bus recovery supportTroy Kisky
Add support for calling a function that will toggle the SCL line to return the bus to idle condition. The actual toggling function is added in a later patch. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: prep work for multiple busses supportTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: add i2c_regs argument to i2c_imx_stopTroy Kisky
This is prep work for CONFIG_I2C_MULTI_BUS. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>
2012-07-31mxc_i2c: add retriesTroy Kisky
Retry unexpected hardware errors. This will not retry a received NAK. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: check for arbitration lostTroy Kisky
No need to continue waiting if arbitration lost. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>
2012-07-31mxc_i2c: change slave addr if conflicts with destination.Troy Kisky
The i2c controller cannot be both master and slave in the same transaction. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: don't disable controller after every transactionTroy Kisky
This helps in a multiple bus master environment which is why I also added a wait for bus idle. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-07-31mxc_i2c: place i2c_reset code inlineTroy Kisky
imx_reset is only referenced once so move to that location. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>
2012-07-31mxc_i2c: place imx_start code inlineTroy Kisky
imx_start is only referenced once so move to that location. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>
2012-07-31mxc_i2c: remove redundant readTroy Kisky
wait_for_sr_state returns i2sr on success so no need to read again. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Marek Vasut <marex@denx.de>