From: Vladimir Oltean <olteanv@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] dt-bindings: net: nxp,sja1105: document spi-cpol/cpha
Date: Fri, 4 Nov 2022 19:34:51 +0200 [thread overview]
Message-ID: <20221104173451.62fg5qqkfdutfdvh@skbuf> (raw)
In-Reply-To: <20221104171557.95871-1-krzysztof.kozlowski@linaro.org>
On Fri, Nov 04, 2022 at 01:15:57PM -0400, Krzysztof Kozlowski wrote:
> Some boards use SJA1105 Ethernet Switch with SPI CPHA, while ones with
> SJA1110 use SPI CPOL, so document this to fix dtbs_check warnings:
>
> arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dtb: ethernet-switch@0: Unevaluated properties are not allowed ('spi-cpol' was unexpected)
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> ---
>
> Changes since v2:
> 1. Add allOf:if:then, based on feedback from Vladimir.
>
> Changes since v1:
> 1. Add also cpha
> ---
> .../bindings/net/dsa/nxp,sja1105.yaml | 27 ++++++++++++++++---
> 1 file changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
> index 1e26d876d146..ac66af3fdd82 100644
> --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
> @@ -12,10 +12,6 @@ description:
> cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
> depends on the SPI bus master driver.
>
> -allOf:
> - - $ref: "dsa.yaml#"
> - - $ref: /schemas/spi/spi-peripheral-props.yaml#
> -
> maintainers:
> - Vladimir Oltean <vladimir.oltean@nxp.com>
>
> @@ -36,6 +32,9 @@ properties:
> reg:
> maxItems: 1
>
> + spi-cpha: true
> + spi-cpol: true
> +
Why set to true only to set to false under allOf? Can't set to true in allOf?
> # Optional container node for the 2 internal MDIO buses of the SJA1110
> # (one for the internal 100base-T1 PHYs and the other for the single
> # 100base-TX PHY). The "reg" property does not have physical significance.
> @@ -109,6 +108,26 @@ $defs:
> 1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080,
> 2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260]
>
> +allOf:
> + - $ref: dsa.yaml#
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> + - if:
> + properties:
> + compatible:
> + enum:
> + - nxp,sja1105e
> + - nxp,sja1105t
> + - nxp,sja1105p
> + - nxp,sja1105q
> + - nxp,sja1105r
> + - nxp,sja1105s
> + then:
> + properties:
> + spi-cpol: false
> + else:
> + properties:
> + spi-cpha: false
> +
The properties should probably also be 'required', since the hardware
doesn't work if they aren't present (omitting them changes the SPI mode
to 0).
prev parent reply other threads:[~2022-11-04 17:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 17:15 [PATCH v3] dt-bindings: net: nxp,sja1105: document spi-cpol/cpha Krzysztof Kozlowski
2022-11-04 17:34 ` Vladimir Oltean [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221104173451.62fg5qqkfdutfdvh@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh+dt@kernel.org \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox