All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
@ 2022-09-26 12:47 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-26 12:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, linux-arm-kernel,
	linux-samsung-soc, devicetree, linux-kernel

Compatible is a string-array, therefore the "select" should look for
anything containing Samsung SoC part.  This allows to validate cases
like:
 - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
 - "samsung,exynos5250-pmu", "syscon"
 - "tesla,fsd-mct", "samsung,exynos4210-mct"

Since Tesla FSD builts on top of Exynos blocks, add an adidtional
pattern for it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
index 653f85997643..bb1fdc205b44 100644
--- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
+++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
@@ -18,17 +18,33 @@ description: |
     samsung,exynos5433-cmu-isp
 
 select:
-  properties:
-    compatible:
-      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
+  allOf:
+    - properties:
+        $nodename:
+          pattern: '^[a-z]'
+    - properties:
+        compatible:
+          contains:
+            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
   required:
     - compatible
 
 properties:
   compatible:
     oneOf:
-      - description: Preferred naming style for compatibles of SoC components
-        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
+      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
+        minItems: 1
+        items:
+          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
+          - {}
+          - {}
+
+      - description: Preferred naming style for compatibles of Tesla FSD SoC components
+        minItems: 1
+        items:
+          - pattern: "^tesla,fsd-.*$"
+          - {}
+          - {}
 
       # Legacy compatibles with wild-cards - list cannot grow with new bindings:
       - enum:
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
@ 2022-09-26 12:47 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-26 12:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, linux-arm-kernel,
	linux-samsung-soc, devicetree, linux-kernel

Compatible is a string-array, therefore the "select" should look for
anything containing Samsung SoC part.  This allows to validate cases
like:
 - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
 - "samsung,exynos5250-pmu", "syscon"
 - "tesla,fsd-mct", "samsung,exynos4210-mct"

Since Tesla FSD builts on top of Exynos blocks, add an adidtional
pattern for it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
index 653f85997643..bb1fdc205b44 100644
--- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
+++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
@@ -18,17 +18,33 @@ description: |
     samsung,exynos5433-cmu-isp
 
 select:
-  properties:
-    compatible:
-      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
+  allOf:
+    - properties:
+        $nodename:
+          pattern: '^[a-z]'
+    - properties:
+        compatible:
+          contains:
+            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
   required:
     - compatible
 
 properties:
   compatible:
     oneOf:
-      - description: Preferred naming style for compatibles of SoC components
-        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
+      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
+        minItems: 1
+        items:
+          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
+          - {}
+          - {}
+
+      - description: Preferred naming style for compatibles of Tesla FSD SoC components
+        minItems: 1
+        items:
+          - pattern: "^tesla,fsd-.*$"
+          - {}
+          - {}
 
       # Legacy compatibles with wild-cards - list cannot grow with new bindings:
       - enum:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
  2022-09-26 12:47 ` Krzysztof Kozlowski
@ 2022-09-29 21:28   ` Rob Herring
  -1 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2022-09-29 21:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, devicetree,
	linux-kernel

On Mon, Sep 26, 2022 at 02:47:57PM +0200, Krzysztof Kozlowski wrote:
> Compatible is a string-array, therefore the "select" should look for
> anything containing Samsung SoC part.  This allows to validate cases
> like:
>  - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
>  - "samsung,exynos5250-pmu", "syscon"
>  - "tesla,fsd-mct", "samsung,exynos4210-mct"
> 
> Since Tesla FSD builts on top of Exynos blocks, add an adidtional
> pattern for it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
>  1 file changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> index 653f85997643..bb1fdc205b44 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> +++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> @@ -18,17 +18,33 @@ description: |
>      samsung,exynos5433-cmu-isp
>  
>  select:
> -  properties:
> -    compatible:
> -      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
> +  allOf:
> +    - properties:
> +        $nodename:
> +          pattern: '^[a-z]'

Why do you need this?

> +    - properties:
> +        compatible:
> +          contains:
> +            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>    required:
>      - compatible
>  
>  properties:
>    compatible:
>      oneOf:
> -      - description: Preferred naming style for compatibles of SoC components
> -        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
> +      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
> +        minItems: 1
> +        items:
> +          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
> +          - {}
> +          - {}

Wouldn't just contains be fine here too:

contains:
  pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"

> +
> +      - description: Preferred naming style for compatibles of Tesla FSD SoC components
> +        minItems: 1
> +        items:
> +          - pattern: "^tesla,fsd-.*$"
> +          - {}
> +          - {}
>  
>        # Legacy compatibles with wild-cards - list cannot grow with new bindings:
>        - enum:
> -- 
> 2.34.1
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
@ 2022-09-29 21:28   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2022-09-29 21:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, devicetree,
	linux-kernel

On Mon, Sep 26, 2022 at 02:47:57PM +0200, Krzysztof Kozlowski wrote:
> Compatible is a string-array, therefore the "select" should look for
> anything containing Samsung SoC part.  This allows to validate cases
> like:
>  - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
>  - "samsung,exynos5250-pmu", "syscon"
>  - "tesla,fsd-mct", "samsung,exynos4210-mct"
> 
> Since Tesla FSD builts on top of Exynos blocks, add an adidtional
> pattern for it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
>  1 file changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> index 653f85997643..bb1fdc205b44 100644
> --- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> +++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
> @@ -18,17 +18,33 @@ description: |
>      samsung,exynos5433-cmu-isp
>  
>  select:
> -  properties:
> -    compatible:
> -      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
> +  allOf:
> +    - properties:
> +        $nodename:
> +          pattern: '^[a-z]'

Why do you need this?

> +    - properties:
> +        compatible:
> +          contains:
> +            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>    required:
>      - compatible
>  
>  properties:
>    compatible:
>      oneOf:
> -      - description: Preferred naming style for compatibles of SoC components
> -        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
> +      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
> +        minItems: 1
> +        items:
> +          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
> +          - {}
> +          - {}

Wouldn't just contains be fine here too:

contains:
  pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"

> +
> +      - description: Preferred naming style for compatibles of Tesla FSD SoC components
> +        minItems: 1
> +        items:
> +          - pattern: "^tesla,fsd-.*$"
> +          - {}
> +          - {}
>  
>        # Legacy compatibles with wild-cards - list cannot grow with new bindings:
>        - enum:
> -- 
> 2.34.1
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
  2022-09-29 21:28   ` Rob Herring
@ 2022-09-30  7:07     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-30  7:07 UTC (permalink / raw)
  To: Rob Herring
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, devicetree,
	linux-kernel

On 29/09/2022 23:28, Rob Herring wrote:
> On Mon, Sep 26, 2022 at 02:47:57PM +0200, Krzysztof Kozlowski wrote:
>> Compatible is a string-array, therefore the "select" should look for
>> anything containing Samsung SoC part.  This allows to validate cases
>> like:
>>  - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
>>  - "samsung,exynos5250-pmu", "syscon"
>>  - "tesla,fsd-mct", "samsung,exynos4210-mct"
>>
>> Since Tesla FSD builts on top of Exynos blocks, add an adidtional
>> pattern for it.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
>>  1 file changed, 21 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> index 653f85997643..bb1fdc205b44 100644
>> --- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> +++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> @@ -18,17 +18,33 @@ description: |
>>      samsung,exynos5433-cmu-isp
>>  
>>  select:
>> -  properties:
>> -    compatible:
>> -      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>> +  allOf:
>> +    - properties:
>> +        $nodename:
>> +          pattern: '^[a-z]'
> 
> Why do you need this?

Because otherwise I am matching top-level board compatible, which
obviously do not fall into my patterns.

> 
>> +    - properties:
>> +        compatible:
>> +          contains:
>> +            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>>    required:
>>      - compatible
>>  
>>  properties:
>>    compatible:
>>      oneOf:
>> -      - description: Preferred naming style for compatibles of SoC components
>> -        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
>> +      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
>> +        minItems: 1
>> +        items:
>> +          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
>> +          - {}
>> +          - {}
> 
> Wouldn't just contains be fine here too:
> 
> contains:
>   pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"

Somehow it does not work like it should - nodes with wrong compatibles
pass. I tested with fake compatibles like:
samsung,cmu-exynos5433-cmu-top
samsung,exynos54xx-cmu-cpif

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible
@ 2022-09-30  7:07     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-30  7:07 UTC (permalink / raw)
  To: Rob Herring
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, devicetree,
	linux-kernel

On 29/09/2022 23:28, Rob Herring wrote:
> On Mon, Sep 26, 2022 at 02:47:57PM +0200, Krzysztof Kozlowski wrote:
>> Compatible is a string-array, therefore the "select" should look for
>> anything containing Samsung SoC part.  This allows to validate cases
>> like:
>>  - "samsung,exynos5250-gsc", "samsung,exynos5-gsc"
>>  - "samsung,exynos5250-pmu", "syscon"
>>  - "tesla,fsd-mct", "samsung,exynos4210-mct"
>>
>> Since Tesla FSD builts on top of Exynos blocks, add an adidtional
>> pattern for it.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  .../bindings/arm/samsung/samsung-soc.yaml     | 26 +++++++++++++++----
>>  1 file changed, 21 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> index 653f85997643..bb1fdc205b44 100644
>> --- a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> +++ b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
>> @@ -18,17 +18,33 @@ description: |
>>      samsung,exynos5433-cmu-isp
>>  
>>  select:
>> -  properties:
>> -    compatible:
>> -      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>> +  allOf:
>> +    - properties:
>> +        $nodename:
>> +          pattern: '^[a-z]'
> 
> Why do you need this?

Because otherwise I am matching top-level board compatible, which
obviously do not fall into my patterns.

> 
>> +    - properties:
>> +        compatible:
>> +          contains:
>> +            pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
>>    required:
>>      - compatible
>>  
>>  properties:
>>    compatible:
>>      oneOf:
>> -      - description: Preferred naming style for compatibles of SoC components
>> -        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
>> +      - description: Preferred naming style for compatibles of S3C/S5P/Exynos SoC components
>> +        minItems: 1
>> +        items:
>> +          - pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
>> +          - {}
>> +          - {}
> 
> Wouldn't just contains be fine here too:
> 
> contains:
>   pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"

Somehow it does not work like it should - nodes with wrong compatibles
pass. I tested with fake compatibles like:
samsung,cmu-exynos5433-cmu-top
samsung,exynos54xx-cmu-cpif

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-30  7:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 12:47 [PATCH] dt-bindings: samsung: soc: match preferred naming in entire compatible Krzysztof Kozlowski
2022-09-26 12:47 ` Krzysztof Kozlowski
2022-09-29 21:28 ` Rob Herring
2022-09-29 21:28   ` Rob Herring
2022-09-30  7:07   ` Krzysztof Kozlowski
2022-09-30  7:07     ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.