* [PATCH] spi: add SPI_MOSI_IDLE_LOW support from device tree
@ 2025-08-26 7:38 charles-antoine.couret
2025-08-26 8:19 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: charles-antoine.couret @ 2025-08-26 7:38 UTC (permalink / raw)
To: linux-spi; +Cc: Charles-Antoine Couret
From: Charles-Antoine Couret <charles-antoine.couret@mind.be>
This flag was introduced but was not added as device tree property which is
limiting the possibility to use this flag on real devices.
This flag can be configured as done for other flags.
Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be>
---
Documentation/devicetree/bindings/spi/spi-controller.yaml | 5 +++++
drivers/spi/spi.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
index 82d051f7bd6e..47025ebb5875 100644
--- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
@@ -132,6 +132,11 @@ patternProperties:
description:
The device requires inverse clock polarity (CPOL) mode.
+ spi-mosi-idle-low:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ The device requires the MOSI line to be low when it's in idle state.
+
required:
- compatible
- reg
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index a388f372b27a..8fd2169befe3 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2372,6 +2372,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
spi->mode |= SPI_LSB_FIRST;
if (of_property_read_bool(nc, "spi-cs-high"))
spi->mode |= SPI_CS_HIGH;
+ if (of_property_read_bool(nc, "spi-mosi-idle-low"))
+ spi->mode |= SPI_MOSI_IDLE_LOW;
/* Device DUAL/QUAD mode */
if (!of_property_read_u32(nc, "spi-tx-bus-width", &value)) {
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: add SPI_MOSI_IDLE_LOW support from device tree
2025-08-26 7:38 [PATCH] spi: add SPI_MOSI_IDLE_LOW support from device tree charles-antoine.couret
@ 2025-08-26 8:19 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-26 8:19 UTC (permalink / raw)
To: charles-antoine.couret, linux-spi
On 26/08/2025 09:38, charles-antoine.couret@mind.be wrote:
> From: Charles-Antoine Couret <charles-antoine.couret@mind.be>
>
> This flag was introduced but was not added as device tree property which is
> limiting the possibility to use this flag on real devices.
>
> This flag can be configured as done for other flags.
>
> Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be>
> ---
> Documentation/devicetree/bindings/spi/spi-controller.yaml | 5 +++++
Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time.
Please kindly resend and include all necessary To/Cc entries.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-26 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 7:38 [PATCH] spi: add SPI_MOSI_IDLE_LOW support from device tree charles-antoine.couret
2025-08-26 8:19 ` Krzysztof Kozlowski
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).