diff mbox series

pinctrl: lochnagar: select GPIOLIB

Message ID 20191218163701.171914-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series pinctrl: lochnagar: select GPIOLIB | expand

Commit Message

Arnd Bergmann Dec. 18, 2019, 4:36 p.m. UTC
In a rare randconfig build I came across one configuration that does
not enable CONFIG_GPIOLIB, which is needed by lochnagar:

ERROR: "devm_gpiochip_add_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_generic_free" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_generic_request" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_get_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!

Add another 'select' like all other pinctrl drivers have.

Fixes: 0548448b719a ("pinctrl: lochnagar: Add support for the Cirrus Logic Lochnagar")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
subsystem, or if there are still good reasons for leaving it disabled
on any machine that uses CONFIG_PINCTRL.
---
 drivers/pinctrl/cirrus/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Charles Keepax Dec. 19, 2019, 9:27 a.m. UTC | #1
On Wed, Dec 18, 2019 at 05:36:46PM +0100, Arnd Bergmann wrote:
> In a rare randconfig build I came across one configuration that does
> not enable CONFIG_GPIOLIB, which is needed by lochnagar:
> 
> ERROR: "devm_gpiochip_add_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_generic_free" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_generic_request" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_get_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> 
> Add another 'select' like all other pinctrl drivers have.
> 
> Fixes: 0548448b719a ("pinctrl: lochnagar: Add support for the Cirrus Logic Lochnagar")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
Linus Walleij Jan. 7, 2020, 9:45 a.m. UTC | #2
On Wed, Dec 18, 2019 at 5:37 PM Arnd Bergmann <arnd@arndb.de> wrote:

> In a rare randconfig build I came across one configuration that does
> not enable CONFIG_GPIOLIB, which is needed by lochnagar:
>
> ERROR: "devm_gpiochip_add_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_generic_free" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_generic_request" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
> ERROR: "gpiochip_get_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
>
> Add another 'select' like all other pinctrl drivers have.
>
> Fixes: 0548448b719a ("pinctrl: lochnagar: Add support for the Cirrus Logic Lochnagar")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied!

> I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
> subsystem, or if there are still good reasons for leaving it disabled
> on any machine that uses CONFIG_PINCTRL.

Hm that is a tricky question, they almost always come in pair but are
technically speaking separate subsystems.

I have a (very) long-term plan to merge them at some point before
I retire :D

Yours,
Linus Walleij
Arnd Bergmann Jan. 7, 2020, 10:39 a.m. UTC | #3
On Tue, Jan 7, 2020 at 10:45 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Dec 18, 2019 at 5:37 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
> > subsystem, or if there are still good reasons for leaving it disabled
> > on any machine that uses CONFIG_PINCTRL.
>
> Hm that is a tricky question, they almost always come in pair but are
> technically speaking separate subsystems.

I think there are a number of use cases for GPIOLIB drivers without PINCTRL, but
are there any examples of the reverse?

       Arnd
Richard Fitzgerald Jan. 7, 2020, 11:58 a.m. UTC | #4
On 07/01/2020 10:39, Arnd Bergmann wrote:
> On Tue, Jan 7, 2020 at 10:45 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Wed, Dec 18, 2019 at 5:37 PM Arnd Bergmann <arnd@arndb.de> wrote:
>>> I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
>>> subsystem, or if there are still good reasons for leaving it disabled
>>> on any machine that uses CONFIG_PINCTRL.
>>
>> Hm that is a tricky question, they almost always come in pair but are
>> technically speaking separate subsystems.
> 
> I think there are a number of use cases for GPIOLIB drivers without PINCTRL, but
> are there any examples of the reverse?
> 
>         Arnd
> 

You could have muxable pins that aren't gpios. For example muxing 
between i2c/spi signals. So a pinctrl driver doesn't imply gpio.
Arnd Bergmann Jan. 7, 2020, 12:38 p.m. UTC | #5
On Tue, Jan 7, 2020 at 12:58 PM Richard Fitzgerald
<rf@opensource.cirrus.com> wrote:
> On 07/01/2020 10:39, Arnd Bergmann wrote:
> > On Tue, Jan 7, 2020 at 10:45 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> >> On Wed, Dec 18, 2019 at 5:37 PM Arnd Bergmann <arnd@arndb.de> wrote:
> >>> I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
> >>> subsystem, or if there are still good reasons for leaving it disabled
> >>> on any machine that uses CONFIG_PINCTRL.
> >>
> >> Hm that is a tricky question, they almost always come in pair but are
> >> technically speaking separate subsystems.
> >
> > I think there are a number of use cases for GPIOLIB drivers without PINCTRL, but
> > are there any examples of the reverse?
>
> You could have muxable pins that aren't gpios. For example muxing
> between i2c/spi signals. So a pinctrl driver doesn't imply gpio.

I understand that this is the case in theory, but what I was wondering about
is whether there are any such users, or at least any that also want to
save a few kilobytes of kernel size for gpiolib.

          Arnd
Linus Walleij Jan. 7, 2020, 1:01 p.m. UTC | #6
On Tue, Jan 7, 2020 at 1:39 PM Arnd Bergmann <arnd@arndb.de> wrote:
> On Tue, Jan 7, 2020 at 12:58 PM Richard Fitzgerald
> <rf@opensource.cirrus.com> wrote:
> > On 07/01/2020 10:39, Arnd Bergmann wrote:
> > > On Tue, Jan 7, 2020 at 10:45 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> > >> On Wed, Dec 18, 2019 at 5:37 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > >>> I wonder if GPIOLIB should just become mandatory when enabling the pinctrl
> > >>> subsystem, or if there are still good reasons for leaving it disabled
> > >>> on any machine that uses CONFIG_PINCTRL.
> > >>
> > >> Hm that is a tricky question, they almost always come in pair but are
> > >> technically speaking separate subsystems.
> > >
> > > I think there are a number of use cases for GPIOLIB drivers without PINCTRL, but
> > > are there any examples of the reverse?
> >
> > You could have muxable pins that aren't gpios. For example muxing
> > between i2c/spi signals. So a pinctrl driver doesn't imply gpio.
>
> I understand that this is the case in theory, but what I was wondering about
> is whether there are any such users, or at least any that also want to
> save a few kilobytes of kernel size for gpiolib.

I don't think so. In any case what we need to do at all times is
put gpiolib on lowcarb diet as it gets compiled into pretty much
everything (at least everything embedded), so I am working a bit on that.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/cirrus/Kconfig b/drivers/pinctrl/cirrus/Kconfig
index f1806fd781a0..530426a74f75 100644
--- a/drivers/pinctrl/cirrus/Kconfig
+++ b/drivers/pinctrl/cirrus/Kconfig
@@ -2,6 +2,7 @@ 
 config PINCTRL_LOCHNAGAR
 	tristate "Cirrus Logic Lochnagar pinctrl driver"
 	depends on MFD_LOCHNAGAR
+	select GPIOLIB
 	select PINMUX
 	select PINCONF
 	select GENERIC_PINCONF