diff options
author | Magnus Damm <damm@opensource.se> | 2010-01-19 13:52:28 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-20 02:50:57 +0900 |
commit | 50dd3145a58b5cef03a95c1b98765bcc847a72d0 (patch) | |
tree | 91735433d6a261aae4b9e9c3e3d96cad7554f47a /drivers/sh/pfc.c | |
parent | 70911b861bfbba1851cbb3497635030f34703c7a (diff) |
sh: update PFC to allow any enum in MARK lists
This patch updates the PFC code with some clarifying
comments together with a functional change. The change
allows function type of GPIO to select any type of enum
in their MARK lists. Without this patch only function
type of enums are allowed in MARK lists.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/pfc.c')
-rw-r--r-- | drivers/sh/pfc.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c index 082604edc4c..cf0303acab8 100644 --- a/drivers/sh/pfc.c +++ b/drivers/sh/pfc.c @@ -337,12 +337,39 @@ static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio, if (!enum_id) break; + /* first check if this is a function enum */ in_range = enum_in_range(enum_id, &gpioc->function); - if (!in_range && range) { - in_range = enum_in_range(enum_id, range); - - if (in_range && enum_id == range->force) - continue; + if (!in_range) { + /* not a function enum */ + if (range) { + /* + * other range exists, so this pin is + * a regular GPIO pin that now is being + * bound to a specific direction. + * + * for this case we only allow function enums + * and the enums that match the other range. + */ + in_range = enum_in_range(enum_id, range); + + /* + * special case pass through for fixed + * input-only or output-only pins without + * function enum register association. + */ + if (in_range && enum_id == range->force) + continue; + } else { + /* + * no other range exists, so this pin + * must then be of the function type. + * + * allow function type pins to select + * any combination of function/in/out + * in their MARK lists. + */ + in_range = 1; + } } if (!in_range) |