diff mbox series

[4/5] dt-bindings: mmc: Add Broadcom optional sdio_freq clock

Message ID 20220421182803.6495-5-kdasu.kdev@gmail.com
State Superseded
Headers show
Series mmc: sdhci-brcmstb: host controller clock enhancements | expand

Commit Message

Kamal Dasu April 21, 2022, 6:28 p.m. UTC
The 72116B0 has improved SDIO controllers that allow the max clock
rate to be increased from a max of 100MHz to a max of 150MHz.
Optional "sdio_freq" clock is used to drive the bus clock if present
optional property "clock-frequency" specifies a base clock frequency
in Hz that overrides the base clock frequency in the CAPS registers.

Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 .../bindings/mmc/brcm,sdhci-brcmstb.yaml      | 29 +++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

Comments

Kamal Dasu April 27, 2022, 3:40 p.m. UTC | #1
On Fri, Apr 22, 2022 at 1:07 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 21/04/2022 20:28, Kamal Dasu wrote:
> > The 72116B0 has improved SDIO controllers that allow the max clock
> > rate to be increased from a max of 100MHz to a max of 150MHz.
> > Optional "sdio_freq" clock is used to drive the bus clock if present
> > optional property "clock-frequency" specifies a base clock frequency
> > in Hz that overrides the base clock frequency in the CAPS registers.
> >
> > Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> > ---
> >  .../bindings/mmc/brcm,sdhci-brcmstb.yaml      | 29 +++++++++++++++----
> >  1 file changed, 24 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml b/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
> > index dccd5ad96981..1b45a918400a 100644
> > --- a/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
> > @@ -10,8 +10,6 @@ maintainers:
> >    - Al Cooper <alcooperx@gmail.com>
> >    - Florian Fainelli <f.fainelli@gmail.com>
> >
> > -allOf:
> > -  - $ref: mmc-controller.yaml#
> >
> >  properties:
> >    compatible:
> > @@ -42,23 +40,44 @@ properties:
> >      maxItems: 1
> >
> >    clocks:
> > -    maxItems: 1
> > -    description:
> > -      handle to core clock for the sdhci controller.
> > +    minItems: 1
> > +    items:
> > +      - description: handle to core clock for the sdhci controller
> > +      - description: improved 150Mhz clock for sdhci controller (Optional clock)
> >
> >    clock-names:
> > +    minItems: 1
> >      items:
> >        - const: sw_sdio
> > +      - const: sdio_freq # Optional clock
> > +
> > +  clock-frequency:
> > +    description: Should be the frequency (in Hz) of the base controller clock
> > +    minimum: 400000
> > +    maximum: 150000000
>
> Why do you need this property? The mmc-controller.yaml already has
> max-frequency, so maybe that suits your needs?
>

Yes I can use max-frequency, I will make the changes to patch 4/5 and
change 5/5 and send a v2 patchset.

>
> Best regards,
> Krzysztof

Thanks
Kamal
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml b/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
index dccd5ad96981..1b45a918400a 100644
--- a/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
+++ b/Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
@@ -10,8 +10,6 @@  maintainers:
   - Al Cooper <alcooperx@gmail.com>
   - Florian Fainelli <f.fainelli@gmail.com>
 
-allOf:
-  - $ref: mmc-controller.yaml#
 
 properties:
   compatible:
@@ -42,23 +40,44 @@  properties:
     maxItems: 1
 
   clocks:
-    maxItems: 1
-    description:
-      handle to core clock for the sdhci controller.
+    minItems: 1
+    items:
+      - description: handle to core clock for the sdhci controller
+      - description: improved 150Mhz clock for sdhci controller (Optional clock)
 
   clock-names:
+    minItems: 1
     items:
       - const: sw_sdio
+      - const: sdio_freq # Optional clock
+
+  clock-frequency:
+    description: Should be the frequency (in Hz) of the base controller clock
+    minimum: 400000
+    maximum: 150000000
 
   sdhci,auto-cmd12:
     type: boolean
     description: Specifies that controller should use auto CMD12
 
+allOf:
+  - $ref: mmc-controller.yaml#
+  - if:
+      properties:
+        clock-names:
+          contains:
+            const: sdio_freq
+
+  - then:
+      required:
+        - clock-frequency
+
 required:
   - compatible
   - reg
   - interrupts
   - clocks
+  - clock-names
 
 unevaluatedProperties: false