diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-02-09 19:47:48 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-02-10 21:33:06 +0100 |
commit | befe5bdfbb698b3bc57c58d0bd7ca3391c9275ed (patch) | |
tree | 71416f2adc515f010f54de2371e29626cd144a5b /drivers/pinctrl/core.h | |
parent | e93bcee00c43e2bd4037291262111016f4c05793 (diff) |
pinctrl: factor pin control handles over to the core
This moves the per-devices struct pinctrl handles and device map
over from the pinmux part of the subsystem to the core pinctrl part.
This makes the device handles core infrastructure with the goal of
using these handles also for pin configuration, so that device
drivers (or boards etc) will need one and only one handle to the
pin control core.
Acked-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.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 7a89888fce9..a50cdb053c8 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -30,6 +30,7 @@ struct pinctrl_gpio_range; * subsystem * @pinctrl_hogs_lock: lock for the pin control hog list * @pinctrl_hogs: list of pin control maps hogged by this device + * @device_root: debugfs root for this device */ struct pinctrl_dev { struct list_head node; @@ -41,12 +42,37 @@ struct pinctrl_dev { struct device *dev; struct module *owner; void *driver_data; + struct mutex pinctrl_hogs_lock; + struct list_head pinctrl_hogs; #ifdef CONFIG_DEBUG_FS struct dentry *device_root; #endif +}; + +/** + * struct pinctrl - per-device pin control state holder + * @node: global list node + * @dev: the device using this pin control handle + * @usecount: the number of active users of this pin controller setting, used + * to keep track of nested use cases + * @pctldev: pin control device handling this pin control handle + * @mutex: a lock for the pin control state holder + * @func_selector: the function selector for the pinmux device handling + * this pinmux + * @groups: the group selectors for the pinmux device and + * selector combination handling this pinmux, this is a list that + * will be traversed on all pinmux operations such as + * get/put/enable/disable + */ +struct pinctrl { + struct list_head node; + struct device *dev; + unsigned usecount; + struct pinctrl_dev *pctldev; + struct mutex mutex; #ifdef CONFIG_PINMUX - struct mutex pinctrl_hogs_lock; - struct list_head pinctrl_hogs; + unsigned func_selector; + struct list_head groups; #endif }; |