summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-nomadik.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-05-02 22:56:47 +0200
committerLinus Walleij <linus.walleij@linaro.org>2012-05-11 11:14:16 +0200
commitdbfe8ca259e1f899ca02ea33d903fa21bbea67c5 (patch)
tree84323bb062518a3ffe538162e8ca9e21a7743425 /drivers/pinctrl/pinctrl-nomadik.h
parent24cbdd75c4a868bf1ebc986337ffcacf3f8a4109 (diff)
downloadblackbird-op-linux-dbfe8ca259e1f899ca02ea33d903fa21bbea67c5.tar.gz
blackbird-op-linux-dbfe8ca259e1f899ca02ea33d903fa21bbea67c5.zip
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 @@
#define PINCTRL_NMK_DB8500 1
/**
+ * struct nmk_function - Nomadik pinctrl mux function
+ * @name: The name of the function, exported to pinctrl core.
+ * @groups: An array of pin groups that may select this function.
+ * @ngroups: The number of entries in @groups.
+ */
+struct nmk_function {
+ const char *name;
+ const char * const *groups;
+ unsigned ngroups;
+};
+
+/**
* struct nmk_pingroup - describes a Nomadik pin group
* @name: the name of this specific pin group
* @pins: an array of discrete physical pins used in this group, taken
@@ -21,7 +33,7 @@ struct nmk_pingroup {
const char *name;
const unsigned int *pins;
const unsigned npins;
- u32 altsetting;
+ int altsetting;
};
/**
@@ -32,7 +44,9 @@ struct nmk_pingroup {
* All pins which are also GPIOs must be listed first within the
* array, and be numbered identically to the GPIO controller's
* numbering.
- * @npins: The numbmer of entries in @pins.
+ * @npins: The number of entries in @pins.
+ * @functions: The functions supported on this SoC.
+ * @nfunction: The number of entries in @functions.
* @groups: An array describing all pin groups the pin SoC supports.
* @ngroups: The number of entries in @groups.
*/
@@ -41,6 +55,8 @@ struct nmk_pinctrl_soc_data {
unsigned gpio_num_ranges;
const struct pinctrl_pin_desc *pins;
unsigned npins;
+ const struct nmk_function *functions;
+ unsigned nfunctions;
const struct nmk_pingroup *groups;
unsigned ngroups;
};
OpenPOWER on IntegriCloud