mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: axi-spi-engine: use common AXI macros
@ 2024-02-02 21:31 David Lechner
  2024-02-05  8:23 ` Nuno Sá
  2024-02-06 12:09 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: David Lechner @ 2024-02-02 21:31 UTC (permalink / raw)
  To: Mark Brown
  Cc: David Lechner, Michael Hennerich, Nuno Sá, linux-spi, linux-kernel

This avoid duplicating the same macros in multiple drivers by reusing
the common AXI macros for the version register.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/spi/spi-axi-spi-engine.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 9ace259d2d29..6b0c72bf3395 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/fpga/adi-axi-common.h>
 #include <linux/idr.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -15,12 +16,6 @@
 #include <linux/spi/spi.h>
 #include <linux/timer.h>
 
-#define SPI_ENGINE_VERSION_MAJOR(x)	((x >> 16) & 0xff)
-#define SPI_ENGINE_VERSION_MINOR(x)	((x >> 8) & 0xff)
-#define SPI_ENGINE_VERSION_PATCH(x)	(x & 0xff)
-
-#define SPI_ENGINE_REG_VERSION			0x00
-
 #define SPI_ENGINE_REG_RESET			0x40
 
 #define SPI_ENGINE_REG_INT_ENABLE		0x80
@@ -661,12 +656,12 @@ static int spi_engine_probe(struct platform_device *pdev)
 	if (IS_ERR(spi_engine->base))
 		return PTR_ERR(spi_engine->base);
 
-	version = readl(spi_engine->base + SPI_ENGINE_REG_VERSION);
-	if (SPI_ENGINE_VERSION_MAJOR(version) != 1) {
+	version = readl(spi_engine->base + ADI_AXI_REG_VERSION);
+	if (ADI_AXI_PCORE_VER_MAJOR(version) != 1) {
 		dev_err(&pdev->dev, "Unsupported peripheral version %u.%u.%c\n",
-			SPI_ENGINE_VERSION_MAJOR(version),
-			SPI_ENGINE_VERSION_MINOR(version),
-			SPI_ENGINE_VERSION_PATCH(version));
+			ADI_AXI_PCORE_VER_MAJOR(version),
+			ADI_AXI_PCORE_VER_MINOR(version),
+			ADI_AXI_PCORE_VER_PATCH(version));
 		return -ENODEV;
 	}
 
-- 
2.43.0


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

* Re: [PATCH] spi: axi-spi-engine: use common AXI macros
  2024-02-02 21:31 [PATCH] spi: axi-spi-engine: use common AXI macros David Lechner
@ 2024-02-05  8:23 ` Nuno Sá
  2024-02-06 12:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nuno Sá @ 2024-02-05  8:23 UTC (permalink / raw)
  To: David Lechner, Mark Brown
  Cc: Michael Hennerich, Nuno Sá, linux-spi, linux-kernel

On Fri, 2024-02-02 at 15:31 -0600, David Lechner wrote:
> This avoid duplicating the same macros in multiple drivers by reusing
> the common AXI macros for the version register.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>



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

* Re: [PATCH] spi: axi-spi-engine: use common AXI macros
  2024-02-02 21:31 [PATCH] spi: axi-spi-engine: use common AXI macros David Lechner
  2024-02-05  8:23 ` Nuno Sá
@ 2024-02-06 12:09 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-02-06 12:09 UTC (permalink / raw)
  To: David Lechner; +Cc: Michael Hennerich, Nuno Sá, linux-spi, linux-kernel

On Fri, 02 Feb 2024 15:31:32 -0600, David Lechner wrote:
> This avoid duplicating the same macros in multiple drivers by reusing
> the common AXI macros for the version register.
> 
> 

Applied to

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

Thanks!

[1/1] spi: axi-spi-engine: use common AXI macros
      commit: 88c2b56c2690061121cad03f0f551db465287575

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:[~2024-02-06 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 21:31 [PATCH] spi: axi-spi-engine: use common AXI macros David Lechner
2024-02-05  8:23 ` Nuno Sá
2024-02-06 12:09 ` 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®