diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-04-13 12:49:06 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-04-18 07:53:12 -0400 |
commit | 6cb4158757a8629e14851e7802f3b6bfaa7d6f00 (patch) | |
tree | c872640d7ec45d37fac2e1978418d5a92b5ef527 /drivers/pinctrl/pinconf.c | |
parent | c736d73c9e6d9849ecb08c34c1d3917b210e8f38 (diff) |
pinctrl: allow pctldevs to decode pin config in debugfs
Add a pinconf op so that pin controller drivers can decode their pin
config settings for debugfs.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinconf.c')
-rw-r--r-- | drivers/pinctrl/pinconf.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index 384dcc166e44..0133a69ad117 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c | |||
@@ -379,8 +379,16 @@ int pinconf_apply_setting(struct pinctrl_setting const *setting) | |||
379 | 379 | ||
380 | void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map) | 380 | void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map) |
381 | { | 381 | { |
382 | struct pinctrl_dev *pctldev; | ||
383 | const struct pinconf_ops *confops; | ||
382 | int i; | 384 | int i; |
383 | 385 | ||
386 | pctldev = get_pinctrl_dev_from_devname(map->ctrl_dev_name); | ||
387 | if (pctldev) | ||
388 | confops = pctldev->desc->confops; | ||
389 | else | ||
390 | confops = NULL; | ||
391 | |||
384 | switch (map->type) { | 392 | switch (map->type) { |
385 | case PIN_MAP_TYPE_CONFIGS_PIN: | 393 | case PIN_MAP_TYPE_CONFIGS_PIN: |
386 | seq_printf(s, "pin "); | 394 | seq_printf(s, "pin "); |
@@ -394,8 +402,15 @@ void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map) | |||
394 | 402 | ||
395 | seq_printf(s, "%s\n", map->data.configs.group_or_pin); | 403 | seq_printf(s, "%s\n", map->data.configs.group_or_pin); |
396 | 404 | ||
397 | for (i = 0; i < map->data.configs.num_configs; i++) | 405 | for (i = 0; i < map->data.configs.num_configs; i++) { |
398 | seq_printf(s, "config %08lx\n", map->data.configs.configs[i]); | 406 | seq_printf(s, "config "); |
407 | if (confops && confops->pin_config_config_dbg_show) | ||
408 | confops->pin_config_config_dbg_show(pctldev, s, | ||
409 | map->data.configs.configs[i]); | ||
410 | else | ||
411 | seq_printf(s, "%08lx", map->data.configs.configs[i]); | ||
412 | seq_printf(s, "\n"); | ||
413 | } | ||
399 | } | 414 | } |
400 | 415 | ||
401 | void pinconf_show_setting(struct seq_file *s, | 416 | void pinconf_show_setting(struct seq_file *s, |
@@ -403,6 +418,7 @@ void pinconf_show_setting(struct seq_file *s, | |||
403 | { | 418 | { |
404 | struct pinctrl_dev *pctldev = setting->pctldev; | 419 | struct pinctrl_dev *pctldev = setting->pctldev; |
405 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; | 420 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
421 | const struct pinconf_ops *confops = pctldev->desc->confops; | ||
406 | struct pin_desc *desc; | 422 | struct pin_desc *desc; |
407 | int i; | 423 | int i; |
408 | 424 | ||
@@ -428,8 +444,15 @@ void pinconf_show_setting(struct seq_file *s, | |||
428 | * FIXME: We should really get the pin controler to dump the config | 444 | * FIXME: We should really get the pin controler to dump the config |
429 | * values, so they can be decoded to something meaningful. | 445 | * values, so they can be decoded to something meaningful. |
430 | */ | 446 | */ |
431 | for (i = 0; i < setting->data.configs.num_configs; i++) | 447 | for (i = 0; i < setting->data.configs.num_configs; i++) { |
432 | seq_printf(s, " %08lx", setting->data.configs.configs[i]); | 448 | seq_printf(s, " "); |
449 | if (confops && confops->pin_config_config_dbg_show) | ||
450 | confops->pin_config_config_dbg_show(pctldev, s, | ||
451 | setting->data.configs.configs[i]); | ||
452 | else | ||
453 | seq_printf(s, "%08lx", | ||
454 | setting->data.configs.configs[i]); | ||
455 | } | ||
433 | 456 | ||
434 | seq_printf(s, "\n"); | 457 | seq_printf(s, "\n"); |
435 | } | 458 | } |