Skip to content

Commit

Permalink
pinctrl: make the pinmux-pins more helpful
Browse files Browse the repository at this point in the history
The debugfs file pinmux-pins used to tell which function was
enabled but now states simply which device owns the pin. Being
owned by the pinctrl driver itself means just that it's hogged
so be a bit more helpful by printing that.

ChangeLog v1->v2:
- Preserve the self-referential owner field, just clarify that
  when the pin controller states itself as owner this means
  that it's hogged.

Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Linus Walleij committed Feb 29, 2012
1 parent 2304b47 commit 1cf94c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,23 @@ static int pinmux_pins_show(struct seq_file *s, void *what)

/* The pin number can be retrived from the pin controller descriptor */
for (i = 0; i < pctldev->desc->npins; i++) {

struct pin_desc *desc;
bool is_hog = false;

pin = pctldev->desc->pins[i].number;
desc = pin_desc_get(pctldev, pin);
/* Skip if we cannot search the pin */
if (desc == NULL)
continue;

seq_printf(s, "pin %d (%s): %s\n", pin,
if (desc->owner &&
!strcmp(desc->owner, pinctrl_dev_get_name(pctldev)))
is_hog = true;

seq_printf(s, "pin %d (%s): %s%s\n", pin,
desc->name ? desc->name : "unnamed",
desc->owner ? desc->owner : "UNCLAIMED");
desc->owner ? desc->owner : "UNCLAIMED",
is_hog ? " (HOG)" : "");
}

return 0;
Expand Down

0 comments on commit 1cf94c4

Please sign in to comment.