diff options
author | Magnus Damm <damm@opensource.se> | 2010-01-19 08:52:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-01-19 12:50:57 -0500 |
commit | 50dd3145a58b5cef03a95c1b98765bcc847a72d0 (patch) | |
tree | 91735433d6a261aae4b9e9c3e3d96cad7554f47a /drivers/sh | |
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')
-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 082604edc4c2..cf0303acab8e 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, | |||
337 | if (!enum_id) | 337 | if (!enum_id) |
338 | break; | 338 | break; |
339 | 339 | ||
340 | /* first check if this is a function enum */ | ||
340 | in_range = enum_in_range(enum_id, &gpioc->function); | 341 | in_range = enum_in_range(enum_id, &gpioc->function); |
341 | if (!in_range && range) { | 342 | if (!in_range) { |
342 | in_range = enum_in_range(enum_id, range); | 343 | /* not a function enum */ |
343 | 344 | if (range) { | |
344 | if (in_range && enum_id == range->force) | 345 | /* |
345 | continue; | 346 | * other range exists, so this pin is |
347 | * a regular GPIO pin that now is being | ||
348 | * bound to a specific direction. | ||
349 | * | ||
350 | * for this case we only allow function enums | ||
351 | * and the enums that match the other range. | ||
352 | */ | ||
353 | in_range = enum_in_range(enum_id, range); | ||
354 | |||
355 | /* | ||
356 | * special case pass through for fixed | ||
357 | * input-only or output-only pins without | ||
358 | * function enum register association. | ||
359 | */ | ||
360 | if (in_range && enum_id == range->force) | ||
361 | continue; | ||
362 | } else { | ||
363 | /* | ||
364 | * no other range exists, so this pin | ||
365 | * must then be of the function type. | ||
366 | * | ||
367 | * allow function type pins to select | ||
368 | * any combination of function/in/out | ||
369 | * in their MARK lists. | ||
370 | */ | ||
371 | in_range = 1; | ||
372 | } | ||
346 | } | 373 | } |
347 | 374 | ||
348 | if (!in_range) | 375 | if (!in_range) |