linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Mark Brown <broonie@kernel.org>
Cc: "Chris Brandt" <chris.brandt@renesas.com>,
	"Jan Kundrát" <jan.kundrat@cesnet.cz>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>
Subject: [PATCH 5/6] spi: rspi: Add support for multiple native chip selects
Date: Thu,  2 Jan 2020 14:38:21 +0100	[thread overview]
Message-ID: <20200102133822.29346-6-geert+renesas@glider.be> (raw)
In-Reply-To: <20200102133822.29346-1-geert+renesas@glider.be>

RSPI variants on some SuperH or R-Mobile SoCs support multiple native
chip selects. Add support for this by configuring the SSL Assert Signal
Setting.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/spi/spi-rspi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 9eabef3d6cc478ff..2f5a856a93192702 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -159,7 +159,7 @@
 #define SPCMD_SPIMOD_DUAL	SPCMD_SPIMOD0
 #define SPCMD_SPIMOD_QUAD	SPCMD_SPIMOD1
 #define SPCMD_SPRW		0x0010	/* SPI Read/Write Access (Dual/Quad) */
-#define SPCMD_SSLA_MASK		0x0030	/* SSL Assert Signal Setting (RSPI) */
+#define SPCMD_SSLA(i)		((i) << 4)	/* SSL Assert Signal Setting */
 #define SPCMD_BRDV_MASK		0x000c	/* Bit Rate Division Setting */
 #define SPCMD_CPOL		0x0002	/* Clock Polarity Setting */
 #define SPCMD_CPHA		0x0001	/* Clock Phase Setting */
@@ -933,6 +933,9 @@ static int rspi_prepare_message(struct spi_controller *ctlr,
 	if (spi->mode & SPI_CPHA)
 		rspi->spcmd |= SPCMD_CPHA;
 
+	/* Configure slave signal to assert */
+	rspi->spcmd |= SPCMD_SSLA(spi->chip_select);
+
 	/* CMOS output mode and MOSI signal from previous transfer */
 	rspi->sppcr = 0;
 	if (spi->mode & SPI_LOOP)
-- 
2.17.1


  parent reply	other threads:[~2020-01-02 14:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 13:38 [PATCH 0/6] spi: rspi: Add support for multiple native and GPIO chip selects Geert Uytterhoeven
2020-01-02 13:38 ` [PATCH 1/6] spi: Add generic support for unused native cs with cs-gpios Geert Uytterhoeven
2020-01-08 15:59   ` Applied "spi: Add generic support for unused native cs with cs-gpios" to the spi tree Mark Brown
2020-01-02 13:38 ` [PATCH 2/6] spi: sh-msiof: Convert to generic unused native cs handling Geert Uytterhoeven
2020-01-08 15:59   ` Applied "spi: sh-msiof: Convert to generic unused native cs handling." to the spi tree Mark Brown
2020-01-02 13:38 ` [PATCH 3/6] spi: rspi: Use dev_warn_once() instead of open-coding Geert Uytterhoeven
2020-01-08 15:59   ` Applied "spi: rspi: Use dev_warn_once() instead of open-coding" to the spi tree Mark Brown
2020-01-02 13:38 ` [PATCH 4/6] spi: rspi: Remove set_config_register() macro Geert Uytterhoeven
2020-01-08 15:59   ` Applied "spi: rspi: Remove set_config_register() macro" to the spi tree Mark Brown
2020-01-02 13:38 ` Geert Uytterhoeven [this message]
2020-01-08 15:59   ` Applied "spi: rspi: Add support for multiple native chip selects" " Mark Brown
2020-01-02 13:38 ` [PATCH 6/6] spi: rspi: Add support for GPIO chip selects Geert Uytterhoeven
2020-01-08 15:59   ` Applied "spi: rspi: Add support for GPIO chip selects" to the spi tree Mark Brown

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=20200102133822.29346-6-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=broonie@kernel.org \
    --cc=chris.brandt@renesas.com \
    --cc=jan.kundrat@cesnet.cz \
    --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;
as well as URLs for NNTP newsgroup(s).