[PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices

Markus Probst posted 2 patches 1 month ago
There is a newer version of this series
[PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Markus Probst 1 month ago
Add the Synology Microp devicetree bindings. Those devices are
microcontrollers found on Synology NAS devices. They are connected to a
serial port on the host device.

Those devices are used to control certain LEDs, fan speeds, a beeper, to
handle buttons, fan failures and to properly shutdown and reboot the
device.

Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
 .../devicetree/bindings/mfd/synology,microp.yaml   | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/synology,microp.yaml b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
new file mode 100644
index 000000000000..0fcb0b750bf0
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
@@ -0,0 +1,75 @@
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/synology,microp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synology NAS on-board Microcontroller
+
+maintainers:
+  - Markus Probst <markus.probst@posteo.de>
+
+description: |
+  Synology devices contain a microcontroller on their device to control
+  certain leds, fan speeds, a beeper, to properly handle system shutdown
+  and reboot, buttons and fan failures.
+
+properties:
+  compatible:
+    enum:
+      - synology,microp
+  power-led:
+    $ref: /schemas/leds/common.yaml
+    unevaluatedProperties: false
+  status-led:
+    $ref: /schemas/leds/common.yaml
+    unevaluatedProperties: false
+  alert-led:
+    $ref: /schemas/leds/common.yaml
+    unevaluatedProperties: false
+  usb-led:
+    $ref: /schemas/leds/common.yaml
+    unevaluatedProperties: false
+  no-check-fan:
+    type: boolean
+    description: |
+      Disable fan failure check.
+
+      The fan failure event is triggered on the device, even if the fan
+      has been intentionally set to a low speed. This property prevents a
+      hardware protection shutdown if a fan failure event is reported.
+  no-check-cpu-fan:
+    type: boolean
+    description: |
+      Disable cpu fan failure check.
+
+      The cpu fan failure event is triggered on the device, even if the cpu
+      fan has been intentionally set to a low speed. This property prevents
+      a hardware protection shutdown if a cpu fan failure event is
+      reported.
+
+required:
+  - compatible
+  - power-led
+  - status-led
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    uart {
+      microp {
+        compatible = "synology,microp";
+
+        power-led {
+          color = <LED_COLOR_ID_BLUE>;
+          function = LED_FUNCTION_POWER;
+        };
+
+        status-led {
+          color = <LED_COLOR_ID_MULTI>;
+          function = LED_FUNCTION_STATUS;
+        };
+      };
+    };

-- 
2.52.0
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Krzysztof Kozlowski 1 month ago
On 06/03/2026 20:38, Markus Probst wrote:
> Add the Synology Microp devicetree bindings. Those devices are
> microcontrollers found on Synology NAS devices. They are connected to a
> serial port on the host device.

A nit, subject: drop second/last, redundant "binding for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> 
> Those devices are used to control certain LEDs, fan speeds, a beeper, to
> handle buttons, fan failures and to properly shutdown and reboot the
> device.
> 
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
> ---
>  .../devicetree/bindings/mfd/synology,microp.yaml   | 75 ++++++++++++++++++++++
>  1 file changed, 75 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/synology,microp.yaml b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> new file mode 100644
> index 000000000000..0fcb0b750bf0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> @@ -0,0 +1,75 @@
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/synology,microp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synology NAS on-board Microcontroller
> +
> +maintainers:
> +  - Markus Probst <markus.probst@posteo.de>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  Synology devices contain a microcontroller on their device to control
> +  certain leds, fan speeds, a beeper, to properly handle system shutdown
> +  and reboot, buttons and fan failures.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - synology,microp

Missing blank line. Look at other bindings how to write one.

> +  power-led:
> +    $ref: /schemas/leds/common.yaml
> +    unevaluatedProperties: false
> +  status-led:
> +    $ref: /schemas/leds/common.yaml
> +    unevaluatedProperties: false
> +  alert-led:
> +    $ref: /schemas/leds/common.yaml
> +    unevaluatedProperties: false
> +  usb-led:
> +    $ref: /schemas/leds/common.yaml
> +    unevaluatedProperties: false

That's pretty unreadable code.

> +  no-check-fan:

Vendor prefix

> +    type: boolean
> +    description: |
> +      Disable fan failure check.

You described the desired Linux feature or behavior, not the actual
hardware. The bindings are about the latter, so instead you need to
rephrase the property and its description to match actual hardware
capabilities/features/configuration etc.

> +
> +      The fan failure event is triggered on the device, even if the fan
> +      has been intentionally set to a low speed. This property prevents a
> +      hardware protection shutdown if a fan failure event is reported.
> +  no-check-cpu-fan:

You described the desired Linux feature or behavior, not the actual
hardware. The bindings are about the latter, so instead you need to
rephrase the property and its description to match actual hardware
capabilities/features/configuration etc.

> +    type: boolean
> +    description: |
> +      Disable cpu fan failure check.
> +
> +      The cpu fan failure event is triggered on the device, even if the cpu
> +      fan has been intentionally set to a low speed. This property prevents
> +      a hardware protection shutdown if a cpu fan failure event is
> +      reported.
> +
> +required:
> +  - compatible
> +  - power-led
> +  - status-led
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/leds/common.h>
> +
> +    uart {

Drop, unuesed

> +      microp {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel
sources for similar cases or you can grow the spec (via pull request to
DT spec repo).

> +        compatible = "synology,microp";
> +
> +        power-led {
> +          color = <LED_COLOR_ID_BLUE>;
> +          function = LED_FUNCTION_POWER;
> +        };
> +
> +        status-led {
> +          color = <LED_COLOR_ID_MULTI>;
> +          function = LED_FUNCTION_STATUS;
> +        };
> +      };
> +    };
> 


Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Krzysztof Kozlowski 1 month ago
On 07/03/2026 11:20, Krzysztof Kozlowski wrote:
>> +  power-led:
>> +    $ref: /schemas/leds/common.yaml
>> +    unevaluatedProperties: false
>> +  status-led:
>> +    $ref: /schemas/leds/common.yaml
>> +    unevaluatedProperties: false
>> +  alert-led:
>> +    $ref: /schemas/leds/common.yaml
>> +    unevaluatedProperties: false
>> +  usb-led:
>> +    $ref: /schemas/leds/common.yaml
>> +    unevaluatedProperties: false
> 
> That's pretty unreadable code.

... and could be simpler with patternProperties and regex
> 


Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Markus Probst 1 month ago
On Sat, 2026-03-07 at 11:20 +0100, Krzysztof Kozlowski wrote:
> On 06/03/2026 20:38, Markus Probst wrote:
> > Add the Synology Microp devicetree bindings. Those devices are
> > microcontrollers found on Synology NAS devices. They are connected to a
> > serial port on the host device.
> 
> A nit, subject: drop second/last, redundant "binding for". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> 
> > 
> > Those devices are used to control certain LEDs, fan speeds, a beeper, to
> > handle buttons, fan failures and to properly shutdown and reboot the
> > device.
> > 
> > Signed-off-by: Markus Probst <markus.probst@posteo.de>
> > ---
> >  .../devicetree/bindings/mfd/synology,microp.yaml   | 75 ++++++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/synology,microp.yaml b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> > new file mode 100644
> > index 000000000000..0fcb0b750bf0
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> > @@ -0,0 +1,75 @@
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mfd/synology,microp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Synology NAS on-board Microcontroller
> > +
> > +maintainers:
> > +  - Markus Probst <markus.probst@posteo.de>
> > +
> > +description: |
> 
> Do not need '|' unless you need to preserve formatting.
> 
> > +  Synology devices contain a microcontroller on their device to control
> > +  certain leds, fan speeds, a beeper, to properly handle system shutdown
> > +  and reboot, buttons and fan failures.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - synology,microp
> 
> Missing blank line. Look at other bindings how to write one.
> 
> > +  power-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  status-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  alert-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  usb-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> 
> That's pretty unreadable code.
> 
> > +  no-check-fan:
> 
> Vendor prefix
> 
> > +    type: boolean
> > +    description: |
> > +      Disable fan failure check.
> 
> You described the desired Linux feature or behavior, not the actual
> hardware. The bindings are about the latter, so instead you need to
> rephrase the property and its description to match actual hardware
> capabilities/features/configuration etc.
> 
> > +
> > +      The fan failure event is triggered on the device, even if the fan
> > +      has been intentionally set to a low speed. This property prevents a
> > +      hardware protection shutdown if a fan failure event is reported.
> > +  no-check-cpu-fan:
> 
> You described the desired Linux feature or behavior, not the actual
> hardware. The bindings are about the latter, so instead you need to
> rephrase the property and its description to match actual hardware
> capabilities/features/configuration etc.
> 
> > +    type: boolean
> > +    description: |
> > +      Disable cpu fan failure check.
> > +
> > +      The cpu fan failure event is triggered on the device, even if the cpu
> > +      fan has been intentionally set to a low speed. This property prevents
> > +      a hardware protection shutdown if a cpu fan failure event is
> > +      reported.
> > +
> > +required:
> > +  - compatible
> > +  - power-led
> > +  - status-led
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/leds/common.h>
> > +
> > +    uart {
> 
> Drop, unuesed
The device uses the serial device bus. Thus the device node needs to be
inside a uart device node. The uart node represents a serial device
port in that example.

This is also done the same way in
- Documentation/devicetree/bindings/mfd/qnap,ts433-mcu.yaml
- Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
- Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml

> 
> > +      microp {
> 
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> If you cannot find a name matching your device, please check in kernel
> sources for similar cases or you can grow the spec (via pull request to
> DT spec repo).
"mcu" seems the most fitting, altough it is not part of the list.
It it used here though:
- Documentation/devicetree/bindings/mfd/qnap,ts433-mcu.yaml

> 
> > +        compatible = "synology,microp";
> > +
> > +        power-led {
> > +          color = <LED_COLOR_ID_BLUE>;
> > +          function = LED_FUNCTION_POWER;
> > +        };
> > +
> > +        status-led {
> > +          color = <LED_COLOR_ID_MULTI>;
> > +          function = LED_FUNCTION_STATUS;
> > +        };
> > +      };
> > +    };
> > 
> 
> 
> Best regards,
> Krzysztof

Thanks
- Markus Probst
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Krzysztof Kozlowski 1 month ago
On 07/03/2026 15:43, Markus Probst wrote:
>>> +
>>> +examples:
>>> +  - |
>>> +    #include <dt-bindings/leds/common.h>
>>> +
>>> +    uart {
>>
>> Drop, unuesed
> The device uses the serial device bus. Thus the device node needs to be
> inside a uart device node. The uart node represents a serial device
> port in that example.

Still not used.

> 
> This is also done the same way in
> - Documentation/devicetree/bindings/mfd/qnap,ts433-mcu.yaml
> - Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
> - Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml

Plenty of poor examples...


> 
>>
>>> +      microp {
>>
>> Node names should be generic. See also an explanation and list of
>> examples (not exhaustive) in DT specification:
>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
>> If you cannot find a name matching your device, please check in kernel
>> sources for similar cases or you can grow the spec (via pull request to
>> DT spec repo).
> "mcu" seems the most fitting, altough it is not part of the list.
> It it used here though:
> - Documentation/devicetree/bindings/mfd/qnap,ts433-mcu.yaml

Depending what this is. MCU is generic purpose unit where you load your
different FW for different purposes and you have here specific - to
handle certain aspects of this entire machine. This looks like EC, so
should be called embedded-controller and placed in that directory.


Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Markus Probst 1 month ago
On Sat, 2026-03-07 at 11:20 +0100, Krzysztof Kozlowski wrote:
> On 06/03/2026 20:38, Markus Probst wrote:
> > Add the Synology Microp devicetree bindings. Those devices are
> > microcontrollers found on Synology NAS devices. They are connected to a
> > serial port on the host device.
> 
> A nit, subject: drop second/last, redundant "binding for". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> 
> > 
> > Those devices are used to control certain LEDs, fan speeds, a beeper, to
> > handle buttons, fan failures and to properly shutdown and reboot the
> > device.
> > 
> > Signed-off-by: Markus Probst <markus.probst@posteo.de>
> > ---
> >  .../devicetree/bindings/mfd/synology,microp.yaml   | 75 ++++++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/synology,microp.yaml b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> > new file mode 100644
> > index 000000000000..0fcb0b750bf0
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> > @@ -0,0 +1,75 @@
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mfd/synology,microp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Synology NAS on-board Microcontroller
> > +
> > +maintainers:
> > +  - Markus Probst <markus.probst@posteo.de>
> > +
> > +description: |
> 
> Do not need '|' unless you need to preserve formatting.
> 
> > +  Synology devices contain a microcontroller on their device to control
> > +  certain leds, fan speeds, a beeper, to properly handle system shutdown
> > +  and reboot, buttons and fan failures.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - synology,microp
> 
> Missing blank line. Look at other bindings how to write one.
> 
> > +  power-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  status-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  alert-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> > +  usb-led:
> > +    $ref: /schemas/leds/common.yaml
> > +    unevaluatedProperties: false
> 
> That's pretty unreadable code.
> 
> > +  no-check-fan:
> 
> Vendor prefix

In the documentation it says

"
Nonstandard property names should specify a unique string prefix, such
as a stock ticker symbol, identifying the name of the company or
organization that defined the property.
"

I am not sure whether to use synology or linux as vendor prefix here.

The property itself was not defined by synology,

but the property also is not necessarily specific to linux.
The driver has to tell the device whether it should even check for fan
failures. The property wouldn't alter behaviour of the driver, but of
the device. The device itself would not check for fan failures anymore.

Thanks
- Markus Probst

> 
> > +    type: boolean
> > +    description: |
> > +      Disable fan failure check.
> 
> You described the desired Linux feature or behavior, not the actual
> hardware. The bindings are about the latter, so instead you need to
> rephrase the property and its description to match actual hardware
> capabilities/features/configuration etc.
> 
> > +
> > +      The fan failure event is triggered on the device, even if the fan
> > +      has been intentionally set to a low speed. This property prevents a
> > +      hardware protection shutdown if a fan failure event is reported.
> > +  no-check-cpu-fan:
> 
> You described the desired Linux feature or behavior, not the actual
> hardware. The bindings are about the latter, so instead you need to
> rephrase the property and its description to match actual hardware
> capabilities/features/configuration etc.
> 
> > +    type: boolean
> > +    description: |
> > +      Disable cpu fan failure check.
> > +
> > +      The cpu fan failure event is triggered on the device, even if the cpu
> > +      fan has been intentionally set to a low speed. This property prevents
> > +      a hardware protection shutdown if a cpu fan failure event is
> > +      reported.
> > +
> > +required:
> > +  - compatible
> > +  - power-led
> > +  - status-led
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/leds/common.h>
> > +
> > +    uart {
> 
> Drop, unuesed
> 
> > +      microp {
> 
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> If you cannot find a name matching your device, please check in kernel
> sources for similar cases or you can grow the spec (via pull request to
> DT spec repo).
> 
> > +        compatible = "synology,microp";
> > +
> > +        power-led {
> > +          color = <LED_COLOR_ID_BLUE>;
> > +          function = LED_FUNCTION_POWER;
> > +        };
> > +
> > +        status-led {
> > +          color = <LED_COLOR_ID_MULTI>;
> > +          function = LED_FUNCTION_STATUS;
> > +        };
> > +      };
> > +    };
> > 
> 
> 
> Best regards,
> Krzysztof
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Krzysztof Kozlowski 1 month ago
On 07/03/2026 16:03, Markus Probst wrote:
>>> +  usb-led:
>>> +    $ref: /schemas/leds/common.yaml
>>> +    unevaluatedProperties: false
>>
>> That's pretty unreadable code.
>>
>>> +  no-check-fan:
>>
>> Vendor prefix
> 
> In the documentation it says
> 
> "
> Nonstandard property names should specify a unique string prefix, such
> as a stock ticker symbol, identifying the name of the company or
> organization that defined the property.
> "
> 
> I am not sure whether to use synology or linux as vendor prefix here.

You cannot have linux prefix - you are not adding bindings for a
abstracted/generalized device.

> 
> The property itself was not defined by synology,
> 
> but the property also is not necessarily specific to linux.
> The driver has to tell the device whether it should even check for fan
> failures. The property wouldn't alter behaviour of the driver, but of

Driver stuff so not really suitable for bindings in the first place.

> the device. The device itself would not check for fan failures anymore.
> 
> Thanks
> - Markus Probst
> 
>>
>>> +    type: boolean
>>> +    description: |
>>> +      Disable fan failure check.
>>
>> You described the desired Linux feature or behavior, not the actual
>> hardware. The bindings are about the latter, so instead you need to
>> rephrase the property and its description to match actual hardware
>> capabilities/features/configuration etc.

Do not ignore the comments.


Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: mfd: Add binding for synology,microp devices
Posted by Krzysztof Kozlowski 1 month ago
On Fri, Mar 06, 2026 at 07:38:28PM +0000, Markus Probst wrote:
> Add the Synology Microp devicetree bindings. Those devices are
> microcontrollers found on Synology NAS devices. They are connected to a
> serial port on the host device.
> 
> Those devices are used to control certain LEDs, fan speeds, a beeper, to
> handle buttons, fan failures and to properly shutdown and reboot the
> device.
> 
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
> ---
>  .../devicetree/bindings/mfd/synology,microp.yaml   | 75 ++++++++++++++++++++++
>  1 file changed, 75 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/synology,microp.yaml b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> new file mode 100644
> index 000000000000..0fcb0b750bf0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/synology,microp.yaml
> @@ -0,0 +1,75 @@
> +%YAML 1.2

You we have tools which save you review time. Most important, save
maintainers/reviewers time from giving feedback on obvious mistakes. You
must use these tools, otherwise maintainers get grumpy by wasting their
time.

Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.

Best regards,
Krzysztof