xref: /freebsd-src/sys/contrib/device-tree/Bindings/i2c/i2c-gpio.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: GPIO bitbanged I2C
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
1082ea1a07SEmmanuel Vadot  - Wolfram Sang <wsa@kernel.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel VadotallOf:
13c66ec88fSEmmanuel Vadot  - $ref: /schemas/i2c/i2c-controller.yaml#
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadotproperties:
16c66ec88fSEmmanuel Vadot  compatible:
17c66ec88fSEmmanuel Vadot    items:
18c66ec88fSEmmanuel Vadot      - const: i2c-gpio
19c66ec88fSEmmanuel Vadot
20c66ec88fSEmmanuel Vadot  sda-gpios:
21c66ec88fSEmmanuel Vadot    description:
22c66ec88fSEmmanuel Vadot      gpio used for the sda signal, this should be flagged as
23c66ec88fSEmmanuel Vadot      active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
24c66ec88fSEmmanuel Vadot      from <dt-bindings/gpio/gpio.h> since the signal is by definition
25c66ec88fSEmmanuel Vadot      open drain.
26c66ec88fSEmmanuel Vadot    maxItems: 1
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  scl-gpios:
29c66ec88fSEmmanuel Vadot    description:
30c66ec88fSEmmanuel Vadot      gpio used for the scl signal, this should be flagged as
31c66ec88fSEmmanuel Vadot      active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
32c66ec88fSEmmanuel Vadot      from <dt-bindings/gpio/gpio.h> since the signal is by definition
33c66ec88fSEmmanuel Vadot      open drain.
34c66ec88fSEmmanuel Vadot    maxItems: 1
35c66ec88fSEmmanuel Vadot
36*cb7aa33aSEmmanuel Vadot  i2c-gpio,sda-output-only:
37*cb7aa33aSEmmanuel Vadot    description: sda as output only
38*cb7aa33aSEmmanuel Vadot    type: boolean
39*cb7aa33aSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  i2c-gpio,scl-output-only:
41c66ec88fSEmmanuel Vadot    description: scl as output only
42c66ec88fSEmmanuel Vadot    type: boolean
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  i2c-gpio,delay-us:
45c66ec88fSEmmanuel Vadot    description: delay between GPIO operations (may depend on each platform)
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  i2c-gpio,timeout-ms:
48c66ec88fSEmmanuel Vadot    description: timeout to get data
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  # Deprecated properties, do not use in new device tree sources:
51c66ec88fSEmmanuel Vadot  gpios:
52c66ec88fSEmmanuel Vadot    minItems: 2
53c66ec88fSEmmanuel Vadot    maxItems: 2
54c66ec88fSEmmanuel Vadot    description: sda and scl gpio, alternative for {sda,scl}-gpios
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadot  i2c-gpio,sda-open-drain:
57c66ec88fSEmmanuel Vadot    type: boolean
58c66ec88fSEmmanuel Vadot    deprecated: true
59c66ec88fSEmmanuel Vadot    description: this means that something outside of our control has put
60c66ec88fSEmmanuel Vadot      the GPIO line used for SDA into open drain mode, and that something is
61c66ec88fSEmmanuel Vadot      not the GPIO chip. It is essentially an inconsistency flag.
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot  i2c-gpio,scl-open-drain:
64c66ec88fSEmmanuel Vadot    type: boolean
65c66ec88fSEmmanuel Vadot    deprecated: true
66c66ec88fSEmmanuel Vadot    description: this means that something outside of our control has put the
67c66ec88fSEmmanuel Vadot      GPIO line used for SCL into open drain mode, and that something is not
68c66ec88fSEmmanuel Vadot      the GPIO chip. It is essentially an inconsistency flag.
69c66ec88fSEmmanuel Vadot
70*cb7aa33aSEmmanuel Vadot  i2c-gpio,sda-has-no-pullup:
71*cb7aa33aSEmmanuel Vadot    type: boolean
72*cb7aa33aSEmmanuel Vadot    description: sda is used in a non-compliant way and has no pull-up.
73*cb7aa33aSEmmanuel Vadot      Therefore disable open-drain. This property is mutually-exclusive
74*cb7aa33aSEmmanuel Vadot      with i2c-gpio,sda-open-drain.
75*cb7aa33aSEmmanuel Vadot
76*cb7aa33aSEmmanuel Vadot  i2c-gpio,scl-has-no-pullup:
77*cb7aa33aSEmmanuel Vadot    type: boolean
78*cb7aa33aSEmmanuel Vadot    description: scl is used in a non-compliant way and has no pull-up.
79*cb7aa33aSEmmanuel Vadot      Therefore disable open-drain. This property is mutually-exclusive
80*cb7aa33aSEmmanuel Vadot      with i2c-gpio,scl-open-drain.
81*cb7aa33aSEmmanuel Vadot
82*cb7aa33aSEmmanuel Vadotdependencies:
83*cb7aa33aSEmmanuel Vadot  i2c-gpio,sda-has-no-pullup:
84*cb7aa33aSEmmanuel Vadot    not:
85*cb7aa33aSEmmanuel Vadot      required:
86*cb7aa33aSEmmanuel Vadot        - i2c-gpio,sda-open-drain
87*cb7aa33aSEmmanuel Vadot  i2c-gpio,scl-has-no-pullup:
88*cb7aa33aSEmmanuel Vadot    not:
89*cb7aa33aSEmmanuel Vadot      required:
90*cb7aa33aSEmmanuel Vadot        - i2c-gpio,scl-open-drain
91*cb7aa33aSEmmanuel Vadot
92c66ec88fSEmmanuel Vadotrequired:
93c66ec88fSEmmanuel Vadot  - compatible
94c66ec88fSEmmanuel Vadot  - sda-gpios
95c66ec88fSEmmanuel Vadot  - scl-gpios
96c66ec88fSEmmanuel Vadot
976be33864SEmmanuel VadotunevaluatedProperties: false
986be33864SEmmanuel Vadot
99c66ec88fSEmmanuel Vadot...
100