All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: davinci: invoke chipselect callback
@ 2021-08-24  9:25 Matija Glavinic Pecotic
  2021-08-24 19:49 ` Alexander Sverdlin
  2021-08-25 10:22 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Matija Glavinic Pecotic @ 2021-08-24  9:25 UTC (permalink / raw)
  To: Glavinic-Pecotic, Matija (EXT-Other - DE/Ulm), broonie, linux-spi
  Cc: Sverdlin, Alexander (Nokia - DE/Ulm)

Davinci needs to configure chipselect on transfer.

Fixes: 4a07b8bcd503 ("spi: bitbang: Make chipselect callback optional")

Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
---
 drivers/spi/spi-davinci.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index f71c497393a6..c3974d996cb8 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -213,12 +213,6 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
 	 * line for the controller
 	 */
 	if (spi->cs_gpiod) {
-		/*
-		 * FIXME: is this code ever executed? This host does not
-		 * set SPI_MASTER_GPIO_SS so this chipselect callback should
-		 * not get called from the SPI core when we are using
-		 * GPIOs for chip select.
-		 */
 		if (value == BITBANG_CS_ACTIVE)
 			gpiod_set_value(spi->cs_gpiod, 1);
 		else
@@ -950,7 +944,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
 	master->bus_num = pdev->id;
 	master->num_chipselect = pdata->num_chipselect;
 	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16);
-	master->flags = SPI_MASTER_MUST_RX;
+	master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_GPIO_SS;
 	master->setup = davinci_spi_setup;
 	master->cleanup = davinci_spi_cleanup;
 	master->can_dma = davinci_spi_can_dma;
-- 
2.26.0

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

* Re: [PATCH] spi: davinci: invoke chipselect callback
  2021-08-24  9:25 [PATCH] spi: davinci: invoke chipselect callback Matija Glavinic Pecotic
@ 2021-08-24 19:49 ` Alexander Sverdlin
  2021-08-25 10:22 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Sverdlin @ 2021-08-24 19:49 UTC (permalink / raw)
  To: Matija Glavinic Pecotic, broonie, linux-spi

Hi!

On 24/08/2021 11:25, Matija Glavinic Pecotic wrote:
> Davinci needs to configure chipselect on transfer.
> 
> Fixes: 4a07b8bcd503 ("spi: bitbang: Make chipselect callback optional")
> 
> Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>

> ---
>  drivers/spi/spi-davinci.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
> index f71c497393a6..c3974d996cb8 100644
> --- a/drivers/spi/spi-davinci.c
> +++ b/drivers/spi/spi-davinci.c
> @@ -213,12 +213,6 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
>  	 * line for the controller
>  	 */
>  	if (spi->cs_gpiod) {
> -		/*
> -		 * FIXME: is this code ever executed? This host does not
> -		 * set SPI_MASTER_GPIO_SS so this chipselect callback should
> -		 * not get called from the SPI core when we are using
> -		 * GPIOs for chip select.
> -		 */
>  		if (value == BITBANG_CS_ACTIVE)
>  			gpiod_set_value(spi->cs_gpiod, 1);
>  		else
> @@ -950,7 +944,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
>  	master->bus_num = pdev->id;
>  	master->num_chipselect = pdata->num_chipselect;
>  	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16);
> -	master->flags = SPI_MASTER_MUST_RX;
> +	master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_GPIO_SS;
>  	master->setup = davinci_spi_setup;
>  	master->cleanup = davinci_spi_cleanup;
>  	master->can_dma = davinci_spi_can_dma;

-- 
Best regards,
Alexander Sverdlin.

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

* Re: [PATCH] spi: davinci: invoke chipselect callback
  2021-08-24  9:25 [PATCH] spi: davinci: invoke chipselect callback Matija Glavinic Pecotic
  2021-08-24 19:49 ` Alexander Sverdlin
@ 2021-08-25 10:22 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-08-25 10:22 UTC (permalink / raw)
  To: Matija Glavinic Pecotic, linux-spi
  Cc: Mark Brown, Sverdlin, Alexander (Nokia - DE/Ulm)

On Tue, 24 Aug 2021 11:25:56 +0200, Matija Glavinic Pecotic wrote:
> Davinci needs to configure chipselect on transfer.
> 
> Fixes: 4a07b8bcd503 ("spi: bitbang: Make chipselect callback optional")
> 
> 
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: davinci: invoke chipselect callback
      commit: ea4ab99cb58cc9f8d64c0961ff9a059825f304cf

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:[~2021-08-25 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  9:25 [PATCH] spi: davinci: invoke chipselect callback Matija Glavinic Pecotic
2021-08-24 19:49 ` Alexander Sverdlin
2021-08-25 10:22 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.