linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: rspi: Add configuration for LSB/MSB
@ 2019-04-03  9:09 Nguyen An Hoan
  2020-02-18 10:56 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Nguyen An Hoan @ 2019-04-03  9:09 UTC (permalink / raw)
  To: linux-renesas-soc, geert+renesas
  Cc: linux-spi, kuninori.morimoto.gx, yoshihiro.shimoda.uh,
	h-inayoshi, na-hoan, cv-dong

From: Hoan Nguyen An <na-hoan@jinso.co.jp>

SPI controllers can support LSB or MSB depending on
the structure of the message that Slave requires,
Add support.

Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
---
 drivers/spi/spi-rspi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 3be8fbe..7ae5f09 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -950,6 +950,8 @@ static int rspi_prepare_message(struct spi_controller *ctlr,
 		rspi->spcmd |= SPCMD_CPOL;
 	if (spi->mode & SPI_CPHA)
 		rspi->spcmd |= SPCMD_CPHA;
+	if (spi->mode & SPI_LSB_FIRST)
+		rspi->spcmd |= SPCMD_LSBF;
 
 	/* CMOS output mode and MOSI signal from previous transfer */
 	rspi->sppcr = 0;
-- 
2.7.4


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

* Re: [PATCH] spi: rspi: Add configuration for LSB/MSB
  2019-04-03  9:09 [PATCH] spi: rspi: Add configuration for LSB/MSB Nguyen An Hoan
@ 2020-02-18 10:56 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-02-18 10:56 UTC (permalink / raw)
  To: Nguyen An Hoan
  Cc: Linux-Renesas, linux-spi, Kuninori Morimoto, Yoshihiro Shimoda,
	稲吉,
	カオ・ヴァン・ドン

Hi Hoan-san,

On Wed, Apr 3, 2019 at 11:09 AM Nguyen An Hoan <na-hoan@jinso.co.jp> wrote:
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
>
> SPI controllers can support LSB or MSB depending on
> the structure of the message that Slave requires,
> Add support.
>
> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>

Thanks for your patch!

> --- a/drivers/spi/spi-rspi.c
> +++ b/drivers/spi/spi-rspi.c
> @@ -950,6 +950,8 @@ static int rspi_prepare_message(struct spi_controller *ctlr,
>                 rspi->spcmd |= SPCMD_CPOL;
>         if (spi->mode & SPI_CPHA)
>                 rspi->spcmd |= SPCMD_CPHA;
> +       if (spi->mode & SPI_LSB_FIRST)
> +               rspi->spcmd |= SPCMD_LSBF;
>
>         /* CMOS output mode and MOSI signal from previous transfer */
>         rspi->sppcr = 0;

Unfortunately this is not sufficient.  The driver should also inform the
SPI core that it supports this flag. Will fix.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2020-02-18 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03  9:09 [PATCH] spi: rspi: Add configuration for LSB/MSB Nguyen An Hoan
2020-02-18 10:56 ` Geert Uytterhoeven

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