2022-01-21 20:01:36

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v4 0/5] spi: dt-bindings: samsung: convert to dtschema

Hi,

Changes since v3
================
1. Patch 2: correct path in exynos-usi.yaml.
2. Add patch 5.
3. Add tags.

Changes since v2
================
1. Patch 2: drop child device schema, as Rob suggested.

Changes since v1
================
1. Patch 2: describe devices matching compatible, correct issues pointed out by
Rob, add reviewed-by tag.
2. New patches 3 and 4.

Best regards,
Krzysztof

Krzysztof Kozlowski (5):
ARM: dts: exynos: split dmas into array of phandles in Exynos5250
spi: dt-bindings: samsung: convert to dtschema
spi: dt-bindings: samsung: allow controller-data to be optional
mfd: dt-bindings: google,cros-ec: reference Samsung SPI bindings
spi: s3c64xx: allow controller-data to be optional

.../bindings/mfd/google,cros-ec.yaml | 29 +--
.../bindings/soc/samsung/exynos-usi.yaml | 2 +-
.../spi/samsung,spi-peripheral-props.yaml | 36 ++++
.../devicetree/bindings/spi/samsung,spi.yaml | 187 ++++++++++++++++++
.../bindings/spi/spi-peripheral-props.yaml | 1 +
.../devicetree/bindings/spi/spi-samsung.txt | 122 ------------
MAINTAINERS | 2 +-
arch/arm/boot/dts/exynos5250.dtsi | 9 +-
drivers/spi/spi-s3c64xx.c | 14 +-
9 files changed, 251 insertions(+), 151 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi.yaml
delete mode 100644 Documentation/devicetree/bindings/spi/spi-samsung.txt

--
2.32.0


2022-01-21 20:01:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v4 3/5] spi: dt-bindings: samsung: allow controller-data to be optional

The Samsung SoC SPI bindings requires to provide controller-data node
for each of SPI peripheral device nodes. Make this controller-data node
optional, so DTS could be simpler.

Suggested-by: Rob Herring <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Chanho Park <[email protected]>
Reviewed-by: Sam Protsenko <[email protected]>
---
.../devicetree/bindings/spi/samsung,spi-peripheral-props.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
index aa5a1f48494b..cadc8a5f061f 100644
--- a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
+++ b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
@@ -28,6 +28,7 @@ properties:
- 3: 270 degree phase shift sampling.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
+ default: 0

required:
- samsung,spi-feedback-delay
--
2.32.0

2022-01-21 20:02:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v4 4/5] mfd: dt-bindings: google,cros-ec: reference Samsung SPI bindings

The ChromeOS Embedded Controller appears on boards with Samsung Exynos
SoC, where Exynos SPI bindings expect controller-data node. Reference
newly added dtschema for this property.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../bindings/mfd/google,cros-ec.yaml | 29 ++++++++++---------
1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
index d793dd0316b7..e9c46430fd8a 100644
--- a/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
+++ b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
@@ -32,7 +32,7 @@ properties:

controller-data:
description:
- SPI controller data, see bindings/spi/spi-samsung.txt
+ SPI controller data, see bindings/spi/samsung,spi-peripheral-props.yaml
type: object

google,cros-ec-spi-pre-delay:
@@ -149,18 +149,21 @@ patternProperties:
required:
- compatible

-if:
- properties:
- compatible:
- contains:
- enum:
- - google,cros-ec-i2c
- - google,cros-ec-rpmsg
-then:
- properties:
- google,cros-ec-spi-pre-delay: false
- google,cros-ec-spi-msg-delay: false
- spi-max-frequency: false
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - google,cros-ec-i2c
+ - google,cros-ec-rpmsg
+ then:
+ properties:
+ google,cros-ec-spi-pre-delay: false
+ google,cros-ec-spi-msg-delay: false
+ spi-max-frequency: false
+
+ - $ref: /schemas/spi/samsung,spi-peripheral-props.yaml

additionalProperties: false

--
2.32.0

2022-01-21 20:02:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v4 5/5] spi: s3c64xx: allow controller-data to be optional

The Samsung SoC SPI driver requires to provide controller-data node
for each of SPI peripheral device nodes. Make this controller-data node
optional, so DTS could be simpler.

Suggested-by: Rob Herring <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Sam Protsenko <[email protected]>
---
drivers/spi/spi-s3c64xx.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 8755cd85e83c..769d958a2f86 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -796,16 +796,14 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata(
return ERR_PTR(-EINVAL);
}

- data_np = of_get_child_by_name(slave_np, "controller-data");
- if (!data_np) {
- dev_err(&spi->dev, "child node 'controller-data' not found\n");
- return ERR_PTR(-EINVAL);
- }
-
cs = kzalloc(sizeof(*cs), GFP_KERNEL);
- if (!cs) {
- of_node_put(data_np);
+ if (!cs)
return ERR_PTR(-ENOMEM);
+
+ data_np = of_get_child_by_name(slave_np, "controller-data");
+ if (!data_np) {
+ dev_info(&spi->dev, "child node 'controller-data' not found, using defaults\n");
+ return cs;
}

of_property_read_u32(data_np, "samsung,spi-feedback-delay", &fb_delay);
--
2.32.0

2022-01-21 20:05:25

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH v4 5/5] spi: s3c64xx: allow controller-data to be optional

Hi Krzysztof,

On Wed, Jan 19, 2022 at 09:10:05PM +0100, Krzysztof Kozlowski wrote:
> The Samsung SoC SPI driver requires to provide controller-data node
> for each of SPI peripheral device nodes. Make this controller-data node
> optional, so DTS could be simpler.
>
> Suggested-by: Rob Herring <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> Reviewed-by: Sam Protsenko <[email protected]>
> ---
> drivers/spi/spi-s3c64xx.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 8755cd85e83c..769d958a2f86 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -796,16 +796,14 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata(
> return ERR_PTR(-EINVAL);
> }
>
> - data_np = of_get_child_by_name(slave_np, "controller-data");
> - if (!data_np) {
> - dev_err(&spi->dev, "child node 'controller-data' not found\n");
> - return ERR_PTR(-EINVAL);
> - }
> -
> cs = kzalloc(sizeof(*cs), GFP_KERNEL);
> - if (!cs) {
> - of_node_put(data_np);
> + if (!cs)
> return ERR_PTR(-ENOMEM);
> +
> + data_np = of_get_child_by_name(slave_np, "controller-data");
> + if (!data_np) {
> + dev_info(&spi->dev, "child node 'controller-data' not found, using defaults\n");

"not found" sounds like an error; I would just write something
like "feedback delay set to '0' dfault", you also tell that the
default value is '0'.

In any case,

Reviewed-by: Andi Shyti <[email protected]>

Andi

2022-01-21 21:09:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v4 5/5] spi: s3c64xx: allow controller-data to be optional

On 19/01/2022 21:55, Andi Shyti wrote:
> Hi Krzysztof,
>
> On Wed, Jan 19, 2022 at 09:10:05PM +0100, Krzysztof Kozlowski wrote:
>> The Samsung SoC SPI driver requires to provide controller-data node
>> for each of SPI peripheral device nodes. Make this controller-data node
>> optional, so DTS could be simpler.
>>
>> Suggested-by: Rob Herring <[email protected]>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>> Reviewed-by: Sam Protsenko <[email protected]>
>> ---
>> drivers/spi/spi-s3c64xx.c | 14 ++++++--------
>> 1 file changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
>> index 8755cd85e83c..769d958a2f86 100644
>> --- a/drivers/spi/spi-s3c64xx.c
>> +++ b/drivers/spi/spi-s3c64xx.c
>> @@ -796,16 +796,14 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata(
>> return ERR_PTR(-EINVAL);
>> }
>>
>> - data_np = of_get_child_by_name(slave_np, "controller-data");
>> - if (!data_np) {
>> - dev_err(&spi->dev, "child node 'controller-data' not found\n");
>> - return ERR_PTR(-EINVAL);
>> - }
>> -
>> cs = kzalloc(sizeof(*cs), GFP_KERNEL);
>> - if (!cs) {
>> - of_node_put(data_np);
>> + if (!cs)
>> return ERR_PTR(-ENOMEM);
>> +
>> + data_np = of_get_child_by_name(slave_np, "controller-data");
>> + if (!data_np) {
>> + dev_info(&spi->dev, "child node 'controller-data' not found, using defaults\n");
>
> "not found" sounds like an error; I would just write something
> like "feedback delay set to '0' dfault", you also tell that the
> default value is '0'.

Sure, I will rewrite the message.


Best regards,
Krzysztof