mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-11 22:03:15 +00:00
ba6fb2f6ac
This adds support for clock stretching to the i2c-gpio driver. This is accomplished by switching the GPIO used for the SCL line to an input when it should be driven high, and polling on the SCL line value until it goes high (indicating that the I2C slave is no longer pulling it low). This is enabled by default; for gpios which cannot be configured as inputs, the i2c-gpio,scl-output-only property can be used to fall back to the previous behavior. Signed-off-by: Michael Auchter <michael.auchter@ni.com> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
41 lines
892 B
Text
41 lines
892 B
Text
I2C gpio device binding
|
|
=======================
|
|
|
|
Driver:
|
|
- drivers/i2c/i2c-gpio.c
|
|
|
|
Software i2c device-tree node properties:
|
|
Required:
|
|
* #address-cells = <1>;
|
|
* #size-cells = <0>;
|
|
* compatible = "i2c-gpio";
|
|
* gpios = <sda ...>, <scl ...>;
|
|
|
|
Optional:
|
|
* i2c-gpio,delay-us = <5>;
|
|
The resulting transfer speed can be adjusted by setting the delay[us]
|
|
between gpio-toggle operations. Speed [Hz] = 1000000 / 4 * udelay[us],
|
|
It not defined, then default is 5us (~50KHz).
|
|
* i2c-gpio,deblock
|
|
Run deblocking sequence when the driver gets probed.
|
|
* i2c-gpio,scl-output-only;
|
|
Set if SCL is an output only
|
|
|
|
Example:
|
|
|
|
i2c-gpio@1 {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
compatible = "i2c-gpio";
|
|
gpios = <&gpd1 0 GPIO_ACTIVE_HIGH>, /* SDA */
|
|
<&gpd1 1 GPIO_ACTIVE_HIGH>; /* CLK */
|
|
|
|
i2c-gpio,delay-us = <5>;
|
|
|
|
some_device@5 {
|
|
compatible = "some_device";
|
|
reg = <0x5>;
|
|
...
|
|
};
|
|
};
|