diff mbox series

[2/4] dt-bindings: pwm: tiehrpwm: Make clock and clock-names as required properties

Message ID 20210526084306.6534-3-lokeshvutla@ti.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: pwm: pwm-tiehrpwm: Convert to json schema | expand

Commit Message

Lokesh Vutla May 26, 2021, 8:43 a.m. UTC
Driver fails to probe when 'clock' and 'clock-names' properties are not
populated in DT. But the binding documentation says these properties are
optional. Fix this by making 'clock' and 'clock-names' properties as
required.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Grygorii Strashko May 31, 2021, 11:21 a.m. UTC | #1
On 26/05/2021 11:43, Lokesh Vutla wrote:
> Driver fails to probe when 'clock' and 'clock-names' properties are not
> populated in DT. But the binding documentation says these properties are
> optional. Fix this by making 'clock' and 'clock-names' properties as
> required.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
>   Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
> index e124e41418d8..8eae48c9c5cd 100644
> --- a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
> @@ -11,8 +11,6 @@ Required properties:
>     the cells format. The only third cell flag supported by this binding is
>     PWM_POLARITY_INVERTED.
>   - reg: physical base address and size of the registers map.
> -
> -Optional properties:
>   - clocks: Handle to the PWM's time-base and functional clock.
>   - clock-names: Must be set to "tbclk" and "fck".
>   
> @@ -38,6 +36,8 @@ ehrpwm0: pwm@1f00000 { /* EHRPWM on da850 */
>   	compatible = "ti,da850-ehrpwm", "ti,am3352-ehrpwm";
>   	#pwm-cells = <3>;
>   	reg = <0x1f00000 0x2000>;
> +	clocks = <&psc1 17>, <&ehrpwm_tbclk>;
> +	clock-names = "fck", "tbclk";
>   };
>   
>   ehrpwm0: pwm@4843e200 { /* EHRPWM on dra746 */
> 

Here also, many text bindings missed standard props or miss-define them comparing to code,
which is accumulated over years. Now, thanks to .yaml conversation, we can catch them.

So, I ,personally, do not see reasons for separate patch here and think it can be done as part of
Patch 3.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
index e124e41418d8..8eae48c9c5cd 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
@@ -11,8 +11,6 @@  Required properties:
   the cells format. The only third cell flag supported by this binding is
   PWM_POLARITY_INVERTED.
 - reg: physical base address and size of the registers map.
-
-Optional properties:
 - clocks: Handle to the PWM's time-base and functional clock.
 - clock-names: Must be set to "tbclk" and "fck".
 
@@ -38,6 +36,8 @@  ehrpwm0: pwm@1f00000 { /* EHRPWM on da850 */
 	compatible = "ti,da850-ehrpwm", "ti,am3352-ehrpwm";
 	#pwm-cells = <3>;
 	reg = <0x1f00000 0x2000>;
+	clocks = <&psc1 17>, <&ehrpwm_tbclk>;
+	clock-names = "fck", "tbclk";
 };
 
 ehrpwm0: pwm@4843e200 { /* EHRPWM on dra746 */