genpd: move owl-sps-helper.c from drivers/soc
authorArnd Bergmann <arnd@arndb.de>
Wed, 26 Jul 2023 11:49:36 +0000 (13:49 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 26 Jul 2023 12:41:01 +0000 (14:41 +0200)
Moving only one of the two files in drivers/soc/actions to drivers/genpd
caused a link failure in allmodconfig, as drivers/genpd is entered
for compile testing, but drivers/soc/actions accidentally got skipped:

x86_64-linux-gnu-ld: vmlinux.o: in function `owl_sps_set_power':
owl-sps.c:(.text+0x16e259d): undefined reference to `owl_sps_set_pg'

Move the other one as well to allow build testing to work correctly.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/genpd/actions/Makefile
drivers/genpd/actions/owl-sps-helper.c [new file with mode: 0644]
drivers/soc/Makefile
drivers/soc/actions/Makefile [deleted file]
drivers/soc/actions/owl-sps-helper.c [deleted file]

index e78c420a24540aec7322d7cf48acbd6a9766ba73..7e8aa473d12d170638547bf4bc4645aa7afcc75c 100644 (file)
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0+
+obj-$(CONFIG_OWL_PM_DOMAINS_HELPER)    += owl-sps-helper.o
 obj-$(CONFIG_OWL_PM_DOMAINS)           += owl-sps.o
diff --git a/drivers/genpd/actions/owl-sps-helper.c b/drivers/genpd/actions/owl-sps-helper.c
new file mode 100644 (file)
index 0000000..e3f3660
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Actions Semi Owl Smart Power System (SPS) shared helpers
+ *
+ * Copyright 2012 Actions Semi Inc.
+ * Author: Actions Semi, Inc.
+ *
+ * Copyright (c) 2017 Andreas Färber
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/soc/actions/owl-sps.h>
+
+#define OWL_SPS_PG_CTL 0x0
+
+int owl_sps_set_pg(void __iomem *base, u32 pwr_mask, u32 ack_mask, bool enable)
+{
+       u32 val;
+       bool ack;
+       int timeout;
+
+       val = readl(base + OWL_SPS_PG_CTL);
+       ack = val & ack_mask;
+       if (ack == enable)
+               return 0;
+
+       if (enable)
+               val |= pwr_mask;
+       else
+               val &= ~pwr_mask;
+
+       writel(val, base + OWL_SPS_PG_CTL);
+
+       for (timeout = 5000; timeout > 0; timeout -= 50) {
+               val = readl(base + OWL_SPS_PG_CTL);
+               if ((val & ack_mask) == (enable ? ack_mask : 0))
+                       break;
+               udelay(50);
+       }
+       if (timeout <= 0)
+               return -ETIMEDOUT;
+
+       udelay(10);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(owl_sps_set_pg);
index efdcd42f68cb3b03b361023c878d92dbf5f3131d..708eaad8f590d5f0739f8ac160b9ab2cc46a41e3 100644 (file)
@@ -3,7 +3,6 @@
 # Makefile for the Linux Kernel SOC specific device drivers.
 #
 
-obj-$(CONFIG_ARCH_ACTIONS)     += actions/
 obj-y                          += apple/
 obj-y                          += aspeed/
 obj-$(CONFIG_ARCH_AT91)                += atmel/
diff --git a/drivers/soc/actions/Makefile b/drivers/soc/actions/Makefile
deleted file mode 100644 (file)
index 4ac88fe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-
-obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o
diff --git a/drivers/soc/actions/owl-sps-helper.c b/drivers/soc/actions/owl-sps-helper.c
deleted file mode 100644 (file)
index e3f3660..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Actions Semi Owl Smart Power System (SPS) shared helpers
- *
- * Copyright 2012 Actions Semi Inc.
- * Author: Actions Semi, Inc.
- *
- * Copyright (c) 2017 Andreas Färber
- */
-
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/soc/actions/owl-sps.h>
-
-#define OWL_SPS_PG_CTL 0x0
-
-int owl_sps_set_pg(void __iomem *base, u32 pwr_mask, u32 ack_mask, bool enable)
-{
-       u32 val;
-       bool ack;
-       int timeout;
-
-       val = readl(base + OWL_SPS_PG_CTL);
-       ack = val & ack_mask;
-       if (ack == enable)
-               return 0;
-
-       if (enable)
-               val |= pwr_mask;
-       else
-               val &= ~pwr_mask;
-
-       writel(val, base + OWL_SPS_PG_CTL);
-
-       for (timeout = 5000; timeout > 0; timeout -= 50) {
-               val = readl(base + OWL_SPS_PG_CTL);
-               if ((val & ack_mask) == (enable ? ack_mask : 0))
-                       break;
-               udelay(50);
-       }
-       if (timeout <= 0)
-               return -ETIMEDOUT;
-
-       udelay(10);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(owl_sps_set_pg);