On 2020/1/12 4:50, Martin Blumenstingl wrote: > Hi Hanjie, > > On Fri, Jan 10, 2020 at 6:43 AM Hanjie Lin <hanjie.lin@xxxxxxxxxxx> wrote: > [...] >> @@ -37,6 +43,11 @@ properties: >> >> clocks: >> minItems: 1 >> + maxItems: 4 > the driver parses one clock for G12A/G12B/SM1 and three clocks for A1 > if there is a fourth clock: do we need to manage it in the driver? > (note: dt-bindings always represent the hardware, so if there's a > fourth clock which the driver doesn't need then it's perfectly valid > to describe it here. a comment which clock this is helps in the > code-review process) > Hi Martin, Sorry for this confusing, I moved xtal_usb_phy clock from glue driver to phy, but I missed this binding modification. So actually A1 do only need these three clocks and no fourth clock exist, clock and clock-names maxItems should be three here for A1. >> + clock-names: >> + minItems: 1 >> + maxItems: 4 > I let Rob comment on this, personally I prefer naming the clocks explicitly > also I think clock-names has to be a mandatory property for A1 (see > Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml > for an example which makes properties mandatory depending on the > compatible string) > > > Martin > > . > Thanks for your patient and detailed advice. Do you mean something like this: +allOf: + - if: + properties: + compatible: + enum: + - amlogic,meson-g12a-usb-ctrl + + then: + properties: + clocks: + minItems: 1 + + - if: + properties: + compatible: + enum: + - amlogic,meson-a1-usb-ctrl + + then: + properties: + clocks: + items: + minItems: 3 + clock-names: + items: + - const: usb_ctrl + - const: usb_bus + - const: xtal_usb_ctrl + required: + - clock-names Hanjie