diff options
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 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) |