aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-nomadik.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-05-02 16:56:47 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-05-11 05:14:16 -0400
commitdbfe8ca259e1f899ca02ea33d903fa21bbea67c5 (patch)
tree84323bb062518a3ffe538162e8ca9e21a7743425 /drivers/pinctrl/pinctrl-nomadik.h
parent24cbdd75c4a868bf1ebc986337ffcacf3f8a4109 (diff)
pinctrl/nomadik: implement pin multiplexing
Implements basic pinmux for the Nomadik pin controller. The plan is to split the existing singular pin config interface nmk_config_pin(), nmk_config_pins(), that will configure muxing and other settings at the same time, into two interfaces by splitting the code in pinmux and pinctrl and eventually deleting the old interface and its helper functions when all users are gone. nmk_gpio_set_mode() and nmk_gpio_get_mode() are two older interfaces for just configuring muxing/altfunctions that will also be replaced in the end. We take some extra care to handle the glitch-avoidance here, but it is simpler now since there is only one altsetting per pingroup so we know immediately if we need to avoid altfunc C glitches for a certain group. As part of the makeover implement the .request() and .free() calls on the GPIO chips and have them call back into the pinctrl layer to reserve GPIOs. ChangeLog v1->v2: - Rebased on pinctrl-mergebase-20120418 so we get the latest driver infrastructure where function count is done by a fixed value and we can drop a few range checks since this is now handled by the core. - Include a GPIO muxing hunk erroneously part of the pin config patch. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.h')
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.h b/drivers/pinctrl/pinctrl-nomadik.h
index e690accb5051..bc91aed7185d 100644
--- a/drivers/pinctrl/pinctrl-nomadik.h
+++ b/drivers/pinctrl/pinctrl-nomadik.h
@@ -8,6 +8,18 @@
8#define PINCTRL_NMK_DB8500 1 8#define PINCTRL_NMK_DB8500 1
9 9
10/** 10/**
11 * struct nmk_function - Nomadik pinctrl mux function
12 * @name: The name of the function, exported to pinctrl core.
13 * @groups: An array of pin groups that may select this function.
14 * @ngroups: The number of entries in @groups.
15 */
16struct nmk_function {
17 const char *name;
18 const char * const *groups;
19 unsigned ngroups;
20};
21
22/**
11 * struct nmk_pingroup - describes a Nomadik pin group 23 * struct nmk_pingroup - describes a Nomadik pin group
12 * @name: the name of this specific pin group 24 * @name: the name of this specific pin group
13 * @pins: an array of discrete physical pins used in this group, taken 25 * @pins: an array of discrete physical pins used in this group, taken
@@ -21,7 +33,7 @@ struct nmk_pingroup {
21 const char *name; 33 const char *name;
22 const unsigned int *pins; 34 const unsigned int *pins;
23 const unsigned npins; 35 const unsigned npins;
24 u32 altsetting; 36 int altsetting;
25}; 37};
26 38
27/** 39/**
@@ -32,7 +44,9 @@ struct nmk_pingroup {
32 * All pins which are also GPIOs must be listed first within the 44 * All pins which are also GPIOs must be listed first within the
33 * array, and be numbered identically to the GPIO controller's 45 * array, and be numbered identically to the GPIO controller's
34 * numbering. 46 * numbering.
35 * @npins: The numbmer of entries in @pins. 47 * @npins: The number of entries in @pins.
48 * @functions: The functions supported on this SoC.
49 * @nfunction: The number of entries in @functions.
36 * @groups: An array describing all pin groups the pin SoC supports. 50 * @groups: An array describing all pin groups the pin SoC supports.
37 * @ngroups: The number of entries in @groups. 51 * @ngroups: The number of entries in @groups.
38 */ 52 */
@@ -41,6 +55,8 @@ struct nmk_pinctrl_soc_data {
41 unsigned gpio_num_ranges; 55 unsigned gpio_num_ranges;
42 const struct pinctrl_pin_desc *pins; 56 const struct pinctrl_pin_desc *pins;
43 unsigned npins; 57 unsigned npins;
58 const struct nmk_function *functions;
59 unsigned nfunctions;
44 const struct nmk_pingroup *groups; 60 const struct nmk_pingroup *groups;
45 unsigned ngroups; 61 unsigned ngroups;
46}; 62};