linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK
@ 2021-05-10 13:12 Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 2/7] spi: spidev: " Andy Shevchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

While at it, fix format specifier and drop explicit casting.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 407420977a73..956dce3aafca 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3441,8 +3441,8 @@ int spi_setup(struct spi_device *spi)
 		spi_set_thread_rt(spi->controller);
 	}
 
-	dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
-			(int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
+	dev_dbg(&spi->dev, "setup mode %lu, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
+			spi->mode & SPI_MODE_X_MASK,
 			(spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
 			(spi->mode & SPI_LSB_FIRST) ? "lsb, " : "",
 			(spi->mode & SPI_3WIRE) ? "3wire, " : "",
-- 
2.30.2


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

* [PATCH v1 2/7] spi: spidev: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 3/7] spi: npcm-pspi: " Andy Shevchenko
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index f56e0e975a46..24e9469ea35b 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -59,7 +59,7 @@ static DECLARE_BITMAP(minors, N_SPI_MINORS);
  *
  * REVISIT should changing those flags be privileged?
  */
-#define SPI_MODE_MASK		(SPI_CPHA | SPI_CPOL | SPI_CS_HIGH \
+#define SPI_MODE_MASK		(SPI_MODE_X_MASK | SPI_CS_HIGH \
 				| SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP \
 				| SPI_NO_CS | SPI_READY | SPI_TX_DUAL \
 				| SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL \
-- 
2.30.2


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

* [PATCH v1 3/7] spi: npcm-pspi: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 2/7] spi: spidev: " Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 4/7] spi: oc-tiny: " Andy Shevchenko
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-npcm-pspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c
index 56d10c4511db..1668a347e003 100644
--- a/drivers/spi/spi-npcm-pspi.c
+++ b/drivers/spi/spi-npcm-pspi.c
@@ -105,7 +105,7 @@ static void npcm_pspi_set_mode(struct spi_device *spi)
 	u16 regtemp;
 	u16 mode_val;
 
-	switch (spi->mode & (SPI_CPOL | SPI_CPHA)) {
+	switch (spi->mode & SPI_MODE_X_MASK) {
 	case SPI_MODE_0:
 		mode_val = 0;
 		break;
-- 
2.30.2


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

* [PATCH v1 4/7] spi: oc-tiny: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 2/7] spi: spidev: " Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 3/7] spi: npcm-pspi: " Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 5/7] spi: omap-uwire: " Andy Shevchenko
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-oc-tiny.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c
index f3843f0ff260..38c14c4e4e21 100644
--- a/drivers/spi/spi-oc-tiny.c
+++ b/drivers/spi/spi-oc-tiny.c
@@ -86,7 +86,7 @@ static int tiny_spi_setup(struct spi_device *spi)
 		hw->speed_hz = spi->max_speed_hz;
 		hw->baud = tiny_spi_baud(spi, hw->speed_hz);
 	}
-	hw->mode = spi->mode & (SPI_CPOL | SPI_CPHA);
+	hw->mode = spi->mode & SPI_MODE_X_MASK;
 	return 0;
 }
 
-- 
2.30.2


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

* [PATCH v1 5/7] spi: omap-uwire: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
                   ` (2 preceding siblings ...)
  2021-05-10 13:12 ` [PATCH v1 4/7] spi: oc-tiny: " Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 6/7] spi: ppc4xx: " Andy Shevchenko
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-omap-uwire.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index 71402f71ddd8..ceb479f5c88f 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -330,7 +330,7 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 	if (spi->mode & SPI_CPOL)
 		flags |= UWIRE_CLK_INVERTED;
 
-	switch (spi->mode & (SPI_CPOL | SPI_CPHA)) {
+	switch (spi->mode & SPI_MODE_X_MASK) {
 	case SPI_MODE_0:
 	case SPI_MODE_3:
 		flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE;
-- 
2.30.2


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

* [PATCH v1 6/7] spi: ppc4xx: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
                   ` (3 preceding siblings ...)
  2021-05-10 13:12 ` [PATCH v1 5/7] spi: omap-uwire: " Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-10 13:12 ` [PATCH v1 7/7] spi: uniphier: " Andy Shevchenko
  2021-05-11 18:21 ` [PATCH v1 1/7] spi: " Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-ppc4xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index d8ee363fb714..cb6aaad73f63 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -235,7 +235,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi)
 	 */
 	cs->mode = SPI_PPC4XX_MODE_SPE;
 
-	switch (spi->mode & (SPI_CPHA | SPI_CPOL)) {
+	switch (spi->mode & SPI_MODE_X_MASK) {
 	case SPI_MODE_0:
 		cs->mode |= SPI_CLK_MODE0;
 		break;
-- 
2.30.2


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

* [PATCH v1 7/7] spi: uniphier: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
                   ` (4 preceding siblings ...)
  2021-05-10 13:12 ` [PATCH v1 6/7] spi: ppc4xx: " Andy Shevchenko
@ 2021-05-10 13:12 ` Andy Shevchenko
  2021-05-11 18:21 ` [PATCH v1 1/7] spi: " Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2021-05-10 13:12 UTC (permalink / raw)
  To: Linus Walleij, Mark Brown, openbmc, linux-spi, linux-kernel,
	linux-arm-kernel
  Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Kunihiko Hayashi, Masami Hiramatsu,
	Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-uniphier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index 6a9ef8ee3cc9..8900e51e1a1c 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -142,7 +142,7 @@ static void uniphier_spi_set_mode(struct spi_device *spi)
 	 * FSTRT    start frame timing
 	 *          0: rising edge of clock, 1: falling edge of clock
 	 */
-	switch (spi->mode & (SPI_CPOL | SPI_CPHA)) {
+	switch (spi->mode & SPI_MODE_X_MASK) {
 	case SPI_MODE_0:
 		/* CKPHS=1, CKINIT=0, CKDLY=1, FSTRT=0 */
 		val1 = SSI_CKS_CKPHS | SSI_CKS_CKDLY;
-- 
2.30.2


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

* Re: [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK
  2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
                   ` (5 preceding siblings ...)
  2021-05-10 13:12 ` [PATCH v1 7/7] spi: uniphier: " Andy Shevchenko
@ 2021-05-11 18:21 ` Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2021-05-11 18:21 UTC (permalink / raw)
  To: linux-spi, linux-kernel, linux-arm-kernel, Andy Shevchenko,
	openbmc, Linus Walleij
  Cc: Mark Brown, Tali Perry, Kunihiko Hayashi, Patrick Venture,
	Nancy Yuen, Tomer Maimon, Masami Hiramatsu, Avi Fishman,
	Benjamin Fair

On Mon, 10 May 2021 16:12:11 +0300, Andy Shevchenko wrote:
> Use SPI_MODE_X_MASK instead of open coded variant.
> 
> While at it, fix format specifier and drop explicit casting.

Applied to

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

Thanks!

[1/7] spi: Use SPI_MODE_X_MASK
      commit: 40b82c2d9a78593201a3a62dc9239d6405334561
[2/7] spi: spidev: Use SPI_MODE_X_MASK
      commit: dd507b5ec7ba44ab51e1a8404d04e815a91b472f
[3/7] spi: npcm-pspi: Use SPI_MODE_X_MASK
      commit: 56f47edf33fb55ab9381f61d60cf34c7578f3d75
[4/7] spi: oc-tiny: Use SPI_MODE_X_MASK
      commit: a2f2db6b2a8708f6ac592a362e34fb330f874cea
[5/7] spi: omap-uwire: Use SPI_MODE_X_MASK
      commit: fdb217a38808e041f6eca8c550f1b5981e401a45
[6/7] spi: ppc4xx: Use SPI_MODE_X_MASK
      commit: 4ccf05579b9d0f15443a0edc860e2be7472ccfc1
[7/7] spi: uniphier: Use SPI_MODE_X_MASK
      commit: 038b9de42269f33aca3e3741214c863a4e9328d0

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] 8+ messages in thread

end of thread, other threads:[~2021-05-11 18:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 13:12 [PATCH v1 1/7] spi: Use SPI_MODE_X_MASK Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 2/7] spi: spidev: " Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 3/7] spi: npcm-pspi: " Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 4/7] spi: oc-tiny: " Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 5/7] spi: omap-uwire: " Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 6/7] spi: ppc4xx: " Andy Shevchenko
2021-05-10 13:12 ` [PATCH v1 7/7] spi: uniphier: " Andy Shevchenko
2021-05-11 18:21 ` [PATCH v1 1/7] spi: " 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).