diff mbox series

[2/2] spi: add support for generic linux,use-rt-queue flag

Message ID 20230602115201.415718-2-matthias.schiffer@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series [1/2] spi: dt-bindings: introduce linux,use-rt-queue flag | expand

Commit Message

Matthias Schiffer June 2, 2023, 11:52 a.m. UTC
Instead of requiring per-driver support to handle the message queue with
realtime priority, add handling for a linux,use-rt-queue DT flag to the
generic SPI controller initialization.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
 drivers/spi/spi.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9291b2a0e8871..f069f1aef5378 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3185,6 +3185,11 @@  int spi_register_controller(struct spi_controller *ctlr)
 		ctlr->mode_bits |= SPI_CS_HIGH;
 	}
 
+	/* Run message pump with realtime priority */
+	if (ctlr->dev.of_node &&
+	    of_property_read_bool(ctlr->dev.of_node, "linux,use-rt-queue"))
+		ctlr->rt = true;
+
 	/*
 	 * Even if it's just one always-selected device, there must
 	 * be at least one chipselect.