forked from Minki/linux
7ef97e9a31
Having a board where the I2C bus locks up occasionally made it clear that the bus recovery in the i2c-davinci driver will only work on some boards, because on regular boards, this will only toggle GPIO lines that aren't muxed to the actual pins. The I2C controller on SoCs like da850 (and da830), Keystone 2 has the built-in capability to bit-bang its lines by using the ICPFUNC registers of the i2c controller. Implement the suggested procedure by toggling SCL and checking SDA using the ICPFUNC registers of the I2C controller when present. Allow platforms to indicate the presence of the ICPFUNC registers with a has_pfunc platform data flag and add optional DT property "ti,has-pfunc" to indicate the same in DT. Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Tested-by: Michael Lawnick <michael.lawnick@nokia.com> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Mike Looijmans <milo-software@users.sourceforge.net> [grygorii.strashko@ti.com: combined patches from Ben Gardiner and Mike Looijmans and reimplemented ICPFUNC bus recovery using I2C bus recovery infrastructure] Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
32 lines
850 B
Plaintext
32 lines
850 B
Plaintext
* Texas Instruments Davinci I2C
|
|
|
|
This file provides information, what the device node for the
|
|
davinci i2c interface contain.
|
|
|
|
Required properties:
|
|
- compatible: "ti,davinci-i2c";
|
|
- reg : Offset and length of the register set for the device
|
|
|
|
Recommended properties :
|
|
- interrupts : standard interrupt property.
|
|
- clock-frequency : desired I2C bus clock frequency in Hz.
|
|
- ti,has-pfunc: boolean; if defined, it indicates that SoC supports PFUNC
|
|
registers. PFUNC registers allow to switch I2C pins to function as
|
|
GPIOs, so they can by toggled manually.
|
|
|
|
Example (enbw_cmc board):
|
|
i2c@1c22000 {
|
|
compatible = "ti,davinci-i2c";
|
|
reg = <0x22000 0x1000>;
|
|
clock-frequency = <100000>;
|
|
interrupts = <15>;
|
|
interrupt-parent = <&intc>;
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
dtt@48 {
|
|
compatible = "national,lm75";
|
|
reg = <0x48>;
|
|
};
|
|
};
|