aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/core.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-02-09 13:47:48 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-02-10 15:33:06 -0500
commitbefe5bdfbb698b3bc57c58d0bd7ca3391c9275ed (patch)
tree71416f2adc515f010f54de2371e29626cd144a5b /drivers/pinctrl/core.h
parente93bcee00c43e2bd4037291262111016f4c05793 (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.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 7a89888fce94..a50cdb053c84 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -30,6 +30,7 @@ struct pinctrl_gpio_range;
30 * subsystem 30 * subsystem
31 * @pinctrl_hogs_lock: lock for the pin control hog list 31 * @pinctrl_hogs_lock: lock for the pin control hog list
32 * @pinctrl_hogs: list of pin control maps hogged by this device 32 * @pinctrl_hogs: list of pin control maps hogged by this device
33 * @device_root: debugfs root for this device
33 */ 34 */
34struct pinctrl_dev { 35struct pinctrl_dev {
35 struct list_head node; 36 struct list_head node;
@@ -41,12 +42,37 @@ struct pinctrl_dev {
41 struct device *dev; 42 struct device *dev;
42 struct module *owner; 43 struct module *owner;
43 void *driver_data; 44 void *driver_data;
45 struct mutex pinctrl_hogs_lock;
46 struct list_head pinctrl_hogs;
44#ifdef CONFIG_DEBUG_FS 47#ifdef CONFIG_DEBUG_FS
45 struct dentry *device_root; 48 struct dentry *device_root;
46#endif 49#endif
50};
51
52/**
53 * struct pinctrl - per-device pin control state holder
54 * @node: global list node
55 * @dev: the device using this pin control handle
56 * @usecount: the number of active users of this pin controller setting, used
57 * to keep track of nested use cases
58 * @pctldev: pin control device handling this pin control handle
59 * @mutex: a lock for the pin control state holder
60 * @func_selector: the function selector for the pinmux device handling
61 * this pinmux
62 * @groups: the group selectors for the pinmux device and
63 * selector combination handling this pinmux, this is a list that
64 * will be traversed on all pinmux operations such as
65 * get/put/enable/disable
66 */
67struct pinctrl {
68 struct list_head node;
69 struct device *dev;
70 unsigned usecount;
71 struct pinctrl_dev *pctldev;
72 struct mutex mutex;
47#ifdef CONFIG_PINMUX 73#ifdef CONFIG_PINMUX
48 struct mutex pinctrl_hogs_lock; 74 unsigned func_selector;
49 struct list_head pinctrl_hogs; 75 struct list_head groups;
50#endif 76#endif
51}; 77};
52 78