summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/lpc32xx_i2c.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: lpc32xx: correct sanity check for requested bus speedVladimir Zapolskiy2015-08-181-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | LPC32xx has 3 I2C bus controllers, 2 of them are used as generic ones and their parent clock is HCLK and CLK_HI/CLK_LO registers are 10 bit wide. This means that if HCLK is 104MHz, then minimal configurable I2C clock speed is about 51KHz. Only USB OTG I2C bus controller CLK registers are 8 bit wide, thus in assumption that peripheral clock is 13MHz it allows to set the minimal bus speed about 25.5KHz. Check for negative half clock value is removed since it is always false. The change fixes the following problem for I2C busses 0 and 1: => i2c dev 0 Setting bus to 0 => i2c speed 100000 Setting bus speed to 100000 Hz Failure changing bus speed (-22) Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Tested-by: Sylvain Lemieux <slemieux@tycoint.com>
* i2c: lpc32xx: add support for OTG I2CSylvain Lemieux2015-08-181-3/+17
| | | | | | | | Updated the LPC32xx I2C driver to support the OTG I2C that is part of the USB module. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com> Acked-by: Marek Vasut <marex@denx.de>
* i2c: lpc32xx: fix write timeoutSylvain Lemieux2015-08-171-0/+2
| | | | | | Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_write" when parameters alen = 0 and len = 0. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
* i2c: lpc32xx: fix read timeoutSylvain Lemieux2015-08-171-5/+5
| | | | | | Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
* i2c: lpc32xx: use api to get hclk instead of fix valueSylvain Lemieux2015-08-171-1/+1
| | | | | | The HCLK is not constant and can take different value; use the api function to get the value of the HCLK for the I2C clock high and low computation. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
* lpc32xx: i2c: add LPC32xx I2C interface supportAlbert ARIBAUD \(3ADEV\)2015-04-101-0/+249
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
OpenPOWER on IntegriCloud