diff mbox series

[1/5] dt-bindings: phy: cadence-torrent: Add second optional input reference clock

Message ID 20230724150002.5645-2-sjakhade@cadence.com
State Changes Requested
Headers show
Series PHY: Add support for dual refclk configurations in Cadence Torrent PHY driver | expand

Commit Message

Swapnil Kashinath Jakhade July 24, 2023, 2:59 p.m. UTC
Torrent(SD0801) PHY supports two input reference clocks. Update bindings
to support dual reference clock multilink configurations.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
---
 .../bindings/phy/phy-cadence-torrent.yaml     | 23 +++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)

Comments

Conor Dooley July 24, 2023, 5:53 p.m. UTC | #1
On Mon, Jul 24, 2023 at 04:59:58PM +0200, Swapnil Jakhade wrote:
> Torrent(SD0801) PHY supports two input reference clocks. Update bindings
> to support dual reference clock multilink configurations.
> 
> Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
> ---
>  .../bindings/phy/phy-cadence-torrent.yaml     | 23 +++++++++++++------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> index dfb31314face..ddb86ee0cebf 100644
> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> @@ -33,16 +33,25 @@ properties:
>  
>    clocks:
>      minItems: 1
> -    maxItems: 2
> +    maxItems: 3
>      description:
> -      PHY reference clock for 1 item. Must contain an entry in clock-names.
> -      Optional Parent to enable output reference clock.
> +      PHY input reference clocks (refclk & refclk1).

"refclk" and "refclk1" don't seem like great names. What is each one
used for & should refclk1 be renamed to match its use case?

> +      Optional Parent to enable output reference clock (phy_en_refclk).
>  
>    clock-names:
> -    minItems: 1
> -    items:
> -      - const: refclk
> -      - const: phy_en_refclk
> +    oneOf:
> +      - items:
> +          - const: refclk
> +      - items:
> +          - const: refclk
> +          - const: phy_en_refclk
> +      - items:
> +          - const: refclk
> +          - const: refclk1
> +      - items:
> +          - const: refclk
> +          - const: refclk1
> +          - const: phy_en_refclk
>  
>    reg:
>      minItems: 1
> -- 
> 2.34.1
>
Rob Herring July 26, 2023, 5:05 p.m. UTC | #2
On Mon, Jul 24, 2023 at 04:59:58PM +0200, Swapnil Jakhade wrote:
> Torrent(SD0801) PHY supports two input reference clocks. Update bindings
> to support dual reference clock multilink configurations.
> 
> Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
> ---
>  .../bindings/phy/phy-cadence-torrent.yaml     | 23 +++++++++++++------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> index dfb31314face..ddb86ee0cebf 100644
> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> @@ -33,16 +33,25 @@ properties:
>  
>    clocks:
>      minItems: 1
> -    maxItems: 2
> +    maxItems: 3
>      description:
> -      PHY reference clock for 1 item. Must contain an entry in clock-names.
> -      Optional Parent to enable output reference clock.
> +      PHY input reference clocks (refclk & refclk1).
> +      Optional Parent to enable output reference clock (phy_en_refclk).
>  
>    clock-names:
> -    minItems: 1
> -    items:
> -      - const: refclk
> -      - const: phy_en_refclk
> +    oneOf:
> +      - items:
> +          - const: refclk
> +      - items:
> +          - const: refclk
> +          - const: phy_en_refclk
> +      - items:
> +          - const: refclk
> +          - const: refclk1
> +      - items:
> +          - const: refclk
> +          - const: refclk1
> +          - const: phy_en_refclk

Can be simplified to:

minItems: 1
items:
  - const: refclk
  - enum: [ refclk1, phy_en_refclk ]
  - const: phy_en_refclk

*-names already requires each entry to be unique, so you don't have to 
worry about that case.

Rob
Roger Quadros Dec. 11, 2023, 12:45 p.m. UTC | #3
Hi Conor,

On 24/07/2023 20:53, Conor Dooley wrote:
> On Mon, Jul 24, 2023 at 04:59:58PM +0200, Swapnil Jakhade wrote:
>> Torrent(SD0801) PHY supports two input reference clocks. Update bindings
>> to support dual reference clock multilink configurations.
>>
>> Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
>> ---
>>  .../bindings/phy/phy-cadence-torrent.yaml     | 23 +++++++++++++------
>>  1 file changed, 16 insertions(+), 7 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>> index dfb31314face..ddb86ee0cebf 100644
>> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
>> @@ -33,16 +33,25 @@ properties:
>>  
>>    clocks:
>>      minItems: 1
>> -    maxItems: 2
>> +    maxItems: 3
>>      description:
>> -      PHY reference clock for 1 item. Must contain an entry in clock-names.
>> -      Optional Parent to enable output reference clock.
>> +      PHY input reference clocks (refclk & refclk1).
> 
> "refclk" and "refclk1" don't seem like great names. What is each one
> used for & should refclk1 be renamed to match its use case?

All PHYs need one refclk input. "refclk"
Some PHY variants can take a second refclk input. Both are refclks so it was
chosen to add an "1" to the name to the 2nd refclk.
Please suggest if you have a better idea. Thanks!

> 
>> +      Optional Parent to enable output reference clock (phy_en_refclk).
>>  
>>    clock-names:
>> -    minItems: 1
>> -    items:
>> -      - const: refclk
>> -      - const: phy_en_refclk
>> +    oneOf:
>> +      - items:
>> +          - const: refclk
>> +      - items:
>> +          - const: refclk
>> +          - const: phy_en_refclk
>> +      - items:
>> +          - const: refclk
>> +          - const: refclk1
>> +      - items:
>> +          - const: refclk
>> +          - const: refclk1
>> +          - const: phy_en_refclk
>>  
>>    reg:
>>      minItems: 1
>> -- 
>> 2.34.1
>>
Conor Dooley Dec. 11, 2023, 12:59 p.m. UTC | #4
On Mon, Dec 11, 2023 at 02:45:48PM +0200, Roger Quadros wrote:
> Hi Conor,
> 
> On 24/07/2023 20:53, Conor Dooley wrote:
> > On Mon, Jul 24, 2023 at 04:59:58PM +0200, Swapnil Jakhade wrote:
> >> Torrent(SD0801) PHY supports two input reference clocks. Update bindings
> >> to support dual reference clock multilink configurations.
> >>
> >> Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
> >> ---
> >>  .../bindings/phy/phy-cadence-torrent.yaml     | 23 +++++++++++++------
> >>  1 file changed, 16 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> >> index dfb31314face..ddb86ee0cebf 100644
> >> --- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> >> +++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
> >> @@ -33,16 +33,25 @@ properties:
> >>  
> >>    clocks:
> >>      minItems: 1
> >> -    maxItems: 2
> >> +    maxItems: 3
> >>      description:
> >> -      PHY reference clock for 1 item. Must contain an entry in clock-names.
> >> -      Optional Parent to enable output reference clock.
> >> +      PHY input reference clocks (refclk & refclk1).
> > 
> > "refclk" and "refclk1" don't seem like great names. What is each one
> > used for & should refclk1 be renamed to match its use case?
> 
> All PHYs need one refclk input. "refclk"
> Some PHY variants can take a second refclk input. Both are refclks so it was
> chosen to add an "1" to the name to the 2nd refclk.
> Please suggest if you have a better idea. Thanks!

The existing second clock name (phy_en_refclk) might serve as
inspiration. What is the additional role that the second reference
serves?

> 
> > 
> >> +      Optional Parent to enable output reference clock (phy_en_refclk).
> >>  
> >>    clock-names:
> >> -    minItems: 1
> >> -    items:
> >> -      - const: refclk
> >> -      - const: phy_en_refclk
> >> +    oneOf:
> >> +      - items:
> >> +          - const: refclk
> >> +      - items:
> >> +          - const: refclk
> >> +          - const: phy_en_refclk
> >> +      - items:
> >> +          - const: refclk
> >> +          - const: refclk1
> >> +      - items:
> >> +          - const: refclk
> >> +          - const: refclk1
> >> +          - const: phy_en_refclk
> >>  
> >>    reg:
> >>      minItems: 1
> >> -- 
> >> 2.34.1
> >>
> 
> -- 
> cheers,
> -roger
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
index dfb31314face..ddb86ee0cebf 100644
--- a/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
+++ b/Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
@@ -33,16 +33,25 @@  properties:
 
   clocks:
     minItems: 1
-    maxItems: 2
+    maxItems: 3
     description:
-      PHY reference clock for 1 item. Must contain an entry in clock-names.
-      Optional Parent to enable output reference clock.
+      PHY input reference clocks (refclk & refclk1).
+      Optional Parent to enable output reference clock (phy_en_refclk).
 
   clock-names:
-    minItems: 1
-    items:
-      - const: refclk
-      - const: phy_en_refclk
+    oneOf:
+      - items:
+          - const: refclk
+      - items:
+          - const: refclk
+          - const: phy_en_refclk
+      - items:
+          - const: refclk
+          - const: refclk1
+      - items:
+          - const: refclk
+          - const: refclk1
+          - const: phy_en_refclk
 
   reg:
     minItems: 1