From 1c363531dd814dc4fe10865722bf6b0f72ce4673 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 11 Oct 2017 11:57:15 +0200 Subject: pinctrl: adi2: Fix Kconfig build problem The build robot is complaining on Blackfin: drivers/pinctrl/pinctrl-adi2.c: In function 'port_setup': >> drivers/pinctrl/pinctrl-adi2.c:221:21: error: dereferencing pointer to incomplete type 'struct gpio_port_t' writew(readw(®s->port_fer) & ~BIT(offset), ^~ drivers/pinctrl/pinctrl-adi2.c: In function 'adi_gpio_ack_irq': >> drivers/pinctrl/pinctrl-adi2.c:266:18: error: dereferencing pointer to incomplete type 'struct bfin_pint_regs' if (readl(®s->invert_set) & pintbit) ^~ It seems the driver need to include and to compile. The Blackfin architecture was re-defining the Kconfig PINCTRL symbol which is not OK, so replaced this with PINCTRL_BLACKFIN_ADI2 which selects PINCTRL and PINCTRL_ADI2 just like most arches do. Further, the old GPIO driver symbol GPIO_ADI was possible to select at the same time as selecting PINCTRL. This was not working because the arch-local header contains an explicit #ifndef PINCTRL clause making compilation break if you combine them. The same is true for DEBUG_MMRS. Make sure the ADI2 pinctrl driver is not selected at the same time as the old GPIO implementation. (This should be converted to use gpiolib or pincontrol and move to drivers/...) Also make sure the old GPIO_ADI driver or DEBUG_MMRS is not selected at the same time as the new PINCTRL implementation, and only make PINCTRL_ADI2 selectable for the Blackfin families that actually have it. This way it is still possible to add e.g. I2C-based pin control expanders on the Blackfin. Cc: Steven Miao Cc: Huanhuan Feng Signed-off-by: Linus Walleij --- arch/blackfin/Kconfig | 7 +++++-- arch/blackfin/Kconfig.debug | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/blackfin') diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 89bdb8264305..6cd804e16a94 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -320,11 +320,14 @@ config BF53x config GPIO_ADI def_bool y + depends on !PINCTRL depends on (BF51x || BF52x || BF53x || BF538 || BF539 || BF561) -config PINCTRL +config PINCTRL_BLACKFIN_ADI2 def_bool y - depends on BF54x || BF60x + depends on (BF54x || BF60x) + select PINCTRL + select PINCTRL_ADI2 config MEM_MT48LC64M4A2FB_7E bool diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug index f3337ee03621..a93cf06a4d6f 100644 --- a/arch/blackfin/Kconfig.debug +++ b/arch/blackfin/Kconfig.debug @@ -17,6 +17,7 @@ config DEBUG_VERBOSE config DEBUG_MMRS tristate "Generate Blackfin MMR tree" + depends on !PINCTRL select DEBUG_FS help Create a tree of Blackfin MMRs via the debugfs tree. If -- cgit From 350bdb84fda89270703907fb4c4fb482e1edbc31 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 17 Oct 2017 11:46:09 +0200 Subject: blackfin: Fix local includes When making the pin control submenu globally visible, all kinds of oddities appear, in blackfin a few files were #including and relying on that to pull in . 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 just not pulle in from just including Simply add the required includes explicitly in the blackfin kernel core and everything compiles fine. Delete the use of the incorrect where possible. Add stubs to 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 Cc: Huanhuan Feng Signed-off-by: Linus Walleij --- arch/blackfin/include/asm/gpio.h | 20 ++++++++++++++++++++ arch/blackfin/kernel/bfin_gpio.c | 3 +++ arch/blackfin/kernel/debug-mmrs.c | 2 +- arch/blackfin/mach-common/ints-priority.c | 2 +- arch/blackfin/mach-common/pm.c | 2 +- 5 files changed, 26 insertions(+), 3 deletions(-) (limited to 'arch/blackfin') diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 99d338ca2ea4..a2579321c7f1 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h @@ -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 diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index c5d31287de01..63da80bbadf6 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -15,6 +15,9 @@ /* FIXME: consumer API required for gpio_set_value() etc, get rid of this */ #include #include +#include +#include +#include #if ANOMALY_05000311 || ANOMALY_05000323 enum { diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c index f31ace221392..194773ce109e 100644 --- a/arch/blackfin/kernel/debug-mmrs.c +++ b/arch/blackfin/kernel/debug-mmrs.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include /* Common code defines PORT_MUX on us, so redirect the MMR back locally */ #ifdef BFIN_PORT_MUX diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 13e94bf9d8ba..e81a5b7dabdc 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #ifdef CONFIG_IPIPE #include @@ -28,6 +27,7 @@ #include #include #include +#include /* * NOTES: diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c index 5ece38a5b758..f57b5fe5355e 100644 --- a/arch/blackfin/mach-common/pm.c +++ b/arch/blackfin/mach-common/pm.c @@ -15,12 +15,12 @@ #include #include #include -#include #include #include #include #include +#include #ifdef CONFIG_BF60x struct bfin_cpu_pm_fns *bfin_cpu_pm; -- cgit