mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] spi: meson-spicc: add spicc loopback mode
@ 2024-06-12  9:44 Xianwei Zhao via B4 Relay
  2024-06-12 14:35 ` Neil Armstrong
  2024-06-13  8:42 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2024-06-12  9:44 UTC (permalink / raw)
  To: Mark Brown, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl
  Cc: linux-spi, linux-arm-kernel, linux-amlogic, linux-kernel,
	Sunny Luo, Xianwei Zhao

From: Xianwei Zhao <xianwei.zhao@amlogic.com>

Add spicc loopback mode for debugging convenience.

Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
 drivers/spi/spi-meson-spicc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
index 8a4a8ba9dfed..8838a98b04c2 100644
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -514,7 +514,9 @@ static int meson_spicc_prepare_message(struct spi_controller *host,
 	/* Setup no wait cycles by default */
 	writel_relaxed(0, spicc->base + SPICC_PERIODREG);
 
-	writel_bits_relaxed(SPICC_LBC_W1, 0, spicc->base + SPICC_TESTREG);
+	writel_bits_relaxed(SPICC_LBC_W1,
+			    spi->mode & SPI_LOOP ? SPICC_LBC_W1 : 0,
+			    spicc->base + SPICC_TESTREG);
 
 	return 0;
 }
@@ -850,7 +852,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
 
 	host->num_chipselect = 4;
 	host->dev.of_node = pdev->dev.of_node;
-	host->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH;
+	host->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LOOP;
 	host->bits_per_word_mask = SPI_BPW_MASK(32) |
 				   SPI_BPW_MASK(24) |
 				   SPI_BPW_MASK(16) |

---
base-commit: ec0d19f2b59699e2e148091debaa0d9d6af5800a
change-id: 20240611-spi_lbc-0859cebc580e

Best regards,
-- 
Xianwei Zhao <xianwei.zhao@amlogic.com>



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] spi: meson-spicc: add spicc loopback mode
  2024-06-12  9:44 [PATCH] spi: meson-spicc: add spicc loopback mode Xianwei Zhao via B4 Relay
@ 2024-06-12 14:35 ` Neil Armstrong
  2024-06-13  8:42 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2024-06-12 14:35 UTC (permalink / raw)
  To: xianwei.zhao, Mark Brown, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl
  Cc: linux-spi, linux-arm-kernel, linux-amlogic, linux-kernel, Sunny Luo

On 12/06/2024 11:44, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> 
> Add spicc loopback mode for debugging convenience.
> 
> Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
>   drivers/spi/spi-meson-spicc.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
> index 8a4a8ba9dfed..8838a98b04c2 100644
> --- a/drivers/spi/spi-meson-spicc.c
> +++ b/drivers/spi/spi-meson-spicc.c
> @@ -514,7 +514,9 @@ static int meson_spicc_prepare_message(struct spi_controller *host,
>   	/* Setup no wait cycles by default */
>   	writel_relaxed(0, spicc->base + SPICC_PERIODREG);
>   
> -	writel_bits_relaxed(SPICC_LBC_W1, 0, spicc->base + SPICC_TESTREG);
> +	writel_bits_relaxed(SPICC_LBC_W1,
> +			    spi->mode & SPI_LOOP ? SPICC_LBC_W1 : 0,
> +			    spicc->base + SPICC_TESTREG);
>   
>   	return 0;
>   }
> @@ -850,7 +852,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
>   
>   	host->num_chipselect = 4;
>   	host->dev.of_node = pdev->dev.of_node;
> -	host->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH;
> +	host->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LOOP;
>   	host->bits_per_word_mask = SPI_BPW_MASK(32) |
>   				   SPI_BPW_MASK(24) |
>   				   SPI_BPW_MASK(16) |
> 
> ---
> base-commit: ec0d19f2b59699e2e148091debaa0d9d6af5800a
> change-id: 20240611-spi_lbc-0859cebc580e
> 
> Best regards,

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] spi: meson-spicc: add spicc loopback mode
  2024-06-12  9:44 [PATCH] spi: meson-spicc: add spicc loopback mode Xianwei Zhao via B4 Relay
  2024-06-12 14:35 ` Neil Armstrong
@ 2024-06-13  8:42 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-06-13  8:42 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Xianwei Zhao
  Cc: linux-spi, linux-arm-kernel, linux-amlogic, linux-kernel, Sunny Luo

On Wed, 12 Jun 2024 17:44:50 +0800, Xianwei Zhao wrote:
> Add spicc loopback mode for debugging convenience.
> 
> 

Applied to

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

Thanks!

[1/1] spi: meson-spicc: add spicc loopback mode
      commit: 313d2c9d1252185721cad4f8c57099840d6c9958

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


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2024-06-13  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-12  9:44 [PATCH] spi: meson-spicc: add spicc loopback mode Xianwei Zhao via B4 Relay
2024-06-12 14:35 ` Neil Armstrong
2024-06-13  8:42 ` Mark Brown

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®