From: Chris Packham <chris.packham@alliedtelesis.co.nz>
To: broonie@kernel.org, kdasu.kdev@gmail.com,
bcm-kernel-feedback-list@broadcom.com
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: [PATCH 1/2] spi: bcm-qspi: Convert to use CS GPIO descriptors
Date: Thu, 7 Nov 2019 17:42:34 +1300 [thread overview]
Message-ID: <20191107044235.4864-2-chris.packham@alliedtelesis.co.nz> (raw)
In-Reply-To: <20191107044235.4864-1-chris.packham@alliedtelesis.co.nz>
Set use_gpio_descriptors to true and avoid asserting the native chip
select if the spi core has done it for us.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
drivers/spi/spi-bcm-qspi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 7a3531856491..85bad70f59e3 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -803,7 +803,8 @@ static int bcm_qspi_bspi_exec_mem_op(struct spi_device *spi,
return -EIO;
from = op->addr.val;
- bcm_qspi_chip_select(qspi, spi->chip_select);
+ if (!spi->cs_gpiod)
+ bcm_qspi_chip_select(qspi, spi->chip_select);
bcm_qspi_write(qspi, MSPI, MSPI_WRITE_LOCK, 0);
/*
@@ -882,7 +883,8 @@ static int bcm_qspi_transfer_one(struct spi_master *master,
int slots;
unsigned long timeo = msecs_to_jiffies(100);
- bcm_qspi_chip_select(qspi, spi->chip_select);
+ if (!spi->cs_gpiod)
+ bcm_qspi_chip_select(qspi, spi->chip_select);
qspi->trans_pos.trans = trans;
qspi->trans_pos.byte = 0;
@@ -1234,6 +1236,7 @@ int bcm_qspi_probe(struct platform_device *pdev,
master->cleanup = bcm_qspi_cleanup;
master->dev.of_node = dev->of_node;
master->num_chipselect = NUM_CHIPSELECT;
+ master->use_gpio_descriptors = true;
qspi->big_endian = of_device_is_big_endian(dev->of_node);
--
2.24.0
next prev parent reply other threads:[~2019-11-07 4:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 4:42 [PATCH 0/2] spi: more GPIO CS work Chris Packham
2019-11-07 4:42 ` Chris Packham [this message]
2019-11-07 13:13 ` Applied "spi: bcm-qspi: Convert to use CS GPIO descriptors" to the spi tree Mark Brown
2019-11-07 4:42 ` [PATCH 2/2] spi: spi-mem: fallback to using transfers when CS gpios are used Chris Packham
2019-11-07 13:13 ` Applied "spi: spi-mem: fallback to using transfers when CS gpios are used" to the spi tree Mark Brown
2026-03-27 18:29 ` [PATCH 2/2] spi: spi-mem: fallback to using transfers when CS gpios are used Conor Dooley
2026-03-29 20:18 ` Chris Packham
2026-03-31 2:21 ` Conor Dooley
2026-03-31 2:35 ` Chris Packham
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=20191107044235.4864-2-chris.packham@alliedtelesis.co.nz \
--to=chris.packham@alliedtelesis.co.nz \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=kdasu.kdev@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®