Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: watchdog: samsung-wdt: Split if:then: and constrain more

Binding defined two if:then: blocks covering different conditions but
not fully constraining the properties per each variant:
1. "if:" to require samsung,syscon-phandle,
2. "if:" with "else:" to narrow number of clocks and require or disallow
samsung,cluster-index.

This still did not cover following cases:
1. Disallow samsung,syscon-phandle when not applicable,
2. Narrow samsung,cluster-index to [0, 1], for SoCs with only two
clusters.

Solving this in current format would lead to spaghetti code, so re-write
entire "if:then:" approach into mutually exclusive cases so each SoC
appears only in one "if:" block. This allows to forbid
samsung,syscon-phandle for S3C6410, and narrow samsung,cluster-index
to [0, 1].

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Krzysztof Kozlowski and committed by
Wim Van Sebroeck
8fa8380a 6a11dbf4

+52 -18
+52 -18
Documentation/devicetree/bindings/watchdog/samsung-wdt.yaml
··· 74 74 contains: 75 75 enum: 76 76 - google,gs101-wdt 77 - - samsung,exynos5250-wdt 78 - - samsung,exynos5420-wdt 79 - - samsung,exynos7-wdt 80 77 - samsung,exynos850-wdt 81 - - samsung,exynos990-wdt 82 - - samsung,exynosautov9-wdt 83 - - samsung,exynosautov920-wdt 84 - then: 85 - required: 86 - - samsung,syscon-phandle 87 - - if: 88 - properties: 89 - compatible: 90 - contains: 91 - enum: 92 - - google,gs101-wdt 93 - - samsung,exynos850-wdt 94 - - samsung,exynos990-wdt 95 78 - samsung,exynosautov9-wdt 96 79 - samsung,exynosautov920-wdt 97 80 then: ··· 87 104 items: 88 105 - const: watchdog 89 106 - const: watchdog_src 107 + samsung,cluster-index: 108 + enum: [0, 1] 90 109 required: 91 110 - samsung,cluster-index 92 - else: 111 + - samsung,syscon-phandle 112 + 113 + - if: 114 + properties: 115 + compatible: 116 + contains: 117 + enum: 118 + - samsung,exynos990-wdt 119 + then: 120 + properties: 121 + clocks: 122 + items: 123 + - description: Bus clock, used for register interface 124 + - description: Source clock (driving watchdog counter) 125 + clock-names: 126 + items: 127 + - const: watchdog 128 + - const: watchdog_src 129 + required: 130 + - samsung,cluster-index 131 + - samsung,syscon-phandle 132 + 133 + - if: 134 + properties: 135 + compatible: 136 + contains: 137 + enum: 138 + - samsung,exynos5250-wdt 139 + - samsung,exynos5420-wdt 140 + - samsung,exynos7-wdt 141 + then: 93 142 properties: 94 143 clocks: 95 144 items: ··· 130 115 items: 131 116 - const: watchdog 132 117 samsung,cluster-index: false 118 + required: 119 + - samsung,syscon-phandle 120 + 121 + - if: 122 + properties: 123 + compatible: 124 + contains: 125 + enum: 126 + - samsung,s3c6410-wdt 127 + then: 128 + properties: 129 + clocks: 130 + items: 131 + - description: Bus clock, which is also a source clock 132 + clock-names: 133 + items: 134 + - const: watchdog 135 + samsung,cluster-index: false 136 + samsung,syscon-phandle: false 133 137 134 138 unevaluatedProperties: false 135 139