diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-05-28 04:11:19 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-05-28 04:14:21 -0400 |
commit | 815088550342904acd68f43436e1b4d1d78b77c1 (patch) | |
tree | 49eb667edff42461733f0d7f9dde71035c314ca6 /drivers/pinctrl/pinmux.c | |
parent | a2202a4c762bedb56bcaafd3200deceac1c2e7b5 (diff) |
pinctrl: improve debugfs for strict controllers
If we know we are using a strict pin controller (one that cannot
mix device functions+group use and GPIO) we can be a bit more
specific in debugfs, just print either device-function-group
or GPIO consumer for the pin. Let's do that to be helpful.
Cc: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinmux.c')
-rw-r--r-- | drivers/pinctrl/pinmux.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index c58c168b06c2..77f82b23f7be 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -585,7 +585,12 @@ static int pinmux_pins_show(struct seq_file *s, void *what) | |||
585 | return 0; | 585 | return 0; |
586 | 586 | ||
587 | seq_puts(s, "Pinmux settings per pin\n"); | 587 | seq_puts(s, "Pinmux settings per pin\n"); |
588 | seq_puts(s, "Format: pin (name): mux_owner gpio_owner hog?\n"); | 588 | if (pmxops->strict) |
589 | seq_puts(s, | ||
590 | "Format: pin (name): mux_owner|gpio_owner (strict) hog?\n"); | ||
591 | else | ||
592 | seq_puts(s, | ||
593 | "Format: pin (name): mux_owner gpio_owner hog?\n"); | ||
589 | 594 | ||
590 | mutex_lock(&pctldev->mutex); | 595 | mutex_lock(&pctldev->mutex); |
591 | 596 | ||
@@ -604,14 +609,34 @@ static int pinmux_pins_show(struct seq_file *s, void *what) | |||
604 | !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) | 609 | !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) |
605 | is_hog = true; | 610 | is_hog = true; |
606 | 611 | ||
607 | seq_printf(s, "pin %d (%s): %s %s%s", pin, | 612 | if (pmxops->strict) { |
608 | desc->name ? desc->name : "unnamed", | 613 | if (desc->mux_owner) |
609 | desc->mux_owner ? desc->mux_owner | 614 | seq_printf(s, "pin %d (%s): device %s%s", |
610 | : "(MUX UNCLAIMED)", | 615 | pin, |
611 | desc->gpio_owner ? desc->gpio_owner | 616 | desc->name ? desc->name : "unnamed", |
612 | : "(GPIO UNCLAIMED)", | 617 | desc->mux_owner, |
613 | is_hog ? " (HOG)" : ""); | 618 | is_hog ? " (HOG)" : ""); |
619 | else if (desc->gpio_owner) | ||
620 | seq_printf(s, "pin %d (%s): GPIO %s", | ||
621 | pin, | ||
622 | desc->name ? desc->name : "unnamed", | ||
623 | desc->gpio_owner); | ||
624 | else | ||
625 | seq_printf(s, "pin %d (%s): UNCLAIMED", | ||
626 | pin, | ||
627 | desc->name ? desc->name : "unnamed"); | ||
628 | } else { | ||
629 | /* For non-strict controllers */ | ||
630 | seq_printf(s, "pin %d (%s): %s %s%s", pin, | ||
631 | desc->name ? desc->name : "unnamed", | ||
632 | desc->mux_owner ? desc->mux_owner | ||
633 | : "(MUX UNCLAIMED)", | ||
634 | desc->gpio_owner ? desc->gpio_owner | ||
635 | : "(GPIO UNCLAIMED)", | ||
636 | is_hog ? " (HOG)" : ""); | ||
637 | } | ||
614 | 638 | ||
639 | /* If mux: print function+group claiming the pin */ | ||
615 | if (desc->mux_setting) | 640 | if (desc->mux_setting) |
616 | seq_printf(s, " function %s group %s\n", | 641 | seq_printf(s, " function %s group %s\n", |
617 | pmxops->get_function_name(pctldev, | 642 | pmxops->get_function_name(pctldev, |