lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  9 Sep 2021 16:31:12 -0500
From:   Rob Herring <robh@...nel.org>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Stephen Boyd <sboyd@...nel.org>, Pavel Machek <pavel@....cz>
Cc:     Liviu Dudau <liviu.dudau@....com>,
        Sudeep Holla <sudeep.holla@....com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-leds@...r.kernel.org
Subject: [PATCH 2/8] dt-bindings: leds: register-bit-led: Use 'reg' instead of 'offset'

'reg' is the standard property for defining register banks/addresses. Add
it to use for the register address and deprecate 'offset'. This also
allows for using standard node names with unit-addresses. However, since
it is quite possible to have multiple nodes at the same register
address, allow for the unit-address to optionally have the bit
offset. The unit-address format is '@<reg address>[,<bit offset>]'. This
matches the format recently added for nvmem binding which has the same
issue.

Cc: Pavel Machek <pavel@....cz>
Cc: Linus Walleij <linus.walleij@...aro.org>
Cc: linux-leds@...r.kernel.org
Signed-off-by: Rob Herring <robh@...nel.org>
---
 .../bindings/leds/register-bit-led.yaml       | 25 ++++++++++++++++---
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/leds/register-bit-led.yaml b/Documentation/devicetree/bindings/leds/register-bit-led.yaml
index 4a5bb0aa5f27..404ac75e1dc4 100644
--- a/Documentation/devicetree/bindings/leds/register-bit-led.yaml
+++ b/Documentation/devicetree/bindings/leds/register-bit-led.yaml
@@ -20,9 +20,19 @@ allOf:
   - $ref: /schemas/leds/common.yaml#
 
 properties:
+  $nodename:
+    description:
+      The unit-address is in the form of @<reg addr>,<bit offset>
+    pattern: '^led@[0-9a-f]+,[0-9a-f]{1,2}$'
+
   compatible:
     const: register-bit-led
 
+  reg:
+    description:
+      The register address and size
+    maxItems: 1
+
   mask:
     description:
       bit mask for the bit controlling this LED in the register
@@ -37,11 +47,12 @@ properties:
     description:
       register offset to the register controlling this LED
     $ref: /schemas/types.yaml#/definitions/uint32
+    deprecated: true
 
 required:
   - compatible
   - mask
-  - offset
+  - reg
 
 unevaluatedProperties: false
 
@@ -51,25 +62,31 @@ examples:
     syscon@...00000 {
         compatible = "arm,realview-pb1176-syscon", "syscon";
         reg = <0x10000000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x10000000 0x1000>;
 
-        led@8.0 {
+        led@8,0 {
             compatible = "register-bit-led";
+            reg = <0x08 0x04>;
             offset = <0x08>;
             mask = <0x01>;
             label = "versatile:0";
             linux,default-trigger = "heartbeat";
             default-state = "on";
         };
-        led@8.1 {
+        led@8,1 {
             compatible = "register-bit-led";
+            reg = <0x08 0x04>;
             offset = <0x08>;
             mask = <0x02>;
             label = "versatile:1";
             linux,default-trigger = "mmc0";
             default-state = "off";
         };
-        led@8.2 {
+        led@8,2 {
             compatible = "register-bit-led";
+            reg = <0x08 0x04>;
             offset = <0x08>;
             mask = <0x04>;
             label = "versatile:2";
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ