[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250616220054.3968946-6-sean.anderson@linux.dev>
Date: Mon, 16 Jun 2025 18:00:50 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Mark Brown <broonie@...nel.org>,
Michal Simek <michal.simek@....com>,
linux-spi@...r.kernel.org
Cc: Jinjie Ruan <ruanjinjie@...wei.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
David Lechner <dlechner@...libre.com>,
Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>,
Sean Anderson <sean.anderson@...ux.dev>
Subject: [PATCH v2 5/9] spi: zynqmp-gqspi: Support multiple buses
Currently, selection of the upper/lower buses is determined by the
chipselect. Decouple this by allowing explicit bus selection through the
spi-buses property.
Signed-off-by: Sean Anderson <sean.anderson@...ux.dev>
---
Changes in v2:
- New
drivers/spi/spi-zynqmp-gqspi.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 595b6dc10845..add5eea12153 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -465,13 +465,13 @@ static void zynqmp_qspi_chipselect(struct spi_device *qspi, bool is_high)
genfifoentry |= GQSPI_GENFIFO_MODE_SPI;
if (!is_high) {
- if (!spi_get_chipselect(qspi, 0)) {
- xqspi->genfifobus = GQSPI_GENFIFO_BUS_LOWER;
+ xqspi->genfifobus =
+ FIELD_PREP(GQSPI_GENFIFO_BUS_MASK, qspi->buses);
+ if (!spi_get_chipselect(qspi, 0))
xqspi->genfifocs = GQSPI_GENFIFO_CS_LOWER;
- } else {
- xqspi->genfifobus = GQSPI_GENFIFO_BUS_UPPER;
+ else
xqspi->genfifocs = GQSPI_GENFIFO_CS_UPPER;
- }
+
genfifoentry |= xqspi->genfifobus;
genfifoentry |= xqspi->genfifocs;
genfifoentry |= GQSPI_GENFIFO_CS_SETUP;
@@ -1316,6 +1316,8 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
ctlr->num_chipselect = num_cs;
}
+ ctlr->num_buses = 2;
+ ctlr->flags = SPI_CONTROLLER_DEFAULT_BUS_IS_CS;
ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
ctlr->mem_ops = &zynqmp_qspi_mem_ops;
ctlr->mem_caps = &zynqmp_qspi_mem_caps;
--
2.35.1.1320.gc452695387.dirty
Powered by blists - more mailing lists