Skip to content

Commit 1f48d09

Browse files
akhilpo-qcomJie Zhang
authored andcommitted
FROMLIST: dt-bindings: display/msm: gpu: Simplify conditional schema logic
JSON Schema conditionals can become complex and error-prone when combined with regex patterns. To improve readability and maintainability, replace nested if-else blocks with a flattened structure using explicit enums. Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://lore.kernel.org/r/20251204-qcs615-spin-2-v4-2-f5a00c5b663f@oss.qualcomm.com
1 parent a7756f4 commit 1f48d09

File tree

1 file changed

+36
-20
lines changed
  • Documentation/devicetree/bindings/display/msm

1 file changed

+36
-20
lines changed

Documentation/devicetree/bindings/display/msm/gpu.yaml

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -388,26 +388,42 @@ allOf:
388388
required:
389389
- clocks
390390
- clock-names
391-
else:
392-
if:
393-
properties:
394-
compatible:
395-
contains:
396-
oneOf:
397-
- pattern: '^qcom,adreno-[67][0-9][0-9]\.[0-9]+$'
398-
- pattern: '^qcom,adreno-[0-9a-f]{8}$'
399-
400-
then: # Starting with A6xx, the clocks are usually defined in the GMU node
401-
properties:
402-
clocks: false
403-
clock-names: false
404-
405-
reg-names:
406-
minItems: 1
407-
items:
408-
- const: kgsl_3d0_reg_memory
409-
- const: cx_mem
410-
- const: cx_dbgc
391+
392+
- if:
393+
properties:
394+
compatible:
395+
contains:
396+
enum:
397+
- qcom,adreno-615.0
398+
- qcom,adreno-618.0
399+
- qcom,adreno-619.0
400+
- qcom,adreno-621.0
401+
- qcom,adreno-623.0
402+
- qcom,adreno-630.2
403+
- qcom,adreno-635.0
404+
- qcom,adreno-640.1
405+
- qcom,adreno-650.2
406+
- qcom,adreno-660.1
407+
- qcom,adreno-663.0
408+
- qcom,adreno-680.1
409+
- qcom,adreno-690.0
410+
- qcom,adreno-730.1
411+
- qcom,adreno-43030c00
412+
- qcom,adreno-43050a01
413+
- qcom,adreno-43050c01
414+
- qcom,adreno-43051401
415+
416+
then: # Starting with A6xx, the clocks are usually defined in the GMU node
417+
properties:
418+
clocks: false
419+
clock-names: false
420+
421+
reg-names:
422+
minItems: 1
423+
items:
424+
- const: kgsl_3d0_reg_memory
425+
- const: cx_mem
426+
- const: cx_dbgc
411427

412428
examples:
413429
- |

0 commit comments

Comments
 (0)