Thread (4 messages) 4 messages, 2 authors, 2023-10-11

RE: [PATCH v4 1/2] dt-bindings: backlight: Add MPS MP3309C

From: Flavio Suligoi <f.suligoi@asem.it>
Date: 2023-10-11 15:13:29
Also in: dri-devel, linux-devicetree, linux-leds, lkml

Hi Rob,

just a question about led-backlight.yaml and pwm-backlight.yaml
common properties.

...
quoted
+
+  brightness-levels:
+    description:
+      Array of distinct brightness levels, in PWM dimming mode.
+      Typically these are in the range from 0 to 255, but any range starting
+      at 0 will do.
+      The 0 value means a 0% duty cycle (darkest/off), while the last value in
+      the array represents a 100% duty cycle (brightest).
+    $ref: /schemas/types.yaml#/definitions/uint32-array
This already has a type defined. Please add it to backlight/common.yaml and
remove from led-backlight.yaml and pwm-backlight.yaml.
As well as the brightness-levels property, also the default-brightness-level is in common
between led-backlight.yaml and pwm-backlight.yaml.
What do you think about removing it from both led-backlight.yaml and pwm-backlight.yaml, and
moving it into backlight/common.yaml?
You say 0-255 here, but your example is 0-10. One of those seems wrong.
Anyways, don't define constraints in prose, use a schema:

items:
  maximum: 10 (or 255?)
quoted
+
+  default-brightness:
+    description:
+      The default brightness (index into the levels array).
+    $ref: /schemas/types.yaml#/definitions/uint32
Already has a type. You need to reference backlight/common.yaml.
quoted
+
+  mps,overvoltage-protection-microvolt:
+    description: Overvoltage protection (13.5V, 24V or 35.5V).
+    enum: [ 13500000, 24000000, 35500000 ]
+    default: 35500000
+
+  mps,no-sync-mode:
+    description: disable synchronous rectification mode
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Backlight with PWM control */
+        backlight_pwm: backlight@17 {
+            compatible = "mps,mp3309c";
+            reg = <0x17>;
+            pwms = <&pwm1 0 3333333 0>; /* 300 Hz --> (1/f) * 1*10^9 */
+            brightness-levels = <0 1 2 3 4 5 6 7 8 9 10>;
+            default-brightness = <8>;
+            mps,overvoltage-protection-microvolt = <24000000>;
+        };
+    };
--
2.34.1
Regards,
Flavio
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help