[PATCH v2 02/14] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode

Petre Rodan posted 14 patches 3 weeks, 1 day ago
There is a newer version of this series
[PATCH v2 02/14] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode
Posted by Petre Rodan 3 weeks, 1 day ago
Assert CPOL for a high-idle clock signal and CPHA for sampling on the
trailing (rising) edge.

Quoting from the datasheet:

 "During the transitions on CSB, SCK must be high. SDI and SDO are driven
 at the falling edge of SCK and should be captured at the rising edge of
 SCK."

The sensor does not function with the default SPI clock mode.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
---
ChangeLog:
- split out from a bigger patch file
---
 Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
index da047258aca3d84e8b2cbe92a9c98309236fe7ae..0e27ec74065acca611e63309d6ae889b8a3134ce 100644
--- a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
@@ -20,6 +20,9 @@ properties:
   interrupts:
     maxItems: 1
 
+  spi-cpha: true
+  spi-cpol: true
+
   vdda-supply: true
   vddd-supply: true
   vddio-supply: true
@@ -44,6 +47,8 @@ examples:
             compatible = "bosch,bma220";
             reg = <0>;
             spi-max-frequency = <2500000>;
+            spi-cpol;
+            spi-cpha;
             interrupt-parent = <&gpio0>;
             interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
         };

-- 
2.49.1
Re: [PATCH v2 02/14] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode
Posted by Krzysztof Kozlowski 3 weeks ago
On Wed, Sep 10, 2025 at 10:57:07AM +0300, Petre Rodan wrote:
> Assert CPOL for a high-idle clock signal and CPHA for sampling on the
> trailing (rising) edge.
> 
> Quoting from the datasheet:
> 
>  "During the transitions on CSB, SCK must be high. SDI and SDO are driven
>  at the falling edge of SCK and should be captured at the rising edge of
>  SCK."
> 
> The sensor does not function with the default SPI clock mode.
> 
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
> ---
> ChangeLog:
> - split out from a bigger patch file

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Re: [PATCH v2 02/14] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode
Posted by Jonathan Cameron 3 weeks, 1 day ago
On Wed, 10 Sep 2025 10:57:07 +0300
Petre Rodan <petre.rodan@subdimension.ro> wrote:

> Assert CPOL for a high-idle clock signal and CPHA for sampling on the
> trailing (rising) edge.
> 
> Quoting from the datasheet:
> 
>  "During the transitions on CSB, SCK must be high. SDI and SDO are driven
>  at the falling edge of SCK and should be captured at the rising edge of
>  SCK."
> 
> The sensor does not function with the default SPI clock mode.
> 
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>

Perhaps this one deserves a fixes tag? I'm not 100% sure for
dt-bindings that are broken like this.

> ---
> ChangeLog:
> - split out from a bigger patch file
> ---
>  Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
> index da047258aca3d84e8b2cbe92a9c98309236fe7ae..0e27ec74065acca611e63309d6ae889b8a3134ce 100644
> --- a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
> +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
> @@ -20,6 +20,9 @@ properties:
>    interrupts:
>      maxItems: 1
>  
> +  spi-cpha: true
> +  spi-cpol: true
> +
>    vdda-supply: true
>    vddd-supply: true
>    vddio-supply: true
> @@ -44,6 +47,8 @@ examples:
>              compatible = "bosch,bma220";
>              reg = <0>;
>              spi-max-frequency = <2500000>;
> +            spi-cpol;
> +            spi-cpha;
>              interrupt-parent = <&gpio0>;
>              interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
>          };
>