linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301
@ 2022-04-20  3:50 Changming Huang
  2022-04-20  3:50 ` [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support Changming Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Changming Huang @ 2022-04-20  3:50 UTC (permalink / raw)
  To: broonie, robh+dt, krzysztof.kozlowski+dt, linux-spi, devicetree,
	linux-kernel, shawnguo, leoyang.li, linux-arm-kernel
  Cc: Changming Huang

Add DT Binding doc for semtech sx1301

Signed-off-by: Changming Huang <jerry.huang@nxp.com>
---
changes in v3:
  - add the dt-bindings

 .../bindings/spi/semtech,sx1301.yaml          | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/semtech,sx1301.yaml

diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
new file mode 100644
index 000000000000..f65fb5809218
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/semtech,sx1301.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech sx1301 devicetree bindings
+
+allOf:
+  - $ref: "spi-controller.yaml"
+
+maintainers:
+  - Changming Huang <jerry.huang@nxp.com>
+
+properties:
+  compatible:
+    const: semtech,sx1301
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  fsl,spi-cs-sck-delay: true
+
+  fsl,spi-sck-cs-delay: true
+
+required:
+  - compatible
+  - reg
+  - spi-max-frequency
+
+additionalProperties: false
+
+examples:
+  - |
+    mikrobus@0 {
+      compatible = "semtech,sx1301";
+      reg = <0>;
+      spi-max-frequency = <2000000>;
+      fsl,spi-cs-sck-delay = <1000000>;
+      fsl,spi-sck-cs-delay = <50>;
+    };
+
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support
  2022-04-20  3:50 [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Changming Huang
@ 2022-04-20  3:50 ` Changming Huang
  2022-04-20  6:58 ` [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Krzysztof Kozlowski
  2022-04-20 11:26 ` Michael Walle
  2 siblings, 0 replies; 5+ messages in thread
From: Changming Huang @ 2022-04-20  3:50 UTC (permalink / raw)
  To: broonie, robh+dt, krzysztof.kozlowski+dt, linux-spi, devicetree,
	linux-kernel, shawnguo, leoyang.li, linux-arm-kernel
  Cc: Changming Huang

Enable MikroBUS SPI port.

Signed-off-by: Changming Huang <jerry.huang@nxp.com>
---
changes in v3:
  - add the dt-bindings

 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index 68c31cb8eead..6d0508d5abd0 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -117,6 +117,19 @@ &duart1 {
 	status = "okay";
 };
 
+&dspi2 {
+	bus-num = <2>;
+	status = "okay";
+
+	mikrobus@0 {
+		compatible = "semtech,sx1301";
+		reg = <0>;
+		spi-max-frequency = <2000000>;
+		fsl,spi-cs-sck-delay = <1000000>;
+		fsl,spi-sck-cs-delay = <50>;
+	};
+};
+
 &enetc_mdio_pf3 {
 	sgmii_phy0: ethernet-phy@2 {
 		reg = <0x2>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301
  2022-04-20  3:50 [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Changming Huang
  2022-04-20  3:50 ` [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support Changming Huang
@ 2022-04-20  6:58 ` Krzysztof Kozlowski
  2022-04-20 11:26 ` Michael Walle
  2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20  6:58 UTC (permalink / raw)
  To: Changming Huang, broonie, robh+dt, krzysztof.kozlowski+dt,
	linux-spi, devicetree, linux-kernel, shawnguo, leoyang.li,
	linux-arm-kernel

On 20/04/2022 05:50, Changming Huang wrote:
> Add DT Binding doc for semtech sx1301
> 
> Signed-off-by: Changming Huang <jerry.huang@nxp.com>
> ---
> changes in v3:
>   - add the dt-bindings
> 
>  .../bindings/spi/semtech,sx1301.yaml          | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> new file mode 100644
> index 000000000000..f65fb5809218
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/semtech,sx1301.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Semtech sx1301 devicetree bindings

Remove "devicetree bindings" and add instead short description (type) of
the device (SPI controller?).

> +
> +allOf:
> +  - $ref: "spi-controller.yaml"

allOf after maintainers.

> +
> +maintainers:
> +  - Changming Huang <jerry.huang@nxp.com>
> +
> +properties:
> +  compatible:
> +    const: semtech,sx1301
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +
> +  fsl,spi-cs-sck-delay: true
> +
> +  fsl,spi-sck-cs-delay: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-max-frequency
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    mikrobus@0 {

Isn't MikroBUS more than SPI, but you implement here only it's part? If
so, name it just "spi".


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301
  2022-04-20  3:50 [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Changming Huang
  2022-04-20  3:50 ` [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support Changming Huang
  2022-04-20  6:58 ` [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Krzysztof Kozlowski
@ 2022-04-20 11:26 ` Michael Walle
  2022-04-21  9:01   ` [EXT] " Jerry Huang
  2 siblings, 1 reply; 5+ messages in thread
From: Michael Walle @ 2022-04-20 11:26 UTC (permalink / raw)
  To: jerry.huang
  Cc: broonie, devicetree, krzysztof.kozlowski+dt, leoyang.li,
	linux-arm-kernel, linux-kernel, linux-spi, robh+dt, shawnguo,
	Michael Walle

> Add DT Binding doc for semtech sx1301

Please be a bit more elaborate. The sx1301 seems to be an
SPI device, some kind of WAN device.

> 
> Signed-off-by: Changming Huang <jerry.huang@nxp.com>
> ---
> changes in v3:
>   - add the dt-bindings
> 
>  .../bindings/spi/semtech,sx1301.yaml          | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> new file mode 100644
> index 000000000000..f65fb5809218
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/semtech,sx1301.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Semtech sx1301 devicetree bindings
> +
> +allOf:
> +  - $ref: "spi-controller.yaml"

.. then why does it inherit the spi controllers properties?

Also *some* kind of information what the sx1301 is would be nice.

Anyway, I was about to comment on your patch 2. But maybe I'll
just leave it here. On the RDB there is a mikrobus connector, with
this, you are going to say "hey there is always a sx1301" module
there. What happens if it not there? What if you put another module
in that socket?

Maybe Krzystof knows better. But it really looks like you want to
have device tree overlays here instead of hardcoding exactly one
use case.

-michael

> +
> +maintainers:
> +  - Changming Huang <jerry.huang@nxp.com>
> +
> +properties:
> +  compatible:
> +    const: semtech,sx1301
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +
> +  fsl,spi-cs-sck-delay: true
> +
> +  fsl,spi-sck-cs-delay: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-max-frequency
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    mikrobus@0 {
> +      compatible = "semtech,sx1301";
> +      reg = <0>;
> +      spi-max-frequency = <2000000>;
> +      fsl,spi-cs-sck-delay = <1000000>;
> +      fsl,spi-sck-cs-delay = <50>;
> +    };
> +
> +...
> -- 
> 2.25.1
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [EXT] Re: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301
  2022-04-20 11:26 ` Michael Walle
@ 2022-04-21  9:01   ` Jerry Huang
  0 siblings, 0 replies; 5+ messages in thread
From: Jerry Huang @ 2022-04-21  9:01 UTC (permalink / raw)
  To: Michael Walle
  Cc: broonie, devicetree, krzysztof.kozlowski+dt, Leo Li,
	linux-arm-kernel, linux-kernel, linux-spi, robh+dt, shawnguo




Best Regards
Jerry Huang

-----Original Message-----
From: Michael Walle <michael@walle.cc> 
Sent: 2022年4月20日 19:27
To: Jerry Huang <jerry.huang@nxp.com>
Cc: broonie@kernel.org; devicetree@vger.kernel.org; krzysztof.kozlowski+dt@linaro.org; Leo Li <leoyang.li@nxp.com>; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-spi@vger.kernel.org; robh+dt@kernel.org; shawnguo@kernel.org; Michael Walle <michael@walle.cc>
Subject: [EXT] Re: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301

Caution: EXT Email

> Add DT Binding doc for semtech sx1301

Please be a bit more elaborate. The sx1301 seems to be an SPI device, some kind of WAN device.
[Jerry Huang] I double checked the MikroBus devices, we used two MikcroBus devices:
BLE P click: https://www.mikroe.com/ble-p-click
BEE click: https://www.mikroe.com/bee-click
Both of them are SPI interface connect to ls1028ardb through MiKcroBus interface.
So the name "semtech sx1301" is not correct for this node.

>
> Signed-off-by: Changming Huang <jerry.huang@nxp.com>
> ---
> changes in v3:
>   - add the dt-bindings
>
>  .../bindings/spi/semtech,sx1301.yaml          | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
>
> diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml 
> b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> new file mode 100644
> index 000000000000..f65fb5809218
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: 
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> +cetree.org%2Fschemas%2Fspi%2Fsemtech%2Csx1301.yaml%23&amp;data=05%7C0
> +1%7Cjerry.huang%40nxp.com%7Cc45d97643d6b4639d00508da22c0b535%7C686ea1
> +d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C637860508327293217%7CUnknown%7CT
> +WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVC
> +I6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=b3gaerVDOI1F3ml3fUlTJ47D2YcDqj6cts
> +0YKCYXqOM%3D&amp;reserved=0
> +$schema: 
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> +cetree.org%2Fmeta-schemas%2Fcore.yaml%23&amp;data=05%7C01%7Cjerry.hua
> +ng%40nxp.com%7Cc45d97643d6b4639d00508da22c0b535%7C686ea1d3bc2b4c6fa92
> +cd99c5c301635%7C0%7C1%7C637860508327293217%7CUnknown%7CTWFpbGZsb3d8ey
> +JWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C30
> +00%7C%7C%7C&amp;sdata=v88eUuFAVfTeoAWyADNYHJ8NwFja5CkYrqWeCndlayY%3D&
> +amp;reserved=0
> +
> +title: Semtech sx1301 devicetree bindings
> +
> +allOf:
> +  - $ref: "spi-controller.yaml"

.. then why does it inherit the spi controllers properties?

Also *some* kind of information what the sx1301 is would be nice.

Anyway, I was about to comment on your patch 2. But maybe I'll just leave it here. On the RDB there is a mikrobus connector, with this, you are going to say "hey there is always a sx1301" module there. What happens if it not there? What if you put another module in that socket?
[Jerry Huang] the name sx1301 is not correct, I think the purpose of it just is to invoke the spidev driver (./drivers/spi/spidev.c)
I will change the compatible name and add it to ./drivers/spi/spidev.c file.

Maybe Krzystof knows better. But it really looks like you want to have device tree overlays here instead of hardcoding exactly one use case.

-michael

> +
> +maintainers:
> +  - Changming Huang <jerry.huang@nxp.com>
> +
> +properties:
> +  compatible:
> +    const: semtech,sx1301
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-max-frequency: true
> +
> +  fsl,spi-cs-sck-delay: true
> +
> +  fsl,spi-sck-cs-delay: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - spi-max-frequency
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    mikrobus@0 {
> +      compatible = "semtech,sx1301";
> +      reg = <0>;
> +      spi-max-frequency = <2000000>;
> +      fsl,spi-cs-sck-delay = <1000000>;
> +      fsl,spi-sck-cs-delay = <50>;
> +    };
> +
> +...
> --
> 2.25.1
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-21  9:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20  3:50 [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Changming Huang
2022-04-20  3:50 ` [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support Changming Huang
2022-04-20  6:58 ` [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301 Krzysztof Kozlowski
2022-04-20 11:26 ` Michael Walle
2022-04-21  9:01   ` [EXT] " Jerry Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).