2019-05-19 20:07:45 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
drivers: create a pin control subsystem
This creates a subsystem for handling of pin control devices.
These are devices that control different aspects of package
pins.
Currently it handles pinmuxing, i.e. assigning electronic
functions to groups of pins on primarily PGA and BGA type of
chip packages which are common in embedded systems.
The plan is to also handle other I/O pin control aspects
such as biasing, driving, input properties such as
schmitt-triggering, load capacitance etc within this
subsystem, to remove a lot of ARM arch code as well as
feature-creepy GPIO drivers which are implementing the same
thing over and over again.
This is being done to depopulate the arch/arm/* directory
of such custom drivers and try to abstract the infrastructure
they all need. See the Documentation/pinctrl.txt file that is
part of this patch for more details.
ChangeLog v1->v2:
- Various minor fixes from Joe's and Stephens review comments
- Added a pinmux_config() that can invoke custom configuration
with arbitrary data passed in or out to/from the pinmux driver
ChangeLog v2->v3:
- Renamed subsystem folder to "pinctrl" since we will likely
want to keep other pin control such as biasing in this
subsystem too, so let us keep to something generic even though
we're mainly doing pinmux now.
- As a consequence, register pins as an abstract entity separate
from the pinmux. The muxing functions will claim pins out of the
pin pool and make sure they do not collide. Pins can now be
named by the pinctrl core.
- Converted the pin lookup from a static array into a radix tree,
I agreed with Grant Likely to try to avoid any static allocation
(which is crap for device tree stuff) so I just rewrote this
to be dynamic, just like irq number descriptors. The
platform-wide definition of number of pins goes away - this is
now just the sum total of the pins registered to the subsystem.
- Make sure mappings with only a function name and no device
works properly.
ChangeLog v3->v4:
- Define a number space per controller instead of globally,
Stephen and Grant requested the same thing so now maps need to
define target controller, and the radix tree of pin descriptors
is a property on each pin controller device.
- Add a compulsory pinctrl device entry to the pinctrl mapping
table. This must match the pinctrl device, like "pinctrl.0"
- Split the file core.c in two: core.c and pinmux.c where the
latter carry all pinmux stuff, the core is for generic pin
control, and use local headers to access functionality between
files. It is now possible to implement a "blank" pin controller
without pinmux capabilities. This split will make new additions
like pindrive.c, pinbias.c etc possible for combined drivers
and chunks of functionality which is a GoodThing(TM).
- Rewrite the interaction with the GPIO subsystem - the pin
controller descriptor now handles this by defining an offset
into the GPIO numberspace for its handled pin range. This is
used to look up the apropriate pin controller for a GPIO pin.
Then that specific GPIO range is matched 1-1 for the target
controller instance.
- Fixed a number of review comments from Joe Perches.
- Broke out a header file pinctrl.h for the core pin handling
stuff that will be reused by other stuff than pinmux.
- Fixed some erroneous EXPORT() stuff.
- Remove mispatched U300 Kconfig and Makefile entries
- Fixed a number of review comments from Stephen Warren, not all
of them - still WIP. But I think the new mapping that will
specify which function goes to which pin mux controller address
50% of your concerns (else beat me up).
ChangeLog v4->v5:
- Defined a "position" for each function, so the pin controller now
tracks a function in a certain position, and the pinmux maps define
what position you want the function in. (Feedback from Stephen
Warren and Sascha Hauer).
- Since we now need to request a combined function+position from
the machine mapping table that connect mux settings to drivers,
it was extended with a position field and a name field. The
name field is now used if you e.g. need to switch between two
mux map settings at runtime.
- Switched from a class device to using struct bus_type for this
subsystem. Verified sysfs functionality: seems to work fine.
(Feedback from Arnd Bergmann and Greg Kroah-Hartman)
- Define a per pincontroller list of GPIO ranges from the GPIO
pin space that can be handled by the pin controller. These can
be added one by one at runtime. (Feedback from Barry Song)
- Expanded documentation of regulator_[get|enable|disable|put]
semantics.
- Fixed a number of review comments from Barry Song. (Thanks!)
ChangeLog v5->v6:
- Create an abstract pin group concept that can sort pins into
named and enumerated groups no matter what the use of these
groups may be, one possible usecase is a group of pins being
muxed in or so. The intention is however to also use these
groups for other pin control activities.
- Make it compulsory for pinmux functions to associate with
at least one group, so the abstract pin group concept is used
to define the groups of pins affected by a pinmux function.
The pinmux driver interface has been altered so as to enforce
a function to list applicable groups per function.
- Provide an optional .group entry in the pinmux machine map
so the map can select beteween different available groups
to be used with a certain function.
- Consequent changes all over the place so that e.g. debugfs
present reasonable information about the world.
- Drop the per-pin mux (*config) function in the pinmux_ops
struct - I was afraid that this would start to be used for
things totally unrelated to muxing, we can introduce that to
the generic struct pinctrl_ops if needed. I want to keep
muxing orthogonal to other pin control subjects and not mix
these things up.
ChangeLog v6->v7:
- Make it possible to have several map entries matching the
same device, pin controller and function, but using
a different group, and alter the semantics so that
pinmux_get() will pick all matching map entries, and
store the associated groups in a list. The list will
then be iterated over at pinmux_enable()/pinmux_disable()
and corresponding driver functions called for each
defined group. Notice that you're only allowed to map
multiple *groups* to the same
{ device, pin controller, function } triplet, attempts
to map the same device to multiple pin controllers will
for example fail. This is hopefully the crucial feature
requested by Stephen Warren.
- Add a pinmux hogging field to the pinmux mapping entries,
and enable the pinmux core to hog pinmux map entries.
This currently only works for pinmuxes without assigned
devices as it looks now, but with device trees we can
look up the corresponding struct device * entries when
we register the pinmux driver, and have it hog each
pinmux map in turn, for a simple approach to
non-dynamic pin muxing. This addresses an issue from
Grant Likely that the machine should take care of as
much of the pinmux setup as possible, not the devices.
By supplying a list of hogs, it can now instruct the
core to take care of any static mappings.
- Switch pinmux group retrieveal function to grab an
array of strings representing the groups rather than an
array of unsigned and rewrite accordingly.
- Alter debugfs to show the grouplist handled by each
pinmux. Also add a list of hogs.
- Dynamically allocate a struct pinmux at pinmux_get() and
free it at pinmux_put(), then add these to the global
list of pinmuxes active as we go along.
- Go over the list of pinmux maps at pinmux_get() time
and repeatedly apply matches.
- Retrieve applicable groups per function from the driver
as a string array rather than a unsigned array, then
lookup the enumerators.
- Make the device to pinmux map a singleton - only allow the
mapping table to be registered once and even tag the
registration function with __init so it surely won't be
abused.
- Create a separate debugfs file to view the pinmux map at
runtime.
- Introduce a spin lock to the pin descriptor struct, lock it
when modifying pin status entries. Reported by Stijn Devriendt.
- Fix up the documentation after review from Stephen Warren.
- Let the GPIO ranges give names as const char * instead of some
fixed-length string.
- add a function to unregister GPIO ranges to mirror the
registration function.
- Privatized the struct pinctrl_device and removed it from the
<linux/pinctrl/pinctrl.h> API, the drivers do not need to know
the members of this struct. It is now in the local header
"core.h".
- Rename the concept of "anonymous" mux maps to "system" muxes
and add convenience macros and documentation.
ChangeLog v7->v8:
- Delete the leftover pinmux_config() function from the
<linux/pinctrl/pinmux.h> header.
- Fix a race condition found by Stijn Devriendt in pin_request()
ChangeLog v8->v9:
- Drop the bus_type and the sysfs attributes and all, we're not on
the clear about how this should be used for e.g. userspace
interfaces so let us save this for the future.
- Use the right name in MAINTAINERS, PIN CONTROL rather than
PINMUX
- Don't kfree() the device state holder, let the .remove() callback
handle this.
- Fix up numerous kerneldoc headers to have one line for the function
description and more verbose documentation below the parameters
ChangeLog v9->v10:
- pinctrl: EXPORT_SYMBOL needs export.h, folded in a patch
from Steven Rothwell
- fix pinctrl_register error handling, folded in a patch from
Axel Lin
- Various fixes to documentation text so that it's consistent.
- Removed pointless comment from drivers/Kconfig
- Removed dependency on SYSFS since we removed the bus in
v9.
- Renamed hopelessly abbreviated pctldev_* functions to the
more verbose pinctrl_dev_*
- Drop mutex properly when looking up GPIO ranges
- Return NULL instead of ERR_PTR() errors on registration of
pin controllers, using cast pointers is fragile. We can
live without the detailed error codes for sure.
Cc: Stijn Devriendt <highguy@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-05-03 02:50:54 +08:00
|
|
|
#
|
|
|
|
# PINCTRL infrastructure and drivers
|
|
|
|
#
|
|
|
|
|
2017-10-06 13:08:05 +08:00
|
|
|
menuconfig PINCTRL
|
|
|
|
bool "Pin controllers"
|
drivers: create a pin control subsystem
This creates a subsystem for handling of pin control devices.
These are devices that control different aspects of package
pins.
Currently it handles pinmuxing, i.e. assigning electronic
functions to groups of pins on primarily PGA and BGA type of
chip packages which are common in embedded systems.
The plan is to also handle other I/O pin control aspects
such as biasing, driving, input properties such as
schmitt-triggering, load capacitance etc within this
subsystem, to remove a lot of ARM arch code as well as
feature-creepy GPIO drivers which are implementing the same
thing over and over again.
This is being done to depopulate the arch/arm/* directory
of such custom drivers and try to abstract the infrastructure
they all need. See the Documentation/pinctrl.txt file that is
part of this patch for more details.
ChangeLog v1->v2:
- Various minor fixes from Joe's and Stephens review comments
- Added a pinmux_config() that can invoke custom configuration
with arbitrary data passed in or out to/from the pinmux driver
ChangeLog v2->v3:
- Renamed subsystem folder to "pinctrl" since we will likely
want to keep other pin control such as biasing in this
subsystem too, so let us keep to something generic even though
we're mainly doing pinmux now.
- As a consequence, register pins as an abstract entity separate
from the pinmux. The muxing functions will claim pins out of the
pin pool and make sure they do not collide. Pins can now be
named by the pinctrl core.
- Converted the pin lookup from a static array into a radix tree,
I agreed with Grant Likely to try to avoid any static allocation
(which is crap for device tree stuff) so I just rewrote this
to be dynamic, just like irq number descriptors. The
platform-wide definition of number of pins goes away - this is
now just the sum total of the pins registered to the subsystem.
- Make sure mappings with only a function name and no device
works properly.
ChangeLog v3->v4:
- Define a number space per controller instead of globally,
Stephen and Grant requested the same thing so now maps need to
define target controller, and the radix tree of pin descriptors
is a property on each pin controller device.
- Add a compulsory pinctrl device entry to the pinctrl mapping
table. This must match the pinctrl device, like "pinctrl.0"
- Split the file core.c in two: core.c and pinmux.c where the
latter carry all pinmux stuff, the core is for generic pin
control, and use local headers to access functionality between
files. It is now possible to implement a "blank" pin controller
without pinmux capabilities. This split will make new additions
like pindrive.c, pinbias.c etc possible for combined drivers
and chunks of functionality which is a GoodThing(TM).
- Rewrite the interaction with the GPIO subsystem - the pin
controller descriptor now handles this by defining an offset
into the GPIO numberspace for its handled pin range. This is
used to look up the apropriate pin controller for a GPIO pin.
Then that specific GPIO range is matched 1-1 for the target
controller instance.
- Fixed a number of review comments from Joe Perches.
- Broke out a header file pinctrl.h for the core pin handling
stuff that will be reused by other stuff than pinmux.
- Fixed some erroneous EXPORT() stuff.
- Remove mispatched U300 Kconfig and Makefile entries
- Fixed a number of review comments from Stephen Warren, not all
of them - still WIP. But I think the new mapping that will
specify which function goes to which pin mux controller address
50% of your concerns (else beat me up).
ChangeLog v4->v5:
- Defined a "position" for each function, so the pin controller now
tracks a function in a certain position, and the pinmux maps define
what position you want the function in. (Feedback from Stephen
Warren and Sascha Hauer).
- Since we now need to request a combined function+position from
the machine mapping table that connect mux settings to drivers,
it was extended with a position field and a name field. The
name field is now used if you e.g. need to switch between two
mux map settings at runtime.
- Switched from a class device to using struct bus_type for this
subsystem. Verified sysfs functionality: seems to work fine.
(Feedback from Arnd Bergmann and Greg Kroah-Hartman)
- Define a per pincontroller list of GPIO ranges from the GPIO
pin space that can be handled by the pin controller. These can
be added one by one at runtime. (Feedback from Barry Song)
- Expanded documentation of regulator_[get|enable|disable|put]
semantics.
- Fixed a number of review comments from Barry Song. (Thanks!)
ChangeLog v5->v6:
- Create an abstract pin group concept that can sort pins into
named and enumerated groups no matter what the use of these
groups may be, one possible usecase is a group of pins being
muxed in or so. The intention is however to also use these
groups for other pin control activities.
- Make it compulsory for pinmux functions to associate with
at least one group, so the abstract pin group concept is used
to define the groups of pins affected by a pinmux function.
The pinmux driver interface has been altered so as to enforce
a function to list applicable groups per function.
- Provide an optional .group entry in the pinmux machine map
so the map can select beteween different available groups
to be used with a certain function.
- Consequent changes all over the place so that e.g. debugfs
present reasonable information about the world.
- Drop the per-pin mux (*config) function in the pinmux_ops
struct - I was afraid that this would start to be used for
things totally unrelated to muxing, we can introduce that to
the generic struct pinctrl_ops if needed. I want to keep
muxing orthogonal to other pin control subjects and not mix
these things up.
ChangeLog v6->v7:
- Make it possible to have several map entries matching the
same device, pin controller and function, but using
a different group, and alter the semantics so that
pinmux_get() will pick all matching map entries, and
store the associated groups in a list. The list will
then be iterated over at pinmux_enable()/pinmux_disable()
and corresponding driver functions called for each
defined group. Notice that you're only allowed to map
multiple *groups* to the same
{ device, pin controller, function } triplet, attempts
to map the same device to multiple pin controllers will
for example fail. This is hopefully the crucial feature
requested by Stephen Warren.
- Add a pinmux hogging field to the pinmux mapping entries,
and enable the pinmux core to hog pinmux map entries.
This currently only works for pinmuxes without assigned
devices as it looks now, but with device trees we can
look up the corresponding struct device * entries when
we register the pinmux driver, and have it hog each
pinmux map in turn, for a simple approach to
non-dynamic pin muxing. This addresses an issue from
Grant Likely that the machine should take care of as
much of the pinmux setup as possible, not the devices.
By supplying a list of hogs, it can now instruct the
core to take care of any static mappings.
- Switch pinmux group retrieveal function to grab an
array of strings representing the groups rather than an
array of unsigned and rewrite accordingly.
- Alter debugfs to show the grouplist handled by each
pinmux. Also add a list of hogs.
- Dynamically allocate a struct pinmux at pinmux_get() and
free it at pinmux_put(), then add these to the global
list of pinmuxes active as we go along.
- Go over the list of pinmux maps at pinmux_get() time
and repeatedly apply matches.
- Retrieve applicable groups per function from the driver
as a string array rather than a unsigned array, then
lookup the enumerators.
- Make the device to pinmux map a singleton - only allow the
mapping table to be registered once and even tag the
registration function with __init so it surely won't be
abused.
- Create a separate debugfs file to view the pinmux map at
runtime.
- Introduce a spin lock to the pin descriptor struct, lock it
when modifying pin status entries. Reported by Stijn Devriendt.
- Fix up the documentation after review from Stephen Warren.
- Let the GPIO ranges give names as const char * instead of some
fixed-length string.
- add a function to unregister GPIO ranges to mirror the
registration function.
- Privatized the struct pinctrl_device and removed it from the
<linux/pinctrl/pinctrl.h> API, the drivers do not need to know
the members of this struct. It is now in the local header
"core.h".
- Rename the concept of "anonymous" mux maps to "system" muxes
and add convenience macros and documentation.
ChangeLog v7->v8:
- Delete the leftover pinmux_config() function from the
<linux/pinctrl/pinmux.h> header.
- Fix a race condition found by Stijn Devriendt in pin_request()
ChangeLog v8->v9:
- Drop the bus_type and the sysfs attributes and all, we're not on
the clear about how this should be used for e.g. userspace
interfaces so let us save this for the future.
- Use the right name in MAINTAINERS, PIN CONTROL rather than
PINMUX
- Don't kfree() the device state holder, let the .remove() callback
handle this.
- Fix up numerous kerneldoc headers to have one line for the function
description and more verbose documentation below the parameters
ChangeLog v9->v10:
- pinctrl: EXPORT_SYMBOL needs export.h, folded in a patch
from Steven Rothwell
- fix pinctrl_register error handling, folded in a patch from
Axel Lin
- Various fixes to documentation text so that it's consistent.
- Removed pointless comment from drivers/Kconfig
- Removed dependency on SYSFS since we removed the bus in
v9.
- Renamed hopelessly abbreviated pctldev_* functions to the
more verbose pinctrl_dev_*
- Drop mutex properly when looking up GPIO ranges
- Return NULL instead of ERR_PTR() errors on registration of
pin controllers, using cast pointers is fragile. We can
live without the detailed error codes for sure.
Cc: Stijn Devriendt <highguy@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-05-03 02:50:54 +08:00
|
|
|
|
2017-10-06 13:08:05 +08:00
|
|
|
if PINCTRL
|
2011-11-06 04:28:46 +08:00
|
|
|
|
2016-12-30 22:04:43 +08:00
|
|
|
config GENERIC_PINCTRL_GROUPS
|
2016-12-28 01:20:00 +08:00
|
|
|
bool
|
|
|
|
|
drivers: create a pin control subsystem
This creates a subsystem for handling of pin control devices.
These are devices that control different aspects of package
pins.
Currently it handles pinmuxing, i.e. assigning electronic
functions to groups of pins on primarily PGA and BGA type of
chip packages which are common in embedded systems.
The plan is to also handle other I/O pin control aspects
such as biasing, driving, input properties such as
schmitt-triggering, load capacitance etc within this
subsystem, to remove a lot of ARM arch code as well as
feature-creepy GPIO drivers which are implementing the same
thing over and over again.
This is being done to depopulate the arch/arm/* directory
of such custom drivers and try to abstract the infrastructure
they all need. See the Documentation/pinctrl.txt file that is
part of this patch for more details.
ChangeLog v1->v2:
- Various minor fixes from Joe's and Stephens review comments
- Added a pinmux_config() that can invoke custom configuration
with arbitrary data passed in or out to/from the pinmux driver
ChangeLog v2->v3:
- Renamed subsystem folder to "pinctrl" since we will likely
want to keep other pin control such as biasing in this
subsystem too, so let us keep to something generic even though
we're mainly doing pinmux now.
- As a consequence, register pins as an abstract entity separate
from the pinmux. The muxing functions will claim pins out of the
pin pool and make sure they do not collide. Pins can now be
named by the pinctrl core.
- Converted the pin lookup from a static array into a radix tree,
I agreed with Grant Likely to try to avoid any static allocation
(which is crap for device tree stuff) so I just rewrote this
to be dynamic, just like irq number descriptors. The
platform-wide definition of number of pins goes away - this is
now just the sum total of the pins registered to the subsystem.
- Make sure mappings with only a function name and no device
works properly.
ChangeLog v3->v4:
- Define a number space per controller instead of globally,
Stephen and Grant requested the same thing so now maps need to
define target controller, and the radix tree of pin descriptors
is a property on each pin controller device.
- Add a compulsory pinctrl device entry to the pinctrl mapping
table. This must match the pinctrl device, like "pinctrl.0"
- Split the file core.c in two: core.c and pinmux.c where the
latter carry all pinmux stuff, the core is for generic pin
control, and use local headers to access functionality between
files. It is now possible to implement a "blank" pin controller
without pinmux capabilities. This split will make new additions
like pindrive.c, pinbias.c etc possible for combined drivers
and chunks of functionality which is a GoodThing(TM).
- Rewrite the interaction with the GPIO subsystem - the pin
controller descriptor now handles this by defining an offset
into the GPIO numberspace for its handled pin range. This is
used to look up the apropriate pin controller for a GPIO pin.
Then that specific GPIO range is matched 1-1 for the target
controller instance.
- Fixed a number of review comments from Joe Perches.
- Broke out a header file pinctrl.h for the core pin handling
stuff that will be reused by other stuff than pinmux.
- Fixed some erroneous EXPORT() stuff.
- Remove mispatched U300 Kconfig and Makefile entries
- Fixed a number of review comments from Stephen Warren, not all
of them - still WIP. But I think the new mapping that will
specify which function goes to which pin mux controller address
50% of your concerns (else beat me up).
ChangeLog v4->v5:
- Defined a "position" for each function, so the pin controller now
tracks a function in a certain position, and the pinmux maps define
what position you want the function in. (Feedback from Stephen
Warren and Sascha Hauer).
- Since we now need to request a combined function+position from
the machine mapping table that connect mux settings to drivers,
it was extended with a position field and a name field. The
name field is now used if you e.g. need to switch between two
mux map settings at runtime.
- Switched from a class device to using struct bus_type for this
subsystem. Verified sysfs functionality: seems to work fine.
(Feedback from Arnd Bergmann and Greg Kroah-Hartman)
- Define a per pincontroller list of GPIO ranges from the GPIO
pin space that can be handled by the pin controller. These can
be added one by one at runtime. (Feedback from Barry Song)
- Expanded documentation of regulator_[get|enable|disable|put]
semantics.
- Fixed a number of review comments from Barry Song. (Thanks!)
ChangeLog v5->v6:
- Create an abstract pin group concept that can sort pins into
named and enumerated groups no matter what the use of these
groups may be, one possible usecase is a group of pins being
muxed in or so. The intention is however to also use these
groups for other pin control activities.
- Make it compulsory for pinmux functions to associate with
at least one group, so the abstract pin group concept is used
to define the groups of pins affected by a pinmux function.
The pinmux driver interface has been altered so as to enforce
a function to list applicable groups per function.
- Provide an optional .group entry in the pinmux machine map
so the map can select beteween different available groups
to be used with a certain function.
- Consequent changes all over the place so that e.g. debugfs
present reasonable information about the world.
- Drop the per-pin mux (*config) function in the pinmux_ops
struct - I was afraid that this would start to be used for
things totally unrelated to muxing, we can introduce that to
the generic struct pinctrl_ops if needed. I want to keep
muxing orthogonal to other pin control subjects and not mix
these things up.
ChangeLog v6->v7:
- Make it possible to have several map entries matching the
same device, pin controller and function, but using
a different group, and alter the semantics so that
pinmux_get() will pick all matching map entries, and
store the associated groups in a list. The list will
then be iterated over at pinmux_enable()/pinmux_disable()
and corresponding driver functions called for each
defined group. Notice that you're only allowed to map
multiple *groups* to the same
{ device, pin controller, function } triplet, attempts
to map the same device to multiple pin controllers will
for example fail. This is hopefully the crucial feature
requested by Stephen Warren.
- Add a pinmux hogging field to the pinmux mapping entries,
and enable the pinmux core to hog pinmux map entries.
This currently only works for pinmuxes without assigned
devices as it looks now, but with device trees we can
look up the corresponding struct device * entries when
we register the pinmux driver, and have it hog each
pinmux map in turn, for a simple approach to
non-dynamic pin muxing. This addresses an issue from
Grant Likely that the machine should take care of as
much of the pinmux setup as possible, not the devices.
By supplying a list of hogs, it can now instruct the
core to take care of any static mappings.
- Switch pinmux group retrieveal function to grab an
array of strings representing the groups rather than an
array of unsigned and rewrite accordingly.
- Alter debugfs to show the grouplist handled by each
pinmux. Also add a list of hogs.
- Dynamically allocate a struct pinmux at pinmux_get() and
free it at pinmux_put(), then add these to the global
list of pinmuxes active as we go along.
- Go over the list of pinmux maps at pinmux_get() time
and repeatedly apply matches.
- Retrieve applicable groups per function from the driver
as a string array rather than a unsigned array, then
lookup the enumerators.
- Make the device to pinmux map a singleton - only allow the
mapping table to be registered once and even tag the
registration function with __init so it surely won't be
abused.
- Create a separate debugfs file to view the pinmux map at
runtime.
- Introduce a spin lock to the pin descriptor struct, lock it
when modifying pin status entries. Reported by Stijn Devriendt.
- Fix up the documentation after review from Stephen Warren.
- Let the GPIO ranges give names as const char * instead of some
fixed-length string.
- add a function to unregister GPIO ranges to mirror the
registration function.
- Privatized the struct pinctrl_device and removed it from the
<linux/pinctrl/pinctrl.h> API, the drivers do not need to know
the members of this struct. It is now in the local header
"core.h".
- Rename the concept of "anonymous" mux maps to "system" muxes
and add convenience macros and documentation.
ChangeLog v7->v8:
- Delete the leftover pinmux_config() function from the
<linux/pinctrl/pinmux.h> header.
- Fix a race condition found by Stijn Devriendt in pin_request()
ChangeLog v8->v9:
- Drop the bus_type and the sysfs attributes and all, we're not on
the clear about how this should be used for e.g. userspace
interfaces so let us save this for the future.
- Use the right name in MAINTAINERS, PIN CONTROL rather than
PINMUX
- Don't kfree() the device state holder, let the .remove() callback
handle this.
- Fix up numerous kerneldoc headers to have one line for the function
description and more verbose documentation below the parameters
ChangeLog v9->v10:
- pinctrl: EXPORT_SYMBOL needs export.h, folded in a patch
from Steven Rothwell
- fix pinctrl_register error handling, folded in a patch from
Axel Lin
- Various fixes to documentation text so that it's consistent.
- Removed pointless comment from drivers/Kconfig
- Removed dependency on SYSFS since we removed the bus in
v9.
- Renamed hopelessly abbreviated pctldev_* functions to the
more verbose pinctrl_dev_*
- Drop mutex properly when looking up GPIO ranges
- Return NULL instead of ERR_PTR() errors on registration of
pin controllers, using cast pointers is fragile. We can
live without the detailed error codes for sure.
Cc: Stijn Devriendt <highguy@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-05-03 02:50:54 +08:00
|
|
|
config PINMUX
|
2014-06-03 16:02:36 +08:00
|
|
|
bool "Support pin multiplexing controllers" if COMPILE_TEST
|
pinctrl: add a pin config interface
This add per-pin and per-group pin config interfaces for biasing,
driving and other such electronic properties. The details of passed
configurations are passed in an opaque unsigned long which may be
dereferences to integer types, structs or lists on either side
of the configuration interface.
ChangeLog v1->v2:
- Clear split of terminology: we now have pin controllers, and
those may support two interfaces using vtables: pin
multiplexing and pin configuration.
- Break out pin configuration to its own C file, controllers may
implement only config without mux, and vice versa, so keep each
sub-functionality of pin controllers separate. Introduce
CONFIG_PINCONF in Kconfig.
- Implement some core logic around pin configuration in the
pinconf.c file.
- Remove UNKNOWN config states, these were just surplus baggage.
- Remove FLOAT config state - HIGH_IMPEDANCE should be enough for
everyone.
- PIN_CONFIG_POWER_SOURCE added to handle switching the power
supply for the pin logic between different sources
- Explicit DISABLE config enums to turn schmitt-trigger,
wakeup etc OFF.
- Update documentation to reflect all the recent reasoning.
ChangeLog v2->v3:
- Twist API around to pass around arrays of config tuples instead
of (param, value) pairs everywhere.
- Explicit drive strength semantics for push/pull and similar
drive modes, this shall be the number of drive stages vs
nominal load impedance, which should match the actual
electronics used in push/pull CMOS or TTY totempoles.
- Drop load capacitance configuration - I probably don't know
what I'm doing here so leave it out.
- Drop PIN_CONFIG_INPUT_SCHMITT_OFF, instead the argument zero to
PIN_CONFIG_INPUT_SCHMITT turns schmitt trigger off.
- Drop PIN_CONFIG_NORMAL_POWER_MODE and have a well defined
argument to PIN_CONFIG_LOW_POWER_MODE to get out of it instead.
- Drop PIN_CONFIG_WAKEUP_ENABLE/DISABLE and just use
PIN_CONFIG_WAKEUP with defined value zero to turn wakeup off.
- Add PIN_CONFIG_INPUT_DEBOUNCE for configuring debounce time
on input lines.
- Fix a bug when we tried to configure pins for pin controllers
without pinconf support.
- Initialized debugfs properly so it works.
- Initialize the mutex properly and lock around config tampering
sections.
- Check the return value from get_initial_config() properly.
ChangeLog v3->v4:
- Export the pin_config_get(), pin_config_set() and
pin_config_group() functions.
- Drop the entire concept of just getting initial config and
keeping track of pin states internally, instead ask the pins
what state they are in. Previous idea was plain wrong, if the
device cannot keep track of its state, the driver should do
it.
- Drop the generic configuration layout, it seems this impose
too much restriction on some pin controllers, so let them do
things the way they want and split off support for generic
config as an optional add-on.
ChangeLog v4->v5:
- Introduce two symmetric driver calls for group configuration,
.pin_config_group_[get|set] and corresponding external calls.
- Remove generic semantic meanings of return values from config
calls, these belong in the generic config patch. Just pass the
return value through instead.
- Add a debugfs entry "pinconf-groups" to read status from group
configuration only, also slam in a per-group debug callback in
the pinconf_ops so custom drivers can display something
meaningful for their pins.
- Fix some dangling newline.
- Drop dangling #else clause.
- Update documentation to match the above.
ChangeLog v5->v6:
- Change to using a pin name as parameter for the
[get|set]_config() functions, as suggested by Stephen Warren.
This is more natural as names will be what a developer has
access to in written documentation etc.
ChangeLog v6->v7:
- Refactor out by-pin and by-name get/set functions, only expose
the by-name functions externally, expose the by-pin functions
internally.
- Show supported pin control functionality in the debugfs
pinctrl-devices file.
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-10-20 00:14:33 +08:00
|
|
|
|
2016-12-28 01:20:01 +08:00
|
|
|
config GENERIC_PINMUX_FUNCTIONS
|
|
|
|
bool
|
|
|
|
select PINMUX
|
|
|
|
|
pinctrl: add a pin config interface
This add per-pin and per-group pin config interfaces for biasing,
driving and other such electronic properties. The details of passed
configurations are passed in an opaque unsigned long which may be
dereferences to integer types, structs or lists on either side
of the configuration interface.
ChangeLog v1->v2:
- Clear split of terminology: we now have pin controllers, and
those may support two interfaces using vtables: pin
multiplexing and pin configuration.
- Break out pin configuration to its own C file, controllers may
implement only config without mux, and vice versa, so keep each
sub-functionality of pin controllers separate. Introduce
CONFIG_PINCONF in Kconfig.
- Implement some core logic around pin configuration in the
pinconf.c file.
- Remove UNKNOWN config states, these were just surplus baggage.
- Remove FLOAT config state - HIGH_IMPEDANCE should be enough for
everyone.
- PIN_CONFIG_POWER_SOURCE added to handle switching the power
supply for the pin logic between different sources
- Explicit DISABLE config enums to turn schmitt-trigger,
wakeup etc OFF.
- Update documentation to reflect all the recent reasoning.
ChangeLog v2->v3:
- Twist API around to pass around arrays of config tuples instead
of (param, value) pairs everywhere.
- Explicit drive strength semantics for push/pull and similar
drive modes, this shall be the number of drive stages vs
nominal load impedance, which should match the actual
electronics used in push/pull CMOS or TTY totempoles.
- Drop load capacitance configuration - I probably don't know
what I'm doing here so leave it out.
- Drop PIN_CONFIG_INPUT_SCHMITT_OFF, instead the argument zero to
PIN_CONFIG_INPUT_SCHMITT turns schmitt trigger off.
- Drop PIN_CONFIG_NORMAL_POWER_MODE and have a well defined
argument to PIN_CONFIG_LOW_POWER_MODE to get out of it instead.
- Drop PIN_CONFIG_WAKEUP_ENABLE/DISABLE and just use
PIN_CONFIG_WAKEUP with defined value zero to turn wakeup off.
- Add PIN_CONFIG_INPUT_DEBOUNCE for configuring debounce time
on input lines.
- Fix a bug when we tried to configure pins for pin controllers
without pinconf support.
- Initialized debugfs properly so it works.
- Initialize the mutex properly and lock around config tampering
sections.
- Check the return value from get_initial_config() properly.
ChangeLog v3->v4:
- Export the pin_config_get(), pin_config_set() and
pin_config_group() functions.
- Drop the entire concept of just getting initial config and
keeping track of pin states internally, instead ask the pins
what state they are in. Previous idea was plain wrong, if the
device cannot keep track of its state, the driver should do
it.
- Drop the generic configuration layout, it seems this impose
too much restriction on some pin controllers, so let them do
things the way they want and split off support for generic
config as an optional add-on.
ChangeLog v4->v5:
- Introduce two symmetric driver calls for group configuration,
.pin_config_group_[get|set] and corresponding external calls.
- Remove generic semantic meanings of return values from config
calls, these belong in the generic config patch. Just pass the
return value through instead.
- Add a debugfs entry "pinconf-groups" to read status from group
configuration only, also slam in a per-group debug callback in
the pinconf_ops so custom drivers can display something
meaningful for their pins.
- Fix some dangling newline.
- Drop dangling #else clause.
- Update documentation to match the above.
ChangeLog v5->v6:
- Change to using a pin name as parameter for the
[get|set]_config() functions, as suggested by Stephen Warren.
This is more natural as names will be what a developer has
access to in written documentation etc.
ChangeLog v6->v7:
- Refactor out by-pin and by-name get/set functions, only expose
the by-name functions externally, expose the by-pin functions
internally.
- Show supported pin control functionality in the debugfs
pinctrl-devices file.
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-10-20 00:14:33 +08:00
|
|
|
config PINCONF
|
2014-06-03 16:02:36 +08:00
|
|
|
bool "Support pin configuration controllers" if COMPILE_TEST
|
drivers: create a pin control subsystem
This creates a subsystem for handling of pin control devices.
These are devices that control different aspects of package
pins.
Currently it handles pinmuxing, i.e. assigning electronic
functions to groups of pins on primarily PGA and BGA type of
chip packages which are common in embedded systems.
The plan is to also handle other I/O pin control aspects
such as biasing, driving, input properties such as
schmitt-triggering, load capacitance etc within this
subsystem, to remove a lot of ARM arch code as well as
feature-creepy GPIO drivers which are implementing the same
thing over and over again.
This is being done to depopulate the arch/arm/* directory
of such custom drivers and try to abstract the infrastructure
they all need. See the Documentation/pinctrl.txt file that is
part of this patch for more details.
ChangeLog v1->v2:
- Various minor fixes from Joe's and Stephens review comments
- Added a pinmux_config() that can invoke custom configuration
with arbitrary data passed in or out to/from the pinmux driver
ChangeLog v2->v3:
- Renamed subsystem folder to "pinctrl" since we will likely
want to keep other pin control such as biasing in this
subsystem too, so let us keep to something generic even though
we're mainly doing pinmux now.
- As a consequence, register pins as an abstract entity separate
from the pinmux. The muxing functions will claim pins out of the
pin pool and make sure they do not collide. Pins can now be
named by the pinctrl core.
- Converted the pin lookup from a static array into a radix tree,
I agreed with Grant Likely to try to avoid any static allocation
(which is crap for device tree stuff) so I just rewrote this
to be dynamic, just like irq number descriptors. The
platform-wide definition of number of pins goes away - this is
now just the sum total of the pins registered to the subsystem.
- Make sure mappings with only a function name and no device
works properly.
ChangeLog v3->v4:
- Define a number space per controller instead of globally,
Stephen and Grant requested the same thing so now maps need to
define target controller, and the radix tree of pin descriptors
is a property on each pin controller device.
- Add a compulsory pinctrl device entry to the pinctrl mapping
table. This must match the pinctrl device, like "pinctrl.0"
- Split the file core.c in two: core.c and pinmux.c where the
latter carry all pinmux stuff, the core is for generic pin
control, and use local headers to access functionality between
files. It is now possible to implement a "blank" pin controller
without pinmux capabilities. This split will make new additions
like pindrive.c, pinbias.c etc possible for combined drivers
and chunks of functionality which is a GoodThing(TM).
- Rewrite the interaction with the GPIO subsystem - the pin
controller descriptor now handles this by defining an offset
into the GPIO numberspace for its handled pin range. This is
used to look up the apropriate pin controller for a GPIO pin.
Then that specific GPIO range is matched 1-1 for the target
controller instance.
- Fixed a number of review comments from Joe Perches.
- Broke out a header file pinctrl.h for the core pin handling
stuff that will be reused by other stuff than pinmux.
- Fixed some erroneous EXPORT() stuff.
- Remove mispatched U300 Kconfig and Makefile entries
- Fixed a number of review comments from Stephen Warren, not all
of them - still WIP. But I think the new mapping that will
specify which function goes to which pin mux controller address
50% of your concerns (else beat me up).
ChangeLog v4->v5:
- Defined a "position" for each function, so the pin controller now
tracks a function in a certain position, and the pinmux maps define
what position you want the function in. (Feedback from Stephen
Warren and Sascha Hauer).
- Since we now need to request a combined function+position from
the machine mapping table that connect mux settings to drivers,
it was extended with a position field and a name field. The
name field is now used if you e.g. need to switch between two
mux map settings at runtime.
- Switched from a class device to using struct bus_type for this
subsystem. Verified sysfs functionality: seems to work fine.
(Feedback from Arnd Bergmann and Greg Kroah-Hartman)
- Define a per pincontroller list of GPIO ranges from the GPIO
pin space that can be handled by the pin controller. These can
be added one by one at runtime. (Feedback from Barry Song)
- Expanded documentation of regulator_[get|enable|disable|put]
semantics.
- Fixed a number of review comments from Barry Song. (Thanks!)
ChangeLog v5->v6:
- Create an abstract pin group concept that can sort pins into
named and enumerated groups no matter what the use of these
groups may be, one possible usecase is a group of pins being
muxed in or so. The intention is however to also use these
groups for other pin control activities.
- Make it compulsory for pinmux functions to associate with
at least one group, so the abstract pin group concept is used
to define the groups of pins affected by a pinmux function.
The pinmux driver interface has been altered so as to enforce
a function to list applicable groups per function.
- Provide an optional .group entry in the pinmux machine map
so the map can select beteween different available groups
to be used with a certain function.
- Consequent changes all over the place so that e.g. debugfs
present reasonable information about the world.
- Drop the per-pin mux (*config) function in the pinmux_ops
struct - I was afraid that this would start to be used for
things totally unrelated to muxing, we can introduce that to
the generic struct pinctrl_ops if needed. I want to keep
muxing orthogonal to other pin control subjects and not mix
these things up.
ChangeLog v6->v7:
- Make it possible to have several map entries matching the
same device, pin controller and function, but using
a different group, and alter the semantics so that
pinmux_get() will pick all matching map entries, and
store the associated groups in a list. The list will
then be iterated over at pinmux_enable()/pinmux_disable()
and corresponding driver functions called for each
defined group. Notice that you're only allowed to map
multiple *groups* to the same
{ device, pin controller, function } triplet, attempts
to map the same device to multiple pin controllers will
for example fail. This is hopefully the crucial feature
requested by Stephen Warren.
- Add a pinmux hogging field to the pinmux mapping entries,
and enable the pinmux core to hog pinmux map entries.
This currently only works for pinmuxes without assigned
devices as it looks now, but with device trees we can
look up the corresponding struct device * entries when
we register the pinmux driver, and have it hog each
pinmux map in turn, for a simple approach to
non-dynamic pin muxing. This addresses an issue from
Grant Likely that the machine should take care of as
much of the pinmux setup as possible, not the devices.
By supplying a list of hogs, it can now instruct the
core to take care of any static mappings.
- Switch pinmux group retrieveal function to grab an
array of strings representing the groups rather than an
array of unsigned and rewrite accordingly.
- Alter debugfs to show the grouplist handled by each
pinmux. Also add a list of hogs.
- Dynamically allocate a struct pinmux at pinmux_get() and
free it at pinmux_put(), then add these to the global
list of pinmuxes active as we go along.
- Go over the list of pinmux maps at pinmux_get() time
and repeatedly apply matches.
- Retrieve applicable groups per function from the driver
as a string array rather than a unsigned array, then
lookup the enumerators.
- Make the device to pinmux map a singleton - only allow the
mapping table to be registered once and even tag the
registration function with __init so it surely won't be
abused.
- Create a separate debugfs file to view the pinmux map at
runtime.
- Introduce a spin lock to the pin descriptor struct, lock it
when modifying pin status entries. Reported by Stijn Devriendt.
- Fix up the documentation after review from Stephen Warren.
- Let the GPIO ranges give names as const char * instead of some
fixed-length string.
- add a function to unregister GPIO ranges to mirror the
registration function.
- Privatized the struct pinctrl_device and removed it from the
<linux/pinctrl/pinctrl.h> API, the drivers do not need to know
the members of this struct. It is now in the local header
"core.h".
- Rename the concept of "anonymous" mux maps to "system" muxes
and add convenience macros and documentation.
ChangeLog v7->v8:
- Delete the leftover pinmux_config() function from the
<linux/pinctrl/pinmux.h> header.
- Fix a race condition found by Stijn Devriendt in pin_request()
ChangeLog v8->v9:
- Drop the bus_type and the sysfs attributes and all, we're not on
the clear about how this should be used for e.g. userspace
interfaces so let us save this for the future.
- Use the right name in MAINTAINERS, PIN CONTROL rather than
PINMUX
- Don't kfree() the device state holder, let the .remove() callback
handle this.
- Fix up numerous kerneldoc headers to have one line for the function
description and more verbose documentation below the parameters
ChangeLog v9->v10:
- pinctrl: EXPORT_SYMBOL needs export.h, folded in a patch
from Steven Rothwell
- fix pinctrl_register error handling, folded in a patch from
Axel Lin
- Various fixes to documentation text so that it's consistent.
- Removed pointless comment from drivers/Kconfig
- Removed dependency on SYSFS since we removed the bus in
v9.
- Renamed hopelessly abbreviated pctldev_* functions to the
more verbose pinctrl_dev_*
- Drop mutex properly when looking up GPIO ranges
- Return NULL instead of ERR_PTR() errors on registration of
pin controllers, using cast pointers is fragile. We can
live without the detailed error codes for sure.
Cc: Stijn Devriendt <highguy@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-05-03 02:50:54 +08:00
|
|
|
|
2011-11-25 01:27:15 +08:00
|
|
|
config GENERIC_PINCONF
|
|
|
|
bool
|
|
|
|
select PINCONF
|
|
|
|
|
drivers: create a pin control subsystem
This creates a subsystem for handling of pin control devices.
These are devices that control different aspects of package
pins.
Currently it handles pinmuxing, i.e. assigning electronic
functions to groups of pins on primarily PGA and BGA type of
chip packages which are common in embedded systems.
The plan is to also handle other I/O pin control aspects
such as biasing, driving, input properties such as
schmitt-triggering, load capacitance etc within this
subsystem, to remove a lot of ARM arch code as well as
feature-creepy GPIO drivers which are implementing the same
thing over and over again.
This is being done to depopulate the arch/arm/* directory
of such custom drivers and try to abstract the infrastructure
they all need. See the Documentation/pinctrl.txt file that is
part of this patch for more details.
ChangeLog v1->v2:
- Various minor fixes from Joe's and Stephens review comments
- Added a pinmux_config() that can invoke custom configuration
with arbitrary data passed in or out to/from the pinmux driver
ChangeLog v2->v3:
- Renamed subsystem folder to "pinctrl" since we will likely
want to keep other pin control such as biasing in this
subsystem too, so let us keep to something generic even though
we're mainly doing pinmux now.
- As a consequence, register pins as an abstract entity separate
from the pinmux. The muxing functions will claim pins out of the
pin pool and make sure they do not collide. Pins can now be
named by the pinctrl core.
- Converted the pin lookup from a static array into a radix tree,
I agreed with Grant Likely to try to avoid any static allocation
(which is crap for device tree stuff) so I just rewrote this
to be dynamic, just like irq number descriptors. The
platform-wide definition of number of pins goes away - this is
now just the sum total of the pins registered to the subsystem.
- Make sure mappings with only a function name and no device
works properly.
ChangeLog v3->v4:
- Define a number space per controller instead of globally,
Stephen and Grant requested the same thing so now maps need to
define target controller, and the radix tree of pin descriptors
is a property on each pin controller device.
- Add a compulsory pinctrl device entry to the pinctrl mapping
table. This must match the pinctrl device, like "pinctrl.0"
- Split the file core.c in two: core.c and pinmux.c where the
latter carry all pinmux stuff, the core is for generic pin
control, and use local headers to access functionality between
files. It is now possible to implement a "blank" pin controller
without pinmux capabilities. This split will make new additions
like pindrive.c, pinbias.c etc possible for combined drivers
and chunks of functionality which is a GoodThing(TM).
- Rewrite the interaction with the GPIO subsystem - the pin
controller descriptor now handles this by defining an offset
into the GPIO numberspace for its handled pin range. This is
used to look up the apropriate pin controller for a GPIO pin.
Then that specific GPIO range is matched 1-1 for the target
controller instance.
- Fixed a number of review comments from Joe Perches.
- Broke out a header file pinctrl.h for the core pin handling
stuff that will be reused by other stuff than pinmux.
- Fixed some erroneous EXPORT() stuff.
- Remove mispatched U300 Kconfig and Makefile entries
- Fixed a number of review comments from Stephen Warren, not all
of them - still WIP. But I think the new mapping that will
specify which function goes to which pin mux controller address
50% of your concerns (else beat me up).
ChangeLog v4->v5:
- Defined a "position" for each function, so the pin controller now
tracks a function in a certain position, and the pinmux maps define
what position you want the function in. (Feedback from Stephen
Warren and Sascha Hauer).
- Since we now need to request a combined function+position from
the machine mapping table that connect mux settings to drivers,
it was extended with a position field and a name field. The
name field is now used if you e.g. need to switch between two
mux map settings at runtime.
- Switched from a class device to using struct bus_type for this
subsystem. Verified sysfs functionality: seems to work fine.
(Feedback from Arnd Bergmann and Greg Kroah-Hartman)
- Define a per pincontroller list of GPIO ranges from the GPIO
pin space that can be handled by the pin controller. These can
be added one by one at runtime. (Feedback from Barry Song)
- Expanded documentation of regulator_[get|enable|disable|put]
semantics.
- Fixed a number of review comments from Barry Song. (Thanks!)
ChangeLog v5->v6:
- Create an abstract pin group concept that can sort pins into
named and enumerated groups no matter what the use of these
groups may be, one possible usecase is a group of pins being
muxed in or so. The intention is however to also use these
groups for other pin control activities.
- Make it compulsory for pinmux functions to associate with
at least one group, so the abstract pin group concept is used
to define the groups of pins affected by a pinmux function.
The pinmux driver interface has been altered so as to enforce
a function to list applicable groups per function.
- Provide an optional .group entry in the pinmux machine map
so the map can select beteween different available groups
to be used with a certain function.
- Consequent changes all over the place so that e.g. debugfs
present reasonable information about the world.
- Drop the per-pin mux (*config) function in the pinmux_ops
struct - I was afraid that this would start to be used for
things totally unrelated to muxing, we can introduce that to
the generic struct pinctrl_ops if needed. I want to keep
muxing orthogonal to other pin control subjects and not mix
these things up.
ChangeLog v6->v7:
- Make it possible to have several map entries matching the
same device, pin controller and function, but using
a different group, and alter the semantics so that
pinmux_get() will pick all matching map entries, and
store the associated groups in a list. The list will
then be iterated over at pinmux_enable()/pinmux_disable()
and corresponding driver functions called for each
defined group. Notice that you're only allowed to map
multiple *groups* to the same
{ device, pin controller, function } triplet, attempts
to map the same device to multiple pin controllers will
for example fail. This is hopefully the crucial feature
requested by Stephen Warren.
- Add a pinmux hogging field to the pinmux mapping entries,
and enable the pinmux core to hog pinmux map entries.
This currently only works for pinmuxes without assigned
devices as it looks now, but with device trees we can
look up the corresponding struct device * entries when
we register the pinmux driver, and have it hog each
pinmux map in turn, for a simple approach to
non-dynamic pin muxing. This addresses an issue from
Grant Likely that the machine should take care of as
much of the pinmux setup as possible, not the devices.
By supplying a list of hogs, it can now instruct the
core to take care of any static mappings.
- Switch pinmux group retrieveal function to grab an
array of strings representing the groups rather than an
array of unsigned and rewrite accordingly.
- Alter debugfs to show the grouplist handled by each
pinmux. Also add a list of hogs.
- Dynamically allocate a struct pinmux at pinmux_get() and
free it at pinmux_put(), then add these to the global
list of pinmuxes active as we go along.
- Go over the list of pinmux maps at pinmux_get() time
and repeatedly apply matches.
- Retrieve applicable groups per function from the driver
as a string array rather than a unsigned array, then
lookup the enumerators.
- Make the device to pinmux map a singleton - only allow the
mapping table to be registered once and even tag the
registration function with __init so it surely won't be
abused.
- Create a separate debugfs file to view the pinmux map at
runtime.
- Introduce a spin lock to the pin descriptor struct, lock it
when modifying pin status entries. Reported by Stijn Devriendt.
- Fix up the documentation after review from Stephen Warren.
- Let the GPIO ranges give names as const char * instead of some
fixed-length string.
- add a function to unregister GPIO ranges to mirror the
registration function.
- Privatized the struct pinctrl_device and removed it from the
<linux/pinctrl/pinctrl.h> API, the drivers do not need to know
the members of this struct. It is now in the local header
"core.h".
- Rename the concept of "anonymous" mux maps to "system" muxes
and add convenience macros and documentation.
ChangeLog v7->v8:
- Delete the leftover pinmux_config() function from the
<linux/pinctrl/pinmux.h> header.
- Fix a race condition found by Stijn Devriendt in pin_request()
ChangeLog v8->v9:
- Drop the bus_type and the sysfs attributes and all, we're not on
the clear about how this should be used for e.g. userspace
interfaces so let us save this for the future.
- Use the right name in MAINTAINERS, PIN CONTROL rather than
PINMUX
- Don't kfree() the device state holder, let the .remove() callback
handle this.
- Fix up numerous kerneldoc headers to have one line for the function
description and more verbose documentation below the parameters
ChangeLog v9->v10:
- pinctrl: EXPORT_SYMBOL needs export.h, folded in a patch
from Steven Rothwell
- fix pinctrl_register error handling, folded in a patch from
Axel Lin
- Various fixes to documentation text so that it's consistent.
- Removed pointless comment from drivers/Kconfig
- Removed dependency on SYSFS since we removed the bus in
v9.
- Renamed hopelessly abbreviated pctldev_* functions to the
more verbose pinctrl_dev_*
- Drop mutex properly when looking up GPIO ranges
- Return NULL instead of ERR_PTR() errors on registration of
pin controllers, using cast pointers is fragile. We can
live without the detailed error codes for sure.
Cc: Stijn Devriendt <highguy@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-05-03 02:50:54 +08:00
|
|
|
config DEBUG_PINCTRL
|
|
|
|
bool "Debug PINCTRL calls"
|
|
|
|
depends on DEBUG_KERNEL
|
|
|
|
help
|
|
|
|
Say Y here to add some extra checks and diagnostics to PINCTRL calls.
|
|
|
|
|
2017-04-03 20:47:04 +08:00
|
|
|
config PINCTRL_ARTPEC6
|
2019-11-21 11:19:41 +08:00
|
|
|
bool "Axis ARTPEC-6 pin controller driver"
|
|
|
|
depends on MACH_ARTPEC6
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
This is the driver for the Axis ARTPEC-6 pin controller. This driver
|
|
|
|
supports pin function multiplexing as well as pin bias and drive
|
|
|
|
strength configuration. Device tree integration instructions can be
|
|
|
|
found in Documentation/devicetree/bindings/pinctrl/axis,artpec6-pinctrl.txt
|
2017-04-03 20:47:04 +08:00
|
|
|
|
2013-10-02 23:50:29 +08:00
|
|
|
config PINCTRL_AS3722
|
2016-06-14 05:10:22 +08:00
|
|
|
tristate "Pinctrl and GPIO driver for ams AS3722 PMIC"
|
2013-10-02 23:50:29 +08:00
|
|
|
depends on MFD_AS3722 && GPIOLIB
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
AS3722 device supports the configuration of GPIO pins for different
|
|
|
|
functionality. This driver supports the pinmux, push-pull and
|
|
|
|
open drain configuration for the GPIO pins of AS3722 devices. It also
|
|
|
|
supports the GPIO functionality through gpiolib.
|
|
|
|
|
2017-12-05 22:46:40 +08:00
|
|
|
config PINCTRL_AXP209
|
|
|
|
tristate "X-Powers AXP209 PMIC pinctrl and GPIO Support"
|
|
|
|
depends on MFD_AXP20X
|
2017-12-14 17:43:35 +08:00
|
|
|
depends on OF
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB
|
2017-12-05 22:46:40 +08:00
|
|
|
help
|
|
|
|
AXP PMICs provides multiple GPIOs that can be muxed for different
|
|
|
|
functions. This driver bundles a pinctrl driver to select the function
|
|
|
|
muxing and a GPIO driver to handle the GPIO when the GPIO function is
|
|
|
|
selected.
|
|
|
|
Say yes to enable pinctrl and GPIO support for the AXP209 PMIC
|
|
|
|
|
2012-07-12 23:35:02 +08:00
|
|
|
config PINCTRL_AT91
|
|
|
|
bool "AT91 pinctrl driver"
|
|
|
|
depends on OF
|
|
|
|
depends on ARCH_AT91
|
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
2014-04-16 04:09:41 +08:00
|
|
|
select GPIOLIB
|
|
|
|
select OF_GPIO
|
|
|
|
select GPIOLIB_IRQCHIP
|
2012-07-12 23:35:02 +08:00
|
|
|
help
|
|
|
|
Say Y here to enable the at91 pinctrl driver
|
|
|
|
|
2015-09-16 23:36:57 +08:00
|
|
|
config PINCTRL_AT91PIO4
|
|
|
|
bool "AT91 PIO4 pinctrl driver"
|
|
|
|
depends on OF
|
2020-11-24 17:17:03 +08:00
|
|
|
depends on HAS_IOMEM
|
2020-05-23 19:45:26 +08:00
|
|
|
depends on ARCH_AT91 || COMPILE_TEST
|
2015-09-16 23:36:57 +08:00
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select OF_GPIO
|
|
|
|
help
|
|
|
|
Say Y here to enable the at91 pinctrl/gpio driver for Atmel PIO4
|
|
|
|
controller available on sama5d2 SoC.
|
|
|
|
|
2015-03-10 15:02:19 +08:00
|
|
|
config PINCTRL_AMD
|
2016-02-11 19:06:37 +08:00
|
|
|
tristate "AMD GPIO pin control"
|
2017-11-13 18:04:27 +08:00
|
|
|
depends on HAS_IOMEM
|
2020-05-07 19:37:51 +08:00
|
|
|
depends on ACPI || COMPILE_TEST
|
2017-10-11 18:04:35 +08:00
|
|
|
select GPIOLIB
|
2015-03-10 15:02:19 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2017-09-26 21:51:28 +08:00
|
|
|
select PINMUX
|
2015-03-10 15:02:19 +08:00
|
|
|
select PINCONF
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
driver for memory mapped GPIO functionality on AMD platforms
|
|
|
|
(x86 or arm).Most pins are usually muxed to some other
|
|
|
|
functionality by firmware,so only a small amount is available
|
|
|
|
for gpio use.
|
|
|
|
|
|
|
|
Requires ACPI/FDT device enumeration code to set up a platform
|
|
|
|
device.
|
|
|
|
|
2019-04-24 20:02:23 +08:00
|
|
|
config PINCTRL_BM1880
|
|
|
|
bool "Bitmain BM1880 Pinctrl driver"
|
2019-04-25 16:32:24 +08:00
|
|
|
depends on OF && (ARCH_BITMAIN || COMPILE_TEST)
|
|
|
|
default ARCH_BITMAIN
|
2019-04-24 20:02:23 +08:00
|
|
|
select PINMUX
|
|
|
|
help
|
|
|
|
Pinctrl driver for Bitmain BM1880 SoC.
|
|
|
|
|
2016-11-29 00:40:25 +08:00
|
|
|
config PINCTRL_DA850_PUPD
|
|
|
|
tristate "TI DA850/OMAP-L138/AM18XX pullup/pulldown groups"
|
|
|
|
depends on OF && (ARCH_DAVINCI_DA850 || COMPILE_TEST)
|
|
|
|
select PINCONF
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
Driver for TI DA850/OMAP-L138/AM18XX pinconf. Used to control
|
|
|
|
pullup/pulldown pin groups.
|
|
|
|
|
2020-01-08 18:47:46 +08:00
|
|
|
config PINCTRL_DA9062
|
|
|
|
tristate "Dialog Semiconductor DA9062 PMIC pinctrl and GPIO Support"
|
|
|
|
depends on MFD_DA9062
|
|
|
|
select GPIOLIB
|
|
|
|
help
|
|
|
|
The Dialog DA9062 PMIC provides multiple GPIOs that can be muxed for
|
|
|
|
different functions. This driver bundles a pinctrl driver to select the
|
|
|
|
function muxing and a GPIO driver to handle the GPIO when the GPIO
|
|
|
|
function is selected.
|
|
|
|
|
|
|
|
Say yes to enable pinctrl and GPIO support for the DA9062 PMIC.
|
|
|
|
|
2015-05-05 18:55:10 +08:00
|
|
|
config PINCTRL_DIGICOLOR
|
|
|
|
bool
|
|
|
|
depends on OF && (ARCH_DIGICOLOR || COMPILE_TEST)
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
|
2012-08-28 18:44:59 +08:00
|
|
|
config PINCTRL_LANTIQ
|
|
|
|
bool
|
|
|
|
depends on LANTIQ
|
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
|
|
|
|
2015-04-28 06:14:08 +08:00
|
|
|
config PINCTRL_LPC18XX
|
|
|
|
bool "NXP LPC18XX/43XX SCU pinctrl driver"
|
|
|
|
depends on OF && (ARCH_LPC18XX || COMPILE_TEST)
|
|
|
|
default ARCH_LPC18XX
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
Pinctrl driver for NXP LPC18xx/43xx System Control Unit (SCU).
|
|
|
|
|
2012-05-20 06:33:56 +08:00
|
|
|
config PINCTRL_FALCON
|
|
|
|
bool
|
|
|
|
depends on SOC_FALCON
|
|
|
|
depends on PINCTRL_LANTIQ
|
|
|
|
|
2017-08-06 05:04:08 +08:00
|
|
|
config PINCTRL_GEMINI
|
|
|
|
bool
|
|
|
|
depends on ARCH_GEMINI
|
|
|
|
default ARCH_GEMINI
|
|
|
|
select PINMUX
|
2017-10-28 21:37:18 +08:00
|
|
|
select GENERIC_PINCONF
|
2017-08-06 05:04:08 +08:00
|
|
|
select MFD_SYSCON
|
|
|
|
|
2020-04-08 01:38:49 +08:00
|
|
|
config PINCTRL_MCP23S08_I2C
|
|
|
|
tristate
|
|
|
|
select REGMAP_I2C
|
|
|
|
|
|
|
|
config PINCTRL_MCP23S08_SPI
|
|
|
|
tristate
|
|
|
|
select REGMAP_SPI
|
|
|
|
|
2017-05-15 17:24:25 +08:00
|
|
|
config PINCTRL_MCP23S08
|
|
|
|
tristate "Microchip MCP23xxx I/O expander"
|
|
|
|
depends on SPI_MASTER || I2C
|
2017-10-11 18:04:35 +08:00
|
|
|
select GPIOLIB
|
2017-05-15 17:24:25 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2017-05-15 17:24:26 +08:00
|
|
|
select GENERIC_PINCONF
|
2020-04-08 01:38:49 +08:00
|
|
|
select PINCTRL_MCP23S08_I2C if I2C
|
|
|
|
select PINCTRL_MCP23S08_SPI if SPI_MASTER
|
2017-05-15 17:24:25 +08:00
|
|
|
help
|
2018-02-15 22:56:03 +08:00
|
|
|
SPI/I2C driver for Microchip MCP23S08 / MCP23S17 / MCP23S18 /
|
|
|
|
MCP23008 / MCP23017 / MCP23018 I/O expanders.
|
|
|
|
This provides a GPIO interface supporting inputs and outputs and a
|
|
|
|
corresponding interrupt-controller.
|
2017-05-15 17:24:25 +08:00
|
|
|
|
2016-05-11 15:34:21 +08:00
|
|
|
config PINCTRL_OXNAS
|
|
|
|
bool
|
|
|
|
depends on OF
|
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB
|
|
|
|
select OF_GPIO
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select MFD_SYSCON
|
|
|
|
|
2013-06-11 04:16:22 +08:00
|
|
|
config PINCTRL_ROCKCHIP
|
2021-03-05 08:39:07 +08:00
|
|
|
tristate "Rockchip gpio and pinctrl driver"
|
2021-03-16 21:40:59 +08:00
|
|
|
depends on ARCH_ROCKCHIP || COMPILE_TEST
|
2020-09-06 05:49:55 +08:00
|
|
|
depends on OF
|
2021-03-05 08:39:06 +08:00
|
|
|
select GPIOLIB
|
2013-06-11 04:16:22 +08:00
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_IRQ_CHIP
|
2014-05-05 19:58:20 +08:00
|
|
|
select MFD_SYSCON
|
2020-09-06 05:49:55 +08:00
|
|
|
select OF_GPIO
|
2021-03-05 08:39:06 +08:00
|
|
|
default ARCH_ROCKCHIP
|
|
|
|
help
|
|
|
|
This support pinctrl and gpio driver for Rockchip SoCs.
|
2013-06-11 04:16:22 +08:00
|
|
|
|
2012-07-10 17:05:46 +08:00
|
|
|
config PINCTRL_SINGLE
|
|
|
|
tristate "One-register-per-pin type device tree based pinctrl driver"
|
|
|
|
depends on OF
|
2017-11-13 18:04:27 +08:00
|
|
|
depends on HAS_IOMEM
|
2016-12-28 01:20:02 +08:00
|
|
|
select GENERIC_PINCTRL_GROUPS
|
2016-12-28 01:20:03 +08:00
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
2013-02-17 19:42:55 +08:00
|
|
|
select GENERIC_PINCONF
|
2012-07-10 17:05:46 +08:00
|
|
|
help
|
|
|
|
This selects the device tree based generic pinctrl driver.
|
|
|
|
|
2016-10-21 17:09:58 +08:00
|
|
|
config PINCTRL_SX150X
|
|
|
|
bool "Semtech SX150x I2C GPIO expander pinctrl driver"
|
2017-10-11 18:04:35 +08:00
|
|
|
depends on I2C=y
|
2016-10-21 17:09:58 +08:00
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
|
|
|
select GENERIC_PINCONF
|
2017-10-11 18:04:35 +08:00
|
|
|
select GPIOLIB
|
2016-10-21 17:09:58 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2016-11-08 00:53:16 +08:00
|
|
|
select REGMAP
|
2016-10-21 17:09:58 +08:00
|
|
|
help
|
|
|
|
Say yes here to provide support for Semtech SX150x-series I2C
|
|
|
|
GPIO expanders as pinctrl module.
|
|
|
|
Compatible models include:
|
|
|
|
- 8 bits: sx1508q, sx1502q
|
|
|
|
- 16 bits: sx1509q, sx1506q
|
|
|
|
|
2015-05-07 03:59:03 +08:00
|
|
|
config PINCTRL_PISTACHIO
|
2021-07-21 11:01:31 +08:00
|
|
|
bool "IMG Pistachio SoC pinctrl driver"
|
|
|
|
depends on OF && (MIPS || COMPILE_TEST)
|
2015-05-07 03:59:03 +08:00
|
|
|
depends on GPIOLIB
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select OF_GPIO
|
2021-07-21 11:01:31 +08:00
|
|
|
help
|
|
|
|
This support pinctrl and gpio driver for IMG Pistachio SoC.
|
2015-05-07 03:59:03 +08:00
|
|
|
|
2013-06-20 22:05:38 +08:00
|
|
|
config PINCTRL_ST
|
|
|
|
bool
|
|
|
|
depends on OF
|
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
2014-04-08 20:45:47 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2013-06-20 22:05:38 +08:00
|
|
|
|
2019-05-09 16:58:51 +08:00
|
|
|
config PINCTRL_STMFX
|
|
|
|
tristate "STMicroelectronics STMFX GPIO expander pinctrl driver"
|
2019-05-10 21:39:18 +08:00
|
|
|
depends on I2C
|
2019-05-24 15:32:05 +08:00
|
|
|
depends on OF_GPIO
|
2019-05-09 16:58:51 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select MFD_STMFX
|
|
|
|
help
|
|
|
|
Driver for STMicroelectronics Multi-Function eXpander (STMFX)
|
|
|
|
GPIO expander.
|
|
|
|
This provides a GPIO interface supporting inputs and outputs,
|
|
|
|
and configuring push-pull, open-drain, and can also be used as
|
|
|
|
interrupt-controller.
|
|
|
|
|
2016-05-13 13:19:15 +08:00
|
|
|
config PINCTRL_MAX77620
|
|
|
|
tristate "MAX77620/MAX20024 Pincontrol support"
|
2016-10-28 16:19:05 +08:00
|
|
|
depends on MFD_MAX77620 && OF
|
2016-06-13 23:18:35 +08:00
|
|
|
select PINMUX
|
2016-05-13 13:19:15 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
Say Yes here to enable Pin control support for Maxim PMIC MAX77620.
|
|
|
|
This PMIC has 8 GPIO pins that work as GPIO as well as special
|
|
|
|
function in alternate mode. This driver also configure push-pull,
|
|
|
|
open drain, FPS slots etc.
|
|
|
|
|
2013-08-06 21:12:35 +08:00
|
|
|
config PINCTRL_PALMAS
|
2016-06-14 05:10:21 +08:00
|
|
|
tristate "Pinctrl driver for the PALMAS Series MFD devices"
|
2013-08-06 21:12:35 +08:00
|
|
|
depends on OF && MFD_PALMAS
|
2013-08-22 14:30:08 +08:00
|
|
|
select PINMUX
|
2013-08-06 21:12:35 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
Palmas device supports the configuration of pins for different
|
|
|
|
functionality. This driver supports the pinmux, push-pull and
|
|
|
|
open drain configuration for the Palmas series devices like
|
|
|
|
TPS65913, TPS80036 etc.
|
|
|
|
|
2016-02-02 06:48:30 +08:00
|
|
|
config PINCTRL_PIC32
|
|
|
|
bool "Microchip PIC32 pin controller driver"
|
|
|
|
depends on OF
|
|
|
|
depends on MACH_PIC32
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select OF_GPIO
|
|
|
|
help
|
|
|
|
This is the pin controller and gpio driver for Microchip PIC32
|
|
|
|
microcontrollers. This option is selected automatically when specific
|
|
|
|
machine and arch are selected to build.
|
|
|
|
|
|
|
|
config PINCTRL_PIC32MZDA
|
|
|
|
def_bool y if PIC32MZDA
|
|
|
|
select PINCTRL_PIC32
|
|
|
|
|
2015-01-09 23:43:48 +08:00
|
|
|
config PINCTRL_ZYNQ
|
|
|
|
bool "Pinctrl driver for Xilinx Zynq"
|
|
|
|
depends on ARCH_ZYNQ
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
2015-11-30 15:57:35 +08:00
|
|
|
This selects the pinctrl driver for Xilinx Zynq.
|
2015-01-09 23:43:48 +08:00
|
|
|
|
2021-04-22 16:30:02 +08:00
|
|
|
config PINCTRL_ZYNQMP
|
|
|
|
tristate "Pinctrl driver for Xilinx ZynqMP"
|
|
|
|
depends on ZYNQMP_FIRMWARE
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
default ZYNQMP_FIRMWARE
|
|
|
|
help
|
|
|
|
This selects the pinctrl driver for Xilinx ZynqMP platform.
|
|
|
|
This driver will query the pin information from the firmware
|
|
|
|
and allow configuring the pins.
|
|
|
|
Configuration can include the mux function to select on those
|
|
|
|
pin(s)/group(s), and various pin configuration parameters
|
|
|
|
such as pull-up, slew rate, etc.
|
2021-06-21 19:00:14 +08:00
|
|
|
This driver can also be built as a module. If so, the module
|
|
|
|
will be called pinctrl-zynqmp.
|
2021-04-22 16:30:02 +08:00
|
|
|
|
2017-05-13 00:52:56 +08:00
|
|
|
config PINCTRL_INGENIC
|
|
|
|
bool "Pinctrl driver for the Ingenic JZ47xx SoCs"
|
2018-08-22 00:42:35 +08:00
|
|
|
default MACH_INGENIC
|
2017-05-29 19:40:45 +08:00
|
|
|
depends on OF
|
2018-08-22 00:42:35 +08:00
|
|
|
depends on MIPS || COMPILE_TEST
|
2017-05-13 00:52:56 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_PINCTRL_GROUPS
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
2018-08-22 00:42:32 +08:00
|
|
|
select GPIOLIB
|
|
|
|
select GPIOLIB_IRQCHIP
|
2017-05-13 00:52:56 +08:00
|
|
|
select REGMAP_MMIO
|
|
|
|
|
2017-08-21 09:28:40 +08:00
|
|
|
config PINCTRL_RK805
|
|
|
|
tristate "Pinctrl and GPIO driver for RK805 PMIC"
|
|
|
|
depends on MFD_RK808
|
|
|
|
select GPIOLIB
|
|
|
|
select PINMUX
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
help
|
|
|
|
This selects the pinctrl driver for RK805.
|
|
|
|
|
2018-01-06 08:09:26 +08:00
|
|
|
config PINCTRL_OCELOT
|
2018-12-20 22:44:31 +08:00
|
|
|
bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
|
2018-01-06 08:09:26 +08:00
|
|
|
depends on OF
|
2018-12-22 18:15:04 +08:00
|
|
|
depends on HAS_IOMEM
|
2018-01-06 08:09:26 +08:00
|
|
|
select GPIOLIB
|
2018-07-25 20:26:21 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2018-01-06 08:09:26 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_PINCTRL_GROUPS
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
2018-12-20 22:44:31 +08:00
|
|
|
select OF_GPIO
|
2018-01-06 08:09:26 +08:00
|
|
|
select REGMAP_MMIO
|
|
|
|
|
2020-11-13 22:51:50 +08:00
|
|
|
config PINCTRL_MICROCHIP_SGPIO
|
|
|
|
bool "Pinctrl driver for Microsemi/Microchip Serial GPIO"
|
2020-11-25 20:20:14 +08:00
|
|
|
depends on OF
|
2020-11-13 22:51:50 +08:00
|
|
|
depends on HAS_IOMEM
|
|
|
|
select GPIOLIB
|
2020-12-09 22:27:51 +08:00
|
|
|
select GPIOLIB_IRQCHIP
|
2020-11-13 22:51:50 +08:00
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_PINCTRL_GROUPS
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
2020-11-25 20:20:14 +08:00
|
|
|
select OF_GPIO
|
2020-11-13 22:51:50 +08:00
|
|
|
help
|
|
|
|
Support for the serial GPIO interface used on Microsemi and
|
|
|
|
Microchip SoC's. By using a serial interface, the SIO
|
|
|
|
controller significantly extends the number of available
|
|
|
|
GPIOs with a minimum number of additional pins on the
|
|
|
|
device. The primary purpose of the SIO controller is to
|
|
|
|
connect control signals from SFP modules and to act as an
|
|
|
|
LED controller.
|
|
|
|
|
2021-01-12 08:58:40 +08:00
|
|
|
config PINCTRL_K210
|
|
|
|
bool "Pinctrl driver for the Canaan Kendryte K210 SoC"
|
|
|
|
depends on RISCV && SOC_CANAAN && OF
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GPIOLIB
|
|
|
|
select OF_GPIO
|
|
|
|
select REGMAP_MMIO
|
|
|
|
default SOC_CANAAN
|
|
|
|
help
|
|
|
|
Add support for the Canaan Kendryte K210 RISC-V SOC Field
|
|
|
|
Programmable IO Array (FPIOA) controller.
|
|
|
|
|
2021-08-06 22:25:27 +08:00
|
|
|
config PINCTRL_KEEMBAY
|
|
|
|
tristate "Pinctrl driver for Intel Keem Bay SoC"
|
|
|
|
depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST)
|
|
|
|
depends on HAS_IOMEM
|
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_PINCTRL_GROUPS
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
|
|
|
select GPIOLIB
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select GPIO_GENERIC
|
|
|
|
help
|
|
|
|
This selects pin control driver for the Intel Keembay SoC.
|
|
|
|
It provides pin config functions such as pullup, pulldown,
|
|
|
|
interrupt, drive strength, sec lock, schmitt trigger, slew
|
|
|
|
rate control and direction control. This module will be
|
|
|
|
called as pinctrl-keembay.
|
|
|
|
|
2018-04-05 01:22:52 +08:00
|
|
|
source "drivers/pinctrl/actions/Kconfig"
|
2016-08-30 15:54:24 +08:00
|
|
|
source "drivers/pinctrl/aspeed/Kconfig"
|
2015-03-05 08:35:49 +08:00
|
|
|
source "drivers/pinctrl/bcm/Kconfig"
|
2014-05-20 01:36:29 +08:00
|
|
|
source "drivers/pinctrl/berlin/Kconfig"
|
2014-09-03 19:37:38 +08:00
|
|
|
source "drivers/pinctrl/freescale/Kconfig"
|
2014-10-24 20:16:52 +08:00
|
|
|
source "drivers/pinctrl/intel/Kconfig"
|
2012-10-25 05:38:58 +08:00
|
|
|
source "drivers/pinctrl/mvebu/Kconfig"
|
2014-07-11 20:57:06 +08:00
|
|
|
source "drivers/pinctrl/nomadik/Kconfig"
|
2018-08-08 17:25:26 +08:00
|
|
|
source "drivers/pinctrl/nuvoton/Kconfig"
|
2015-11-22 02:04:53 +08:00
|
|
|
source "drivers/pinctrl/pxa/Kconfig"
|
2014-07-09 19:55:12 +08:00
|
|
|
source "drivers/pinctrl/qcom/Kconfig"
|
2020-12-08 15:55:23 +08:00
|
|
|
source "drivers/pinctrl/ralink/Kconfig"
|
2020-09-09 21:15:33 +08:00
|
|
|
source "drivers/pinctrl/renesas/Kconfig"
|
2014-07-10 20:03:27 +08:00
|
|
|
source "drivers/pinctrl/samsung/Kconfig"
|
2012-03-29 00:57:07 +08:00
|
|
|
source "drivers/pinctrl/spear/Kconfig"
|
2017-08-17 14:50:38 +08:00
|
|
|
source "drivers/pinctrl/sprd/Kconfig"
|
2016-01-14 20:16:30 +08:00
|
|
|
source "drivers/pinctrl/stm32/Kconfig"
|
2014-04-19 00:53:02 +08:00
|
|
|
source "drivers/pinctrl/sunxi/Kconfig"
|
2016-01-23 23:30:08 +08:00
|
|
|
source "drivers/pinctrl/tegra/Kconfig"
|
pinctrl: Introduce TI IOdelay configuration driver
SoC family such as DRA7 family of processors have, in addition
to the regular muxing of pins (as done by pinctrl-single), a separate
hardware module called IODelay which is also expected to be configured.
The "IODelay" module has it's own register space that is independent
of the control module and the padconf register area.
With recent changes to the pinctrl framework, we can now support
this hardware with a reasonably minimal driver by using #pinctrl-cells,
GENERIC_PINCTRL_GROUPS and GENERIC_PINMUX_FUNCTIONS.
It is advocated strongly in TI's official documentation considering
the existing design of the DRA7 family of processors during mux or
IODelay reconfiguration, there is a potential for a significant glitch
which may cause functional impairment to certain hardware. It is
hence recommended to do as little of muxing as absolutely necessary
without I/O isolation (which can only be done in initial stages of
bootloader).
NOTE: with the system wide I/O isolation scheme present in DRA7 SoC
family, it is not reasonable to do stop all I/O operations for every
such pad configuration scheme. So, we will let it glitch when used in
this mode.
Even with the above limitation, certain functionality such as MMC has
mandatory need for IODelay reconfiguration requirements, depending on
speed of transfer. In these cases, with careful examination of usecase
involved, the expected glitch can be controlled such that it does not
impact functionality.
In short, IODelay module support as a padconf driver being introduced
here is not expected to do SoC wide I/O Isolation and is meant for
a limited subset of IODelay configuration requirements that need to
be dynamic and whose glitchy behavior will not cause functionality
failure for that interface.
IMPORTANT NOTE: we take the approach of keeping LOCK_BITs cleared
to 0x0 at all times, even when configuring Manual IO Timing Modes.
This is done by eliminating the LOCK_BIT=1 setting from Step
of the Manual IO timing Mode configuration procedure. This option
leaves the CFG_* registers unprotected from unintended writes to the
CTRL_CORE_PAD_* registers while Manual IO Timing Modes are configured.
This approach is taken to allow for a generic driver to exist in kernel
world that has to be used carefully in required usecases.
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
[tony@atomide.com: updated to use generic pinctrl functions, added
binding documentation, updated comments]
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-01-06 02:54:14 +08:00
|
|
|
source "drivers/pinctrl/ti/Kconfig"
|
2015-07-14 10:40:01 +08:00
|
|
|
source "drivers/pinctrl/uniphier/Kconfig"
|
2013-02-20 04:32:19 +08:00
|
|
|
source "drivers/pinctrl/vt8500/Kconfig"
|
2015-01-21 13:28:15 +08:00
|
|
|
source "drivers/pinctrl/mediatek/Kconfig"
|
2017-10-12 20:40:25 +08:00
|
|
|
source "drivers/pinctrl/meson/Kconfig"
|
2018-05-21 18:00:01 +08:00
|
|
|
source "drivers/pinctrl/cirrus/Kconfig"
|
2020-09-10 04:43:30 +08:00
|
|
|
source "drivers/pinctrl/visconti/Kconfig"
|
2012-03-29 00:57:07 +08:00
|
|
|
|
2012-08-28 18:44:59 +08:00
|
|
|
config PINCTRL_XWAY
|
|
|
|
bool
|
|
|
|
depends on SOC_TYPE_XWAY
|
|
|
|
depends on PINCTRL_LANTIQ
|
|
|
|
|
2013-10-15 21:39:38 +08:00
|
|
|
config PINCTRL_TB10X
|
|
|
|
bool
|
2015-04-15 16:00:35 +08:00
|
|
|
depends on OF && ARC_PLAT_TB10X
|
|
|
|
select GPIOLIB
|
2013-10-15 21:39:38 +08:00
|
|
|
|
2019-11-15 17:25:07 +08:00
|
|
|
config PINCTRL_EQUILIBRIUM
|
|
|
|
tristate "Generic pinctrl and GPIO driver for Intel Lightning Mountain SoC"
|
2019-12-11 00:44:46 +08:00
|
|
|
depends on OF && HAS_IOMEM
|
2020-05-07 19:36:25 +08:00
|
|
|
depends on X86 || COMPILE_TEST
|
2019-11-15 17:25:07 +08:00
|
|
|
select PINMUX
|
|
|
|
select PINCONF
|
|
|
|
select GPIOLIB
|
|
|
|
select GPIO_GENERIC
|
|
|
|
select GPIOLIB_IRQCHIP
|
|
|
|
select GENERIC_PINCONF
|
|
|
|
select GENERIC_PINCTRL_GROUPS
|
|
|
|
select GENERIC_PINMUX_FUNCTIONS
|
|
|
|
|
|
|
|
help
|
|
|
|
Equilibrium pinctrl driver is a pinctrl & GPIO driver for Intel Lightning
|
|
|
|
Mountain network processor SoC that supports both the linux GPIO and pin
|
|
|
|
control frameworks. It provides interfaces to setup pinmux, assign desired
|
|
|
|
pin functions, configure GPIO attributes for LGM SoC pins. Pinmux and
|
|
|
|
pinconf settings are retrieved from device tree.
|
|
|
|
|
2017-10-06 13:08:05 +08:00
|
|
|
endif
|