Commit 65053e1a authored by Linus Walleij's avatar Linus Walleij

gpio: delete ARCH_[WANTS_OPTIONAL|REQUIRE]_GPIOLIB

The GPIOLIB is now selectable explicitly, and always available
for all archs. All archs that require GPIOLIB are switched to
select GPIOLIB directly. Delete the hairy ARCH_REQUIRE_GPIOLIB
and ARCH_WANTS_OPTIONAL_GPIOLIB Kconfig symbols.

Cc: Michael Büsch <m@bues.ch>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 10e59a64
...@@ -8,9 +8,9 @@ gpio-legacy.txt (actually, there is no real mapping possible with the old ...@@ -8,9 +8,9 @@ gpio-legacy.txt (actually, there is no real mapping possible with the old
interface; you just fetch an integer from somewhere and request the interface; you just fetch an integer from somewhere and request the
corresponding GPIO. corresponding GPIO.
Platforms that make use of GPIOs must select ARCH_REQUIRE_GPIOLIB (if GPIO usage All platforms can enable the GPIO library, but if the platform strictly
is mandatory) or ARCH_WANT_OPTIONAL_GPIOLIB (if GPIO support can be omitted) in requires GPIO functionality to be present, it needs to select GPIOLIB from its
their Kconfig. Then, how GPIOs are mapped depends on what the platform uses to Kconfig. Then, how GPIOs are mapped depends on what the platform uses to
describe its hardware layout. Currently, mappings can be defined through device describe its hardware layout. Currently, mappings can be defined through device
tree, ACPI, and platform data. tree, ACPI, and platform data.
......
...@@ -72,8 +72,8 @@ in this document, but drivers acting as clients to the GPIO interface must ...@@ -72,8 +72,8 @@ in this document, but drivers acting as clients to the GPIO interface must
not care how it's implemented.) not care how it's implemented.)
That said, if the convention is supported on their platform, drivers should That said, if the convention is supported on their platform, drivers should
use it when possible. Platforms must select ARCH_REQUIRE_GPIOLIB or use it when possible. Platforms must select GPIOLIB if GPIO functionality
ARCH_WANT_OPTIONAL_GPIOLIB in their Kconfig. Drivers that can't work without is strictly required. Drivers that can't work without
standard GPIO calls should have Kconfig entries which depend on GPIOLIB. The standard GPIO calls should have Kconfig entries which depend on GPIOLIB. The
GPIO calls are available, either as "real code" or as optimized-away stubs, GPIO calls are available, either as "real code" or as optimized-away stubs,
when drivers use the include file: when drivers use the include file:
...@@ -553,22 +553,14 @@ either NULL or the label associated with that GPIO when it was requested. ...@@ -553,22 +553,14 @@ either NULL or the label associated with that GPIO when it was requested.
Platform Support Platform Support
---------------- ----------------
To support this framework, a platform's Kconfig will "select" either To force-enable this framework, a platform's Kconfig will "select" GPIOLIB,
ARCH_REQUIRE_GPIOLIB or ARCH_WANT_OPTIONAL_GPIOLIB else it is up to the user to configure support for GPIO.
and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines
three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep().
It may also provide a custom value for ARCH_NR_GPIOS, so that it better It may also provide a custom value for ARCH_NR_GPIOS, so that it better
reflects the number of GPIOs in actual use on that platform, without reflects the number of GPIOs in actual use on that platform, without
wasting static table space. (It should count both built-in/SoC GPIOs and wasting static table space. (It should count both built-in/SoC GPIOs and
also ones on GPIO expanders. also ones on GPIO expanders.
ARCH_REQUIRE_GPIOLIB means that the gpiolib code will always get compiled
into the kernel on that architecture.
ARCH_WANT_OPTIONAL_GPIOLIB means the gpiolib code defaults to off and the user
can enable it and build it into the kernel optionally.
If neither of these options are selected, the platform does not support If neither of these options are selected, the platform does not support
GPIOs through GPIO-lib and the code cannot be enabled by the user. GPIOs through GPIO-lib and the code cannot be enabled by the user.
......
...@@ -10,27 +10,6 @@ config ARCH_HAVE_CUSTOM_GPIO_H ...@@ -10,27 +10,6 @@ config ARCH_HAVE_CUSTOM_GPIO_H
overriding the default implementations. New uses of this are overriding the default implementations. New uses of this are
strongly discouraged. strongly discouraged.
config ARCH_WANT_OPTIONAL_GPIOLIB
bool
help
Select this config option from the architecture Kconfig, if
it is possible to use gpiolib on the architecture, but let the
user decide whether to actually build it or not.
Select this instead of ARCH_REQUIRE_GPIOLIB, if your architecture does
not depend on GPIOs being available, but rather let the user
decide whether he needs it or not.
config ARCH_REQUIRE_GPIOLIB
bool
select GPIOLIB
help
Platforms select gpiolib if they use this infrastructure
for all their GPIOs, usually starting with ones integrated
into SOC processors.
Selecting this from the architecture code will cause the gpiolib
code to always get built in.
menuconfig GPIOLIB menuconfig GPIOLIB
bool "GPIO Support" bool "GPIO Support"
select ANON_INODES select ANON_INODES
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment