summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/core.h
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-03-05 17:22:15 -0700
committerLinus Walleij <linus.walleij@linaro.org>2012-03-12 22:43:09 +0100
commit652162d469a73450a66b6c8049b16c2b7828fa24 (patch)
tree4df09c6e5e370a4bd73569503d1a124599871db5 /drivers/pinctrl/core.h
parenta6c3b33f02c799db69a3cd82545e45e9df3d69ca (diff)
downloadlinux-652162d469a73450a66b6c8049b16c2b7828fa24.tar.bz2
pinctrl: allow concurrent gpio and mux function ownership of pins
Per recent updates to Documentation/gpio.txt, gpiolib drivers should inform pinctrl when a GPIO is requested. pinctrl then marks that pin as in-use for that GPIO function. When an SoC muxes pins in a group, it's quite possible for the group to contain e.g. 6 pins, but only 4 of them actually be needed by the HW module that's mux'd to them. In this case, the other 2 pins could be used as GPIOs. However, pinctrl marks all the pins within the group as in-use by the selected mux function. To allow the expected gpiolib interaction, separate the concepts of pin ownership into two parts: One for the mux function and one for GPIO usage. Finally, allow those two ownerships to exist in parallel. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/core.h')
-rw-r--r--drivers/pinctrl/core.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index efbfb62ab147..17ecf651b123 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -119,15 +119,15 @@ struct pinctrl_setting {
* @name: a name for the pin, e.g. the name of the pin/pad/finger on a
* datasheet or such
* @dynamic_name: if the name of this pin was dynamically allocated
- * @usecount: If zero, the pin is not claimed, and @owner should be NULL.
+ * @mux_usecount: If zero, the pin is not claimed, and @owner should be NULL.
* If non-zero, this pin is claimed by @owner. This field is an integer
* rather than a boolean, since pinctrl_get() might process multiple
* mapping table entries that refer to, and hence claim, the same group
* or pin, and each of these will increment the @usecount.
- * @owner: The name of the entity owning the pin. Typically, this is the name
- * of the device that called pinctrl_get(). Alternatively, it may be the
- * name of the GPIO passed to pinctrl_request_gpio().
+ * @mux_owner: The name of device that called pinctrl_get().
* @mux_setting: The most recent selected mux setting for this pin, if any.
+ * @gpio_owner: If pinctrl_request_gpio() was called for this pin, this is
+ * the name of the GPIO that "owns" this pin.
*/
struct pin_desc {
struct pinctrl_dev *pctldev;
@@ -135,9 +135,10 @@ struct pin_desc {
bool dynamic_name;
/* These fields only added when supporting pinmux drivers */
#ifdef CONFIG_PINMUX
- unsigned usecount;
- const char *owner;
+ unsigned mux_usecount;
+ const char *mux_owner;
const struct pinctrl_setting_mux *mux_setting;
+ const char *gpio_owner;
#endif
};