linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: qup: support using GPIO as chip select line
@ 2022-10-06 19:48 Robert Marko
  2022-10-17  9:17 ` Linus Walleij
  2022-10-18 11:01 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Marko @ 2022-10-06 19:48 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, broonie, linus.walleij,
	linux-arm-msm, linux-spi, linux-kernel
  Cc: Robert Marko, luka.perkov

Most of the device with QUP SPI adapter are actually using GPIO-s for
chip select.

However, this stopped working after ("spi: Retire legacy GPIO handling")
as it introduced a check on ->use_gpio_descriptors flag and since spi-qup
driver does not set the flag it meant that all of boards using GPIO-s and
with QUP adapter SPI devices stopped working.

So, to enable using GPIO-s again set ->use_gpio_descriptors to true and
populate ->max_native_cs.

Fixes: f48dc6b96649 ("spi: Retire legacy GPIO handling")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Cc: luka.perkov@sartura.hr
---
 drivers/spi/spi-qup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 00d6084306b4..81c2e00532cf 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -1057,6 +1057,8 @@ static int spi_qup_probe(struct platform_device *pdev)
 	else
 		master->num_chipselect = num_cs;
 
+	master->use_gpio_descriptors = true;
+	master->max_native_cs = SPI_NUM_CHIPSELECTS;
 	master->bus_num = pdev->id;
 	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
 	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
-- 
2.37.3


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

* Re: [PATCH] spi: qup: support using GPIO as chip select line
  2022-10-06 19:48 [PATCH] spi: qup: support using GPIO as chip select line Robert Marko
@ 2022-10-17  9:17 ` Linus Walleij
  2022-10-18 11:01 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-10-17  9:17 UTC (permalink / raw)
  To: Robert Marko
  Cc: agross, andersson, konrad.dybcio, broonie, linux-arm-msm,
	linux-spi, linux-kernel, luka.perkov

On Thu, Oct 6, 2022 at 9:48 PM Robert Marko <robert.marko@sartura.hr> wrote:

> Most of the device with QUP SPI adapter are actually using GPIO-s for
> chip select.
>
> However, this stopped working after ("spi: Retire legacy GPIO handling")
> as it introduced a check on ->use_gpio_descriptors flag and since spi-qup
> driver does not set the flag it meant that all of boards using GPIO-s and
> with QUP adapter SPI devices stopped working.
>
> So, to enable using GPIO-s again set ->use_gpio_descriptors to true and
> populate ->max_native_cs.
>
> Fixes: f48dc6b96649 ("spi: Retire legacy GPIO handling")
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> Cc: luka.perkov@sartura.hr

Ooops sorry about that!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] spi: qup: support using GPIO as chip select line
  2022-10-06 19:48 [PATCH] spi: qup: support using GPIO as chip select line Robert Marko
  2022-10-17  9:17 ` Linus Walleij
@ 2022-10-18 11:01 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-10-18 11:01 UTC (permalink / raw)
  To: Robert Marko, linux-spi, agross, linus.walleij, konrad.dybcio,
	linux-kernel, linux-arm-msm, andersson
  Cc: luka.perkov

On Thu, 6 Oct 2022 21:48:19 +0200, Robert Marko wrote:
> Most of the device with QUP SPI adapter are actually using GPIO-s for
> chip select.
> 
> However, this stopped working after ("spi: Retire legacy GPIO handling")
> as it introduced a check on ->use_gpio_descriptors flag and since spi-qup
> driver does not set the flag it meant that all of boards using GPIO-s and
> with QUP adapter SPI devices stopped working.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: qup: support using GPIO as chip select line
      commit: b40af6183b685b0cf7870987b858de0d48db9ea0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2022-10-18 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 19:48 [PATCH] spi: qup: support using GPIO as chip select line Robert Marko
2022-10-17  9:17 ` Linus Walleij
2022-10-18 11:01 ` Mark Brown

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).