pinctrl: adi2: Fix Kconfig build problem
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 11 Oct 2017 09:57:15 +0000 (11:57 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 19 Oct 2017 08:10:56 +0000 (10:10 +0200)
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(&regs->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(&regs->invert_set) & pintbit)
                     ^~
It seems the driver need to include <asm/gpio.h> and <asm/irq.h>
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 <asm/gpio.h> 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 <realmz6@gmail.com>
Cc: Huanhuan Feng <huanhuan.feng@analog.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/blackfin/Kconfig
arch/blackfin/Kconfig.debug
drivers/pinctrl/Kconfig

index 89bdb8264305c6a0547948c31ff0781c0b31eaa4..6cd804e16a94c03c4e2fcd598b657d394449fb32 100644 (file)
@@ -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
index f3337ee03621d5f79a31af217bbd4bdf99dee79b..a93cf06a4d6fde552a284c6d48377e9636d41160 100644 (file)
@@ -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
index c0294958405d9c855d7e5651cdeef9cda601d529..5b4939e709ac54f96c9ab110bd4d96304c7cbb96 100644 (file)
@@ -32,7 +32,8 @@ config DEBUG_PINCTRL
 
 config PINCTRL_ADI2
        bool "ADI pin controller driver"
-       depends on BLACKFIN
+       depends on (BF54x || BF60x)
+       depends on !GPIO_ADI
        select PINMUX
        select IRQ_DOMAIN
        help