[PATCHv4 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add

Rosen Penev posted 7 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCHv4 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add
Posted by Rosen Penev 2 months, 3 weeks ago
Add device-tree bindings for the RT2800 SOC wifi device found in older
Ralink/Mediatek devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../bindings/net/wireless/ralink,rt2880.yaml  | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml

diff --git a/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
new file mode 100644
index 000000000000..a92aedf6ba01
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wireless/ralink,rt2880.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ralink RT2880 wireless device
+
+maintainers:
+  - Stanislaw Gruszka <stf_xl@wp.pl>
+
+description: |
+  This node provides properties for configuring RT2880 SOC wifi devices.
+  The node is expected to be specified as a root node of the device.
+
+allOf:
+  - $ref: ieee80211.yaml#
+
+properties:
+  compatible:
+    enum:
+      - ralink,rt2880-wifi
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    wifi@110180000 {
+      compatible = "ralink,rt2880-wifi";
+      reg = <0x10180000 0x40000>;
+      clocks = <&sysc 16>;
+      interrupt-parent = <&cpuintc>;
+      interrupts = <6>;
+    };
-- 
2.50.0
Re: [PATCHv4 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On Sat, Jul 12, 2025 at 02:04:48PM -0700, Rosen Penev wrote:
> Add device-tree bindings for the RT2800 SOC wifi device found in older
> Ralink/Mediatek devices.

Your subject was cut. Probably you wanted something like add "Realtek foo adapter" etc.


> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  .../bindings/net/wireless/ralink,rt2880.yaml  | 47 +++++++++++++++++++
>  1 file changed, 47 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> new file mode 100644
> index 000000000000..a92aedf6ba01
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> @@ -0,0 +1,47 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/wireless/ralink,rt2880.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Ralink RT2880 wireless device
> +
> +maintainers:
> +  - Stanislaw Gruszka <stf_xl@wp.pl>
> +
> +description: |
> +  This node provides properties for configuring RT2880 SOC wifi devices.
> +  The node is expected to be specified as a root node of the device.
> +
> +allOf:
> +  - $ref: ieee80211.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ralink,rt2880-wifi
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg

Why clocks are optional? SoC devices rarely work without a clock.


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Re: [PATCHv4 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add
Posted by Rosen Penev 2 months, 3 weeks ago
On Mon, Jul 14, 2025 at 12:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Sat, Jul 12, 2025 at 02:04:48PM -0700, Rosen Penev wrote:
> > Add device-tree bindings for the RT2800 SOC wifi device found in older
> > Ralink/Mediatek devices.
>
> Your subject was cut. Probably you wanted something like add "Realtek foo adapter" etc.
Not sure I follow.
>
>
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> >  .../bindings/net/wireless/ralink,rt2880.yaml  | 47 +++++++++++++++++++
> >  1 file changed, 47 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> > new file mode 100644
> > index 000000000000..a92aedf6ba01
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
> > @@ -0,0 +1,47 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/wireless/ralink,rt2880.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Ralink RT2880 wireless device
> > +
> > +maintainers:
> > +  - Stanislaw Gruszka <stf_xl@wp.pl>
> > +
> > +description: |
> > +  This node provides properties for configuring RT2880 SOC wifi devices.
> > +  The node is expected to be specified as a root node of the device.
> > +
> > +allOf:
> > +  - $ref: ieee80211.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - ralink,rt2880-wifi
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
>
> Why clocks are optional? SoC devices rarely work without a clock.
Before this patchset the code was doing

 25         rt2x00dev->clk = clk_get(&pdev->dev, NULL);
 24         if (IS_ERR(rt2x00dev->clk))
 23                 rt2x00dev->clk = NULL;

I changed it to use devm_clk_get_optional since that's what it looks
like here. It's not returning under failure so I assume that means
it's optional.

OTOH all downstream OpenWrt users of this code (as well as
mt7620a.dtsi here) do specify a clock. _optional might be a mistake.

Maybe Stanislaw knows more.
>
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Best regards,
> Krzysztof
>
Re: [PATCHv4 wireless-next 7/7] dt-bindings: net: wireless: rt2800: add
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On 14/07/2025 21:44, Rosen Penev wrote:
> On Mon, Jul 14, 2025 at 12:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On Sat, Jul 12, 2025 at 02:04:48PM -0700, Rosen Penev wrote:
>>> Add device-tree bindings for the RT2800 SOC wifi device found in older
>>> Ralink/Mediatek devices.
>>
>> Your subject was cut. Probably you wanted something like add "Realtek foo adapter" etc.
> Not sure I follow.

Your subject is oddly incomplete.

>>
>>
>>>
>>> Signed-off-by: Rosen Penev <rosenp@gmail.com>
>>> ---
>>>  .../bindings/net/wireless/ralink,rt2880.yaml  | 47 +++++++++++++++++++
>>>  1 file changed, 47 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
>>> new file mode 100644
>>> index 000000000000..a92aedf6ba01
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/net/wireless/ralink,rt2880.yaml
>>> @@ -0,0 +1,47 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/net/wireless/ralink,rt2880.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Ralink RT2880 wireless device
>>> +
>>> +maintainers:
>>> +  - Stanislaw Gruszka <stf_xl@wp.pl>
>>> +
>>> +description: |
>>> +  This node provides properties for configuring RT2880 SOC wifi devices.
>>> +  The node is expected to be specified as a root node of the device.
>>> +
>>> +allOf:
>>> +  - $ref: ieee80211.yaml#
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - ralink,rt2880-wifi
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  clocks:
>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    maxItems: 1
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>
>> Why clocks are optional? SoC devices rarely work without a clock.
> Before this patchset the code was doing
> 
>  25         rt2x00dev->clk = clk_get(&pdev->dev, NULL);
>  24         if (IS_ERR(rt2x00dev->clk))
>  23                 rt2x00dev->clk = NULL;


That's driver. I am asking about hardware. Hardware rarely works without
clock. Just because some driver works is not a really a good proof,
because clock could be enabled by bootloader which would still prove my
point: hardware cannot work without clock.

Best regards,
Krzysztof