]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
blackfin: Fix local <asm/gpio.h> includes
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Oct 2017 09:46:09 +0000 (11:46 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 19 Oct 2017 08:12:49 +0000 (10:12 +0200)
When making the pin control submenu globally visible, all kinds
of oddities appear, in blackfin a few files were #including
<linux/gpio.h> and relying on that to pull in <asm/gpio.h>.

This was not working when pin control but not GPIOLIB was
selected resulting in a breakage in allmodconfig. The code these
files were using was still there and defined in <asm/gpio.h>
just not pulle in from just including <linux/gpio.h>

Simply add the required includes explicitly in the blackfin
kernel core and everything compiles fine.

Delete the use of the incorrect <linux/gpio.h> where possible.

Add stubs to <asm/gpio.h> for the functions called from PM:
these should probably also depend on !PINCTRL but since the
global CONFIG_PM symbol is used to compile PM support,
we need some more intrusive thing here, to be tested by
Blackfin maintainers.

Cc: Steven Miao <realmz6@gmail.com>
Cc: Huanhuan Feng <huanhuan.feng@analog.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/blackfin/include/asm/gpio.h
arch/blackfin/kernel/bfin_gpio.c
arch/blackfin/kernel/debug-mmrs.c
arch/blackfin/mach-common/ints-priority.c
arch/blackfin/mach-common/pm.c

index 99d338ca2ea420f5874e561fb96122271cf5e37d..a2579321c7f1c56baf98334fbfb7664f45d58d89 100644 (file)
@@ -183,6 +183,26 @@ static inline int irq_to_gpio(unsigned irq)
 {
        return irq - GPIO_IRQ_BASE;
 }
+
+#else /* CONFIG_PINCTRL */
+
+/*
+ * CONFIG_PM is not working with pin control and should probably
+ * avoid being selected when pin control is active, but so far,
+ * these stubs are here to make allyesconfig and allmodconfig
+ * compile properly. These functions are normally backed by the
+ * CONFIG_ADI_GPIO custom GPIO implementation.
+ */
+
+static inline int bfin_pm_standby_setup(void)
+{
+       return 0;
+}
+
+static inline void bfin_pm_standby_restore(void)
+{
+}
+
 #endif /* CONFIG_PINCTRL */
 
 #include <asm/irq.h>
index c5d31287de0153587e9c5cce99f59b7a5d82c0c0..63da80bbadf600d4359ea85afe8098a3c65c9798 100644 (file)
@@ -15,6 +15,9 @@
 /* FIXME: consumer API required for gpio_set_value() etc, get rid of this */
 #include <linux/gpio.h>
 #include <linux/irq.h>
+#include <asm/gpio.h>
+#include <asm/irq_handler.h>
+#include <asm/portmux.h>
 
 #if ANOMALY_05000311 || ANOMALY_05000323
 enum {
index f31ace221392c4d5c2006a1fa18b2f1271838eb3..194773ce109e28c52bd9d5b4ed041e502052ad14 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/gpio.h>
 
 #include <asm/blackfin.h>
 #include <asm/gptimers.h>
@@ -20,6 +19,7 @@
 #include <asm/bfin_serial.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/bfin_twi.h>
+#include <asm/gpio.h>
 
 /* Common code defines PORT_MUX on us, so redirect the MMR back locally */
 #ifdef BFIN_PORT_MUX
index 13e94bf9d8ba5f95d1f89999712a98f26778f581..e81a5b7dabdc318fddb3555f2147284f3ddaf3a5 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
 #include <linux/syscore_ops.h>
-#include <linux/gpio.h>
 #include <asm/delay.h>
 #ifdef CONFIG_IPIPE
 #include <linux/ipipe.h>
@@ -28,6 +27,7 @@
 #include <asm/irq_handler.h>
 #include <asm/dpmc.h>
 #include <asm/traps.h>
+#include <asm/gpio.h>
 
 /*
  * NOTES:
index 5ece38a5b75803f7a898ec5a68026b4d453d2b8f..f57b5fe5355ebd56c0c72aff7b33420d7992077f 100644 (file)
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
 
 #include <asm/cplb.h>
 #include <asm/dma.h>
 #include <asm/dpmc.h>
 #include <asm/pm.h>
+#include <asm/gpio.h>
 
 #ifdef CONFIG_BF60x
 struct bfin_cpu_pm_fns *bfin_cpu_pm;