From: André Draszik <andre.draszik@linaro.org> Date: 2024-07-12 14:51:19
This series started as a single patch [1] (as part of [2]) to fix a few
issues with the UART on gs101.
In [3], Rob pointed out that the binding here shouldn't be duplicating
clock-names all over the place.
So now we have a patch to do what Rob suggested, and my original patch to
address the incorrect number of clocks.
The whole series is marked as v4, because patch 2 in this series used to be
v3 in the original series.
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jiri Slaby <jirislaby@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
Cc: Peter Griffin <peter.griffin@linaro.org>
Cc: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Will McVicker <redacted>
Cc: kernel-team@android.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: devicetree@vger.kernel.org
Signed-off-by: André Draszik <andre.draszik@linaro.org>
[1] https://lore.kernel.org/all/20240710-gs101-non-essential-clocks-2-v3-1-5dcb8d040d1c@linaro.org/
[2] https://lore.kernel.org/all/20240710-gs101-non-essential-clocks-2-v3-0-5dcb8d040d1c@linaro.org/
[3] https://lore.kernel.org/all/20240711212359.GA3023490-robh@kernel.org/
---
André Draszik (2):
dt-bindings: serial: samsung: avoid duplicating permitted clock-names
dt-bindings: serial: samsung: fix maxItems for gs101
.../devicetree/bindings/serial/samsung_uart.yaml | 69 ++++++++++++++++++----
1 file changed, 56 insertions(+), 13 deletions(-)
---
base-commit: 523b23f0bee3014a7a752c9bb9f5c54f0eddae88
change-id: 20240712-gs101-uart-binding-b47f3a270c36
Best regards,
--
André Draszik [off-list ref]
From: André Draszik <andre.draszik@linaro.org> Date: 2024-07-12 14:51:19
This binding currently duplicates the permitted clock-names in various
places, and when adding more compatibles, clock-names will have to be
duplicated even more.
The reason is:
1) subschemas (-if: ...), still have to match the top-level:
pattern: '^clk_uart_baud[0-3]$'
2) there is one compatible that doesn't follow sequential numbering for
the clock names (samsung,s3c6400-uart)
3) when limiting the number of clock-names, we also want to enforce
sequential names
Because of 1) and 2), the patterns can not simply be changed to
constant strings, and later overridden in a different subschema (for
samsung,s3c6400-uart only).
Since we can't populate the top-level clock-names based on the
compatible, and because when limiting the number of items we generally
want sequential numbers and not a pattern, move the permitted strings
into a subschema of its own and populate it based on the compatible:
* 'uart clk_uart_baud2 clk_uart_baud3' for the one outlier
* 'uart clk_uart_baud0..3' for everything else
This way we can avoid having to duplicate the permitted names
everywhere.
While at it, add blank lines as per the universal style, which is to
have blank lines between properties, except where they are booleans.
Also add another example using a compatible that uses the default
clock-names scheme, as opposed to the existing example that uses
samsung,s3c6400-uart's non-default clock-names. This allows testing
both versions of the clock-names property when running
dt_binding_check.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
.../devicetree/bindings/serial/samsung_uart.yaml | 63 +++++++++++++++++-----
1 file changed, 50 insertions(+), 13 deletions(-)
From: André Draszik <andre.draszik@linaro.org> Date: 2024-07-12 14:51:20
While gs101 needs exactly two clocks for the UART, the schema doesn't
currently limit the maximum number to this and instead the default of
five from this schema is applied.
Update the schema accordingly.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
v4:
* drop description from clocks:, it was Linux-specific and a we'll
implement something that makes it obsolete anyway
* no need to duplicate clock-names anymore
---
Documentation/devicetree/bindings/serial/samsung_uart.yaml | 6 ++++++
1 file changed, 6 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2024-07-22 23:23:38
On Fri, Jul 12, 2024 at 03:51:17PM +0100, André Draszik wrote:
quoted hunk
This binding currently duplicates the permitted clock-names in various
places, and when adding more compatibles, clock-names will have to be
duplicated even more.
The reason is:
1) subschemas (-if: ...), still have to match the top-level:
pattern: '^clk_uart_baud[0-3]$'
2) there is one compatible that doesn't follow sequential numbering for
the clock names (samsung,s3c6400-uart)
3) when limiting the number of clock-names, we also want to enforce
sequential names
Because of 1) and 2), the patterns can not simply be changed to
constant strings, and later overridden in a different subschema (for
samsung,s3c6400-uart only).
Since we can't populate the top-level clock-names based on the
compatible, and because when limiting the number of items we generally
want sequential numbers and not a pattern, move the permitted strings
into a subschema of its own and populate it based on the compatible:
* 'uart clk_uart_baud2 clk_uart_baud3' for the one outlier
* 'uart clk_uart_baud0..3' for everything else
This way we can avoid having to duplicate the permitted names
everywhere.
While at it, add blank lines as per the universal style, which is to
have blank lines between properties, except where they are booleans.
Also add another example using a compatible that uses the default
clock-names scheme, as opposed to the existing example that uses
samsung,s3c6400-uart's non-default clock-names. This allows testing
both versions of the clock-names property when running
dt_binding_check.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
.../devicetree/bindings/serial/samsung_uart.yaml | 63 +++++++++++++++++-----
1 file changed, 50 insertions(+), 13 deletions(-)
On Fri, 12 Jul 2024 15:51:18 +0100, André Draszik wrote:
While gs101 needs exactly two clocks for the UART, the schema doesn't
currently limit the maximum number to this and instead the default of
five from this schema is applied.
Update the schema accordingly.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
v4:
* drop description from clocks:, it was Linux-specific and a we'll
implement something that makes it obsolete anyway
* no need to duplicate clock-names anymore
---
Documentation/devicetree/bindings/serial/samsung_uart.yaml | 6 ++++++
1 file changed, 6 insertions(+)