[PATCH 1/2] dt-bindings: Add syscon-names support

From: Orson Zhai
Date: Thu Nov 14 2019 - 07:23:26 EST



Make life easier when syscon consumer want to access multiple syscon
nodes.
Add syscon-names and relative properties to help manage complicated
cases when accessing more one syscon node.

Signed-off-by: Orson Zhai <orson.zhai@xxxxxxxxxx>
---
.../devicetree/bindings/mfd/syscon.txt | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
index 25d9e9c2fd53..ca7bc7608c15 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.txt
+++ b/Documentation/devicetree/bindings/mfd/syscon.txt
@@ -17,6 +17,8 @@ Optional property:
- reg-io-width: the size (in bytes) of the IO accesses that should be
performed on the device.
- hwlocks: reference to a phandle of a hardware spinlock provider node.
+- #syscon-cells: represents the number of args. Used when syscon-names
+ is going to be used. The value is vendor specific.

Examples:
gpr: iomuxc-gpr@20e0000 {
@@ -30,3 +32,37 @@ hwlock1: hwspinlock@40500000 {
reg = <0x40500000 0x1000>;
#hwlock-cells = <1>;
};
+
+
+==Syscon names==
+
+Refer to syscon node by names with phandle args in syscon consumer node.
+
+Required properties:
+- syscons: List of phandle and any number of args. Args is specific to
+ differnet vendor. For example: In Unisoc SoCs, the 1st arg
+ will be treated as register address offset and the 2nd is bit
+ mask as default.
+
+- syscon-names: List of syscon node name strings sorted in the same
+ order as the syscons property.
+
+Examples:
+
+apb_regs: syscon@20008000 {
+ compatible = "sprd,apb-glb", "syscon";
+ #syscon-cells = <2>;
+ reg = <0x20008000 0x100>;
+};
+
+aon_regs: syscon@40008000 {
+ compatible = "sprd,aon-glb", "syscon";
+ #syscon-cells = <1>;
+ reg = <0x40008000 0x100>;
+};
+
+display@40500000 {
+ ...
+ syscons = <&ap_apb_regs 0x4 0xf00>, <&aon_regs 0x8>;
+ syscon-names = "enable", "power";
+};
--
2.18.0