forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/Documentation/devicetree/bindings/i2c/i2c.txt
....@@ -2,32 +2,26 @@
22 ===========================================
33
44 This document describes generic bindings which can be used to describe I2C
5
-busses in a device tree.
5
+busses and their child devices in a device tree.
66
7
-Required properties
8
--------------------
7
+Required properties (per bus)
8
+-----------------------------
99
1010 - #address-cells - should be <1>. Read more about addresses below.
1111 - #size-cells - should be <0>.
12
-- compatible - name of I2C bus controller following generic names
13
- recommended practice.
12
+- compatible - name of I2C bus controller
1413
1514 For other required properties e.g. to describe register sets,
1615 clocks, etc. check the binding documentation of the specific driver.
1716
1817 The cells properties above define that an address of children of an I2C bus
19
-are described by a single value. This is usually a 7 bit address. However,
20
-flags can be attached to the address. I2C_TEN_BIT_ADDRESS is used to mark a 10
21
-bit address. It is needed to avoid the ambiguity between e.g. a 7 bit address
22
-of 0x50 and a 10 bit address of 0x050 which, in theory, can be on the same bus.
23
-Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we listen to
24
-be devices ourselves.
18
+are described by a single value.
2519
26
-Optional properties
27
--------------------
20
+Optional properties (per bus)
21
+-----------------------------
2822
2923 These properties may not be supported by all drivers. However, if a driver
30
-wants to support one of the below features, it should adapt the bindings below.
24
+wants to support one of the below features, it should adapt these bindings.
3125
3226 - clock-frequency
3327 frequency of bus clock in Hz.
....@@ -55,6 +49,73 @@
5549 Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C
5650 specification.
5751
52
+- i2c-analog-filter
53
+ Enable analog filter for i2c lines.
54
+
55
+- i2c-digital-filter
56
+ Enable digital filter for i2c lines.
57
+
58
+- i2c-digital-filter-width-ns
59
+ Width of spikes which can be filtered by digital filter
60
+ (i2c-digital-filter). This width is specified in nanoseconds.
61
+
62
+- i2c-analog-filter-cutoff-frequency
63
+ Frequency that the analog filter (i2c-analog-filter) uses to distinguish
64
+ which signal to filter. Signal with higher frequency than specified will
65
+ be filtered out. Only lower frequency will pass (this is applicable to
66
+ a low-pass analog filter). Typical value should be above the normal
67
+ i2c bus clock frequency (clock-frequency).
68
+ Specified in Hz.
69
+
70
+- multi-master
71
+ states that there is another master active on this bus. The OS can use
72
+ this information to adapt power management to keep the arbitration awake
73
+ all the time, for example. Can not be combined with 'single-master'.
74
+
75
+- pinctrl
76
+ add extra pinctrl to configure SCL/SDA pins to GPIO function for bus
77
+ recovery, call it "gpio" or "recovery" (deprecated) state
78
+
79
+- scl-gpios
80
+ specify the gpio related to SCL pin. Used for GPIO bus recovery.
81
+
82
+- sda-gpios
83
+ specify the gpio related to SDA pin. Optional for GPIO bus recovery.
84
+
85
+- single-master
86
+ states that there is no other master active on this bus. The OS can use
87
+ this information to detect a stalled bus more reliably, for example.
88
+ Can not be combined with 'multi-master'.
89
+
90
+- smbus
91
+ states that additional SMBus restrictions and features apply to this bus.
92
+ Examples of features are SMBusHostNotify and SMBusAlert. Examples of
93
+ restrictions are more reserved addresses and timeout definitions.
94
+
95
+Required properties (per child device)
96
+--------------------------------------
97
+
98
+- compatible
99
+ name of I2C slave device
100
+
101
+- reg
102
+ One or many I2C slave addresses. These are usually a 7 bit addresses.
103
+ However, flags can be attached to an address. I2C_TEN_BIT_ADDRESS is
104
+ used to mark a 10 bit address. It is needed to avoid the ambiguity
105
+ between e.g. a 7 bit address of 0x50 and a 10 bit address of 0x050
106
+ which, in theory, can be on the same bus.
107
+ Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we
108
+ listen to be devices ourselves.
109
+
110
+Optional properties (per child device)
111
+--------------------------------------
112
+
113
+These properties may not be supported by all drivers. However, if a driver
114
+wants to support one of the below features, it should adapt these bindings.
115
+
116
+- host-notify
117
+ device uses SMBus host notify protocol instead of interrupt line.
118
+
58119 - interrupts
59120 interrupts used by the device.
60121
....@@ -62,29 +123,18 @@
62123 "irq", "wakeup" and "smbus_alert" names are recognized by I2C core,
63124 other names are left to individual drivers.
64125
65
-- host-notify
66
- device uses SMBus host notify protocol instead of interrupt line.
67
-
68
-- multi-master
69
- states that there is another master active on this bus. The OS can use
70
- this information to adapt power management to keep the arbitration awake
71
- all the time, for example.
72
-
73
-- wakeup-source
74
- device can be used as a wakeup source.
75
-
76
-- reg
77
- I2C slave addresses
78
-
79126 - reg-names
80127 Names of map programmable addresses.
81128 It can contain any map needing another address than default one.
129
+
130
+- wakeup-source
131
+ device can be used as a wakeup source.
82132
83133 Binding may contain optional "interrupts" property, describing interrupts
84134 used by the device. I2C core will assign "irq" interrupt (or the very first
85135 interrupt if not using interrupt names) as primary interrupt for the slave.
86136
87
-Alternatively, devices supporting SMbus Host Notify, and connected to
137
+Alternatively, devices supporting SMBus Host Notify, and connected to
88138 adapters that support this feature, may use "host-notify" property. I2C
89139 core will create a virtual interrupt for Host Notify and assign it as
90140 primary interrupt for the slave.