aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/gpio/gpio-i2c.txt
blob: ad2743bc65ed6218ab691c775706d41ee9e200c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Device-Tree bindings for gpio i2c driver

A simple parameterized no-irq of_driven i2c->gpio expander,
cut down from gpio-pcf857x.c to be totally device-tree driven.

Suitable for any "memory-like" device, where a 1-byte i2c read yields data
which can safely be written back, possibly with a bit changed, with the
effect of changing only the output level of that bit's GPIO pin.

Required properties:
	- compatible = "gpio-i2c"
	- reg = i2c-address
	- gpio-controller
	- #gpio-cells = <1>;
	- ngpios = number of pins modeled

Example nodes:

&i2c_bus {
        gpio1: cpld@6c {
                compatible = "gpio-i2c";
		gpio-controller;
                reg = <0x6c>;
		#gpio-cells = <1>;
                ngpios = <160>; // 8bits for each reg 0..0x13
        };
};

_some_device_ {
	// pin controlled by bitmask 0x2 of byte 0x4 of gpio1
	enable-gpios = <&gpio1 33>;
}