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.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/696674/
Message-ID: <20251231-qcs615-spin-2-v6-2-da87debf6883@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
This commit is contained in:
Akhil P Oommen 2025-12-31 14:15:23 +05:30 committed by Rob Clark
parent e39333a81e
commit 158927e1f6

View File

@ -388,26 +388,42 @@ allOf:
required:
- clocks
- clock-names
else:
if:
properties:
compatible:
contains:
oneOf:
- pattern: '^qcom,adreno-[67][0-9][0-9]\.[0-9]+$'
- pattern: '^qcom,adreno-[0-9a-f]{8}$'
then: # Starting with A6xx, the clocks are usually defined in the GMU node
properties:
clocks: false
clock-names: false
- if:
properties:
compatible:
contains:
enum:
- qcom,adreno-615.0
- qcom,adreno-618.0
- qcom,adreno-619.0
- qcom,adreno-621.0
- qcom,adreno-623.0
- qcom,adreno-630.2
- qcom,adreno-635.0
- qcom,adreno-640.1
- qcom,adreno-650.2
- qcom,adreno-660.1
- qcom,adreno-663.0
- qcom,adreno-680.1
- qcom,adreno-690.0
- qcom,adreno-730.1
- qcom,adreno-43030c00
- qcom,adreno-43050a01
- qcom,adreno-43050c01
- qcom,adreno-43051401
reg-names:
minItems: 1
items:
- const: kgsl_3d0_reg_memory
- const: cx_mem
- const: cx_dbgc
then: # Starting with A6xx, the clocks are usually defined in the GMU node
properties:
clocks: false
clock-names: false
reg-names:
minItems: 1
items:
- const: kgsl_3d0_reg_memory
- const: cx_mem
- const: cx_dbgc
examples:
- |