ARM: omap1: move perseus spi pinconf to board file
authorArnd Bergmann <arnd@arndb.de>
Mon, 5 Aug 2019 19:28:15 +0000 (21:28 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 21 Apr 2022 13:01:08 +0000 (15:01 +0200)
The driver has always had a FIXME about this, and it seems
like this trivial code move avoids a mach header inclusion,
so just do it.

With that out of the way, and the header file inclusions
changed to global files, the driver can also be compile-tested
on other platforms.

Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-omap1/board-perseus2.c
drivers/spi/Kconfig
drivers/spi/spi-omap-uwire.c

index 1aeeb73..da01551 100644 (file)
@@ -289,6 +289,12 @@ static void __init omap_perseus2_init(void)
        omap_cfg_reg(F4_7XX_KBC3);
        omap_cfg_reg(E3_7XX_KBC4);
 
+       if (IS_ENABLED(CONFIG_SPI_OMAP_UWIRE)) {
+               /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */
+               int val = omap_readl(OMAP7XX_IO_CONF_9) & ~0x00EEE000;
+               omap_writel(val | 0x00AAA000, OMAP7XX_IO_CONF_9);
+       }
+
        platform_add_devices(devices, ARRAY_SIZE(devices));
 
        omap_serial_init();
index d2815eb..6c28ca2 100644 (file)
@@ -631,7 +631,7 @@ config SPI_OCTEON
 
 config SPI_OMAP_UWIRE
        tristate "OMAP1 MicroWire"
-       depends on ARCH_OMAP1
+       depends on ARCH_OMAP1 || (ARM && COMPILE_TEST)
        select SPI_BITBANG
        help
          This hooks up to the MicroWire controller on OMAP1 chips.
index 087172a..29198e6 100644 (file)
 #include <linux/module.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <asm/mach-types.h>
-
-#include <mach/mux.h>
-
-#include <mach/omap7xx.h>      /* OMAP7XX_IO_CONF registers */
-
+#include <linux/soc/ti/omap1-io.h>
+#include <linux/soc/ti/omap1-soc.h>
+#include <linux/soc/ti/omap1-mux.h>
 
 /* FIXME address is now a platform device resource,
  * and irqs should show there too...
@@ -548,12 +545,6 @@ static int __init omap_uwire_init(void)
                omap_cfg_reg(N14_1610_UWIRE_CS0);
                omap_cfg_reg(N15_1610_UWIRE_CS1);
        }
-       if (machine_is_omap_perseus2()) {
-               /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */
-               int val = omap_readl(OMAP7XX_IO_CONF_9) & ~0x00EEE000;
-               omap_writel(val | 0x00AAA000, OMAP7XX_IO_CONF_9);
-       }
-
        return platform_driver_register(&uwire_driver);
 }