diff mbox series

[2/8] dt-bindings:net:wireless:mediatek,mt76: introduce power-limits node

Message ID eb6998d12c7f60a28c7f3eab455d4339656f76e2.1617625912.git.lorenzo@kernel.org
State New
Headers show
Series introduce single-sku support for mt7663/mt7921 drivers | expand

Commit Message

Lorenzo Bianconi April 5, 2021, 12:40 p.m. UTC
Introduce power-limits node in mt76 binding in order to specify
per-rate power limit values for each 802.11n/802.11ac rate

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../bindings/net/wireless/mediatek,mt76.yaml  | 79 +++++++++++++++++++
 1 file changed, 79 insertions(+)

Comments

Rob Herring April 9, 2021, 3:22 p.m. UTC | #1
On Mon, Apr 05, 2021 at 02:40:26PM +0200, Lorenzo Bianconi wrote:
> Introduce power-limits node in mt76 binding in order to specify
> per-rate power limit values for each 802.11n/802.11ac rate
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  .../bindings/net/wireless/mediatek,mt76.yaml  | 79 +++++++++++++++++++
>  1 file changed, 79 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> index d6f835d17d66..6ede331e3e52 100644
> --- a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> @@ -72,6 +72,62 @@ properties:
>        led-sources:
>          maxItems: 1
>  
> +  power-limits:
> +    type: object
> +    properties:
> +      regdomain: true

This shouldn't really be in ieee80211.yaml if it belongs under 
'power-limits' node. You may need a 2nd power limits schema if this 
something that should/can be common.

> +
> +    patternProperties:
> +      "^r[0-9]+":
> +        type: object
> +        patternProperties:
> +          "^txpower-[256]g$":
> +            type: object
> +            patternProperties:
> +              "^b[0-9]+$":
> +                type: object
> +                properties:
> +                  channels:
> +                    $ref: /schemas/types.yaml#/definitions/uint32-array
> +                    minItems: 2
> +                    maxItems: 2
> +                    description:
> +                      Pairs of first and last channel number of the selected
> +                      band
> +
> +                  cck:
> +                    $ref: /schemas/types.yaml#/definitions/uint32-array

What's the range of values? Could be 8-bit?

> +                    minItems: 4
> +                    maxItems: 4
> +                    description:
> +                      4 half-dBm per-rate power limit values
> +
> +                  mcs:
> +                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +                    description:
> +                      Sets of per-rate power limit values for 802.11n/802.11ac
> +                      rates for multiple channel bandwidth settings.
> +                      Each set starts with the number of channel bandwidth
> +                      settings for which the rate set applies, followed by
> +                      either 8 or 10 power limit values. The order of the
> +                      channel bandwidth settings is 20, 40, 80 and 160 MHz.
> +
> +                  ru:
> +                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +                    description:
> +                      Sets of per-rate power limit values for 802.11ax rates
> +                      for multiple channel bandwidth or resource unit settings.
> +                      Each set starts with the number of channel bandwidth or
> +                      resource unit settings for which the rate set applies,
> +                      followed by 12 power limit values. The order of the
> +                      channel resource unit settings is RU26, RU52, RU106,
> +                      RU242/SU20, RU484/SU40, RU996/SU80 and RU2x996/SU160.

These short property names bother me because we don't want 2 property 
names with different meanings. A 2-3 letter name seems more likely to 
collide. Also, the names aren't really self describing either.

> +
> +                  txs-delta:
> +                    $ref: /schemas/types.yaml#/definitions/uint32-array
> +                    description:
> +                      Half-dBm power delta for different numbers of antennas
> +
>  required:
>    - compatible
>    - reg
> @@ -93,6 +149,29 @@ examples:
>          led {
>            led-sources = <2>;
>          };
> +
> +        power-limits {
> +          r0 {
> +            txpower-5g {
> +               regdomain = "FCC";

Not the right location for what you've defined.

> +               b0 {
> +                   channels = <36 48>;
> +                   ofdm = <23 23 23 23 23 23 23 23>;
> +                   mcs = <1 23 23 23 23 23 23 23 23 23 23>,
> +                         <3 22 22 22 22 22 22 22 22 22 22>;
> +                   ru = <3 22 22 22 22 22 22 22 22 22 22 22 22>,
> +                        <4 20 20 20 20 20 20 20 20 20 20 20 20>;
> +               };
> +               b1 {
> +                   channels = <100 181>;
> +                   ofdm = <14 14 14 14 14 14 14 14>;
> +                   mcs = <4 14 14 14 14 14 14 14 14 14 14>;
> +                   txs-delta = <12 9 6>;
> +                   ru = <7 14 14 14 14 14 14 14 14 14 14 14 14>;
> +               };
> +             };
> +          };
> +        };
>        };
>      };
>  
> -- 
> 2.30.2
>
Lorenzo Bianconi April 9, 2021, 10:50 p.m. UTC | #2
> On Mon, Apr 05, 2021 at 02:40:26PM +0200, Lorenzo Bianconi wrote:
> > Introduce power-limits node in mt76 binding in order to specify
> > per-rate power limit values for each 802.11n/802.11ac rate
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  .../bindings/net/wireless/mediatek,mt76.yaml  | 79 +++++++++++++++++++
> >  1 file changed, 79 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> > index d6f835d17d66..6ede331e3e52 100644
> > --- a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> > +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
> > @@ -72,6 +72,62 @@ properties:
> >        led-sources:
> >          maxItems: 1
> >  
> > +  power-limits:
> > +    type: object
> > +    properties:
> > +      regdomain: true
> 
> This shouldn't really be in ieee80211.yaml if it belongs under 
> 'power-limits' node. You may need a 2nd power limits schema if this 
> something that should/can be common.

ack, I will fix it in v2

> 
> > +
> > +    patternProperties:
> > +      "^r[0-9]+":
> > +        type: object
> > +        patternProperties:
> > +          "^txpower-[256]g$":
> > +            type: object
> > +            patternProperties:
> > +              "^b[0-9]+$":
> > +                type: object
> > +                properties:
> > +                  channels:
> > +                    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +                    minItems: 2
> > +                    maxItems: 2
> > +                    description:
> > +                      Pairs of first and last channel number of the selected
> > +                      band
> > +
> > +                  cck:
> > +                    $ref: /schemas/types.yaml#/definitions/uint32-array
> 
> What's the range of values? Could be 8-bit?

yes, I will fix it in v2

> 
> > +                    minItems: 4
> > +                    maxItems: 4
> > +                    description:
> > +                      4 half-dBm per-rate power limit values
> > +
> > +                  mcs:
> > +                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> > +                    description:
> > +                      Sets of per-rate power limit values for 802.11n/802.11ac
> > +                      rates for multiple channel bandwidth settings.
> > +                      Each set starts with the number of channel bandwidth
> > +                      settings for which the rate set applies, followed by
> > +                      either 8 or 10 power limit values. The order of the
> > +                      channel bandwidth settings is 20, 40, 80 and 160 MHz.
> > +
> > +                  ru:
> > +                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> > +                    description:
> > +                      Sets of per-rate power limit values for 802.11ax rates
> > +                      for multiple channel bandwidth or resource unit settings.
> > +                      Each set starts with the number of channel bandwidth or
> > +                      resource unit settings for which the rate set applies,
> > +                      followed by 12 power limit values. The order of the
> > +                      channel resource unit settings is RU26, RU52, RU106,
> > +                      RU242/SU20, RU484/SU40, RU996/SU80 and RU2x996/SU160.
> 
> These short property names bother me because we don't want 2 property 
> names with different meanings. A 2-3 letter name seems more likely to 
> collide. Also, the names aren't really self describing either.
> 
> > +
> > +                  txs-delta:
> > +                    $ref: /schemas/types.yaml#/definitions/uint32-array
> > +                    description:
> > +                      Half-dBm power delta for different numbers of antennas
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -93,6 +149,29 @@ examples:
> >          led {
> >            led-sources = <2>;
> >          };
> > +
> > +        power-limits {
> > +          r0 {
> > +            txpower-5g {
> > +               regdomain = "FCC";
> 
> Not the right location for what you've defined.

ack, I will fix it in v2

Regards,
Lorenzo

> 
> > +               b0 {
> > +                   channels = <36 48>;
> > +                   ofdm = <23 23 23 23 23 23 23 23>;
> > +                   mcs = <1 23 23 23 23 23 23 23 23 23 23>,
> > +                         <3 22 22 22 22 22 22 22 22 22 22>;
> > +                   ru = <3 22 22 22 22 22 22 22 22 22 22 22 22>,
> > +                        <4 20 20 20 20 20 20 20 20 20 20 20 20>;
> > +               };
> > +               b1 {
> > +                   channels = <100 181>;
> > +                   ofdm = <14 14 14 14 14 14 14 14>;
> > +                   mcs = <4 14 14 14 14 14 14 14 14 14 14>;
> > +                   txs-delta = <12 9 6>;
> > +                   ru = <7 14 14 14 14 14 14 14 14 14 14 14 14>;
> > +               };
> > +             };
> > +          };
> > +        };
> >        };
> >      };
> >  
> > -- 
> > 2.30.2
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
index d6f835d17d66..6ede331e3e52 100644
--- a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
+++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.yaml
@@ -72,6 +72,62 @@  properties:
       led-sources:
         maxItems: 1
 
+  power-limits:
+    type: object
+    properties:
+      regdomain: true
+
+    patternProperties:
+      "^r[0-9]+":
+        type: object
+        patternProperties:
+          "^txpower-[256]g$":
+            type: object
+            patternProperties:
+              "^b[0-9]+$":
+                type: object
+                properties:
+                  channels:
+                    $ref: /schemas/types.yaml#/definitions/uint32-array
+                    minItems: 2
+                    maxItems: 2
+                    description:
+                      Pairs of first and last channel number of the selected
+                      band
+
+                  cck:
+                    $ref: /schemas/types.yaml#/definitions/uint32-array
+                    minItems: 4
+                    maxItems: 4
+                    description:
+                      4 half-dBm per-rate power limit values
+
+                  mcs:
+                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+                    description:
+                      Sets of per-rate power limit values for 802.11n/802.11ac
+                      rates for multiple channel bandwidth settings.
+                      Each set starts with the number of channel bandwidth
+                      settings for which the rate set applies, followed by
+                      either 8 or 10 power limit values. The order of the
+                      channel bandwidth settings is 20, 40, 80 and 160 MHz.
+
+                  ru:
+                    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+                    description:
+                      Sets of per-rate power limit values for 802.11ax rates
+                      for multiple channel bandwidth or resource unit settings.
+                      Each set starts with the number of channel bandwidth or
+                      resource unit settings for which the rate set applies,
+                      followed by 12 power limit values. The order of the
+                      channel resource unit settings is RU26, RU52, RU106,
+                      RU242/SU20, RU484/SU40, RU996/SU80 and RU2x996/SU160.
+
+                  txs-delta:
+                    $ref: /schemas/types.yaml#/definitions/uint32-array
+                    description:
+                      Half-dBm power delta for different numbers of antennas
+
 required:
   - compatible
   - reg
@@ -93,6 +149,29 @@  examples:
         led {
           led-sources = <2>;
         };
+
+        power-limits {
+          r0 {
+            txpower-5g {
+               regdomain = "FCC";
+               b0 {
+                   channels = <36 48>;
+                   ofdm = <23 23 23 23 23 23 23 23>;
+                   mcs = <1 23 23 23 23 23 23 23 23 23 23>,
+                         <3 22 22 22 22 22 22 22 22 22 22>;
+                   ru = <3 22 22 22 22 22 22 22 22 22 22 22 22>,
+                        <4 20 20 20 20 20 20 20 20 20 20 20 20>;
+               };
+               b1 {
+                   channels = <100 181>;
+                   ofdm = <14 14 14 14 14 14 14 14>;
+                   mcs = <4 14 14 14 14 14 14 14 14 14 14>;
+                   txs-delta = <12 9 6>;
+                   ru = <7 14 14 14 14 14 14 14 14 14 14 14 14>;
+               };
+             };
+          };
+        };
       };
     };