summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2015-04-09 06:13:07 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-05-06 15:45:19 +0300
commitfa76a3db7093a527333c380df82a0f158d9b8299 (patch)
treeadd57323d26140a8e2358da9b93066d096c9c38d /include/linux
parentc30024a6449070d6fde51a8bddf4c97f884db2cc (diff)
downloadlinux-fa76a3db7093a527333c380df82a0f158d9b8299.tar.xz
pinctrl: allow exlusive GPIO/mux pin allocation
Disallow simultaneous use of the the GPIO and peripheral mux functions by setting a flag "strict" in struct pinctrl_desc. The blackfin pinmux and gpio controller doesn't allow user to set up a pin for both GPIO and peripheral function. So, add flag strict in struct pinctrl_desc to check both gpio_owner and mux_owner before approving the pin request. v2-changes: - if strict flag is set, check gpio_owner and mux_onwer in if and else clause v3-changes: - add kerneldoc for this struct - augment Documentation/pinctrl.txt Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pinctrl/pinctrl.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 66e4697516de..fc6b0348c375 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -114,6 +114,8 @@ struct pinctrl_ops {
* of the pins field above
* @pctlops: pin control operation vtable, to support global concepts like
* grouping of pins, this is optional.
+ * @strict: check both gpio_owner and mux_owner strictly before approving
+ the pin request
* @pmxops: pinmux operations vtable, if you support pinmuxing in your driver
* @confops: pin config operations vtable, if you support pin configuration in
* your driver
@@ -132,6 +134,7 @@ struct pinctrl_desc {
const struct pinctrl_ops *pctlops;
const struct pinmux_ops *pmxops;
const struct pinconf_ops *confops;
+ bool strict;
struct module *owner;
#ifdef CONFIG_GENERIC_PINCONF
unsigned int num_custom_params;