diff mbox series

[v6,2/4] dt-bindings: spi: add new clock name 'axi' for spi nor

Message ID 20211211204014.8014-3-tinghan.shen@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Add basic SoC support for mediatek mt8195 | expand

Commit Message

Tinghan Shen Dec. 11, 2021, 8:40 p.m. UTC
Some mtk spi nor has dedicated dma(s) inside. Add a new clock name, axi,
for spi nor dma bus clock.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
 .../devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Mark Brown Dec. 13, 2021, 4:04 p.m. UTC | #1
On Sun, Dec 12, 2021 at 04:40:12AM +0800, Tinghan Shen wrote:

> Some mtk spi nor has dedicated dma(s) inside. Add a new clock name, axi,
> for spi nor dma bus clock.

>    clock-names:
> +    minItems: 2
>      items:
>        - const: spi
>        - const: sf
> +      - const: axi

This will cause any existing DTs that don't have both spi and sf clocks
defined to fail to validate which doesn't seem great.  Given that your
commit message says this is only required for some SoCs shouldn't the
minimum clocks requirement depend on which particular SoC/IP version is
being used?  Not exactly sure how one specifies that in the YAML format.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.
Rob Herring (Arm) Dec. 14, 2021, 4:26 p.m. UTC | #2
On Mon, Dec 13, 2021 at 04:04:48PM +0000, Mark Brown wrote:
> On Sun, Dec 12, 2021 at 04:40:12AM +0800, Tinghan Shen wrote:
> 
> > Some mtk spi nor has dedicated dma(s) inside. Add a new clock name, axi,
> > for spi nor dma bus clock.
> 
> >    clock-names:
> > +    minItems: 2
> >      items:
> >        - const: spi
> >        - const: sf
> > +      - const: axi
> 
> This will cause any existing DTs that don't have both spi and sf clocks
> defined to fail to validate which doesn't seem great.

That was true before this. The default for 'minItems' is the number of 
entries in 'items' (this is not the default for json-schema, but default 
for DT bindings as that's the common case).

> Given that your
> commit message says this is only required for some SoCs shouldn't the
> minimum clocks requirement depend on which particular SoC/IP version is
> being used?  Not exactly sure how one specifies that in the YAML format.

With an if/then schema adding maxItems/minItems constraints (e.g. 
'maxItems: 2' for existing compatibles). There are many examples in the 
tree.

Rob
Tinghan Shen Dec. 15, 2021, 2:03 a.m. UTC | #3
Hi Mark,

Thanks for the reviews and advice.


On Mon, 2021-12-13 at 16:04 +0000, Mark Brown wrote:
> On Sun, Dec 12, 2021 at 04:40:12AM +0800, Tinghan Shen wrote:
> 
> > Some mtk spi nor has dedicated dma(s) inside. Add a new clock name,
> > axi,
> > for spi nor dma bus clock.
> >    clock-names:
> > +    minItems: 2
> >      items:
> >        - const: spi
> >        - const: sf
> > +      - const: axi
> 
> This will cause any existing DTs that don't have both spi and sf
> clocks
> defined to fail to validate which doesn't seem great.  Given that
> your
> commit message says this is only required for some SoCs shouldn't the
> minimum clocks requirement depend on which particular SoC/IP version
> is
> being used?  Not exactly sure how one specifies that in the YAML
> format.
> 
> Please submit patches using subject lines reflecting the style for
> the
> subsystem, this makes it easier for people to identify relevant
> patches.
> Look at what existing commits in the area you're changing are doing
> and
> make sure your subject lines visually resemble what they're doing.
> There's no need to resubmit to fix this alone.

I'll update the subject at next version.
It'll be "dt-bindings: spi: mtk-spi-nor: ...".


regards,
TingHan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml b/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
index 7393f30535df..478afebfec9c 100644
--- a/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
@@ -43,14 +43,19 @@  properties:
     maxItems: 1
 
   clocks:
+    minItems: 2
     items:
       - description: clock used for spi bus
       - description: clock used for controller
+      - description: clock used for nor dma bus. this depends on hardware 
+                     design.
 
   clock-names:
+    minItems: 2
     items:
       - const: spi
       - const: sf
+      - const: axi
 
 required:
   - compatible
@@ -84,4 +89,3 @@  examples:
         };
       };
     };
-