Message ID | 20250105160346.418829-2-ivo.ivanov.ivanov1@gmail.com |
---|---|
State | New |
Headers | show |
Series | soc: samsung: usi: implement support for USIv1 | expand |
diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml index 5b046932f..cc92a06a3 100644 --- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml @@ -144,7 +144,7 @@ examples: compatible = "samsung,exynos850-usi"; reg = <0x138200c0 0x20>; samsung,sysreg = <&sysreg_peri 0x1010>; - samsung,mode = <USI_V2_UART>; + samsung,mode = <USI_MODE_UART>; samsung,clkreq-on; /* needed for UART mode */ #address-cells = <1>; #size-cells = <1>; diff --git a/include/dt-bindings/soc/samsung,exynos-usi.h b/include/dt-bindings/soc/samsung,exynos-usi.h index a01af169d..b7c1406f3 100644 --- a/include/dt-bindings/soc/samsung,exynos-usi.h +++ b/include/dt-bindings/soc/samsung,exynos-usi.h @@ -9,9 +9,9 @@ #ifndef __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H #define __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H -#define USI_V2_NONE 0 -#define USI_V2_UART 1 -#define USI_V2_SPI 2 -#define USI_V2_I2C 3 +#define USI_MODE_NONE 0 +#define USI_MODE_UART 1 +#define USI_MODE_SPI 2 +#define USI_MODE_I2C 3 #endif /* __DT_BINDINGS_SAMSUNG_EXYNOS_USI_H */
In the original bindings commit, protocol mode definitions were named with the version of the supported USI (in this case, V2) with the idea of leaving enough room in the future for other versions of this block. This, however, is not how the modes should be modelled. The modes are not version specific and you should not be able to tell USI which version of a mode to use - that has to be handled in the driver - thus encoding this information in the binding is meaningless. Only one constant per mode is needed, so replace USI_V2_ with USI_MODE_ in all constants in the bindings. Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com> --- I wasn't sure if it was appropriate to add a Suggested-by tag for Krzysztof because I haven't asked for his permission, so I didn't, but if he wants to add it before merging, please do so! These changes are a bit tricky to approach. My guess was that this would be the best way to put it out - one patch for fixing it in the bindings and trees, then add exynos8895 to the bindings, fiddle with the driver and finally rename the constants in device trees. This breaks compilation if the whole series is not applied, because the driver, the binding and the device trees use the dt-bindings header. If anyone thinks of a better solution to organising the patches, let me know. --- .../devicetree/bindings/soc/samsung/exynos-usi.yaml | 2 +- include/dt-bindings/soc/samsung,exynos-usi.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)