Commit a672eb5e authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij

pinctrl: pinconf: separate config parameters with commas for debugfs

To improve debugfs readability, use commas instead of whitespaces
for separating configuration parameters.

For example, the "pinconf-pins" dump on my board will change as follows:

Without this commit:

 # head -5 pinconf-pins
 Pin config settings per pin
 Format: pin (name): configs
 pin 0 (ED0): input bias pull down output drive strength (8 mA) input enabled
 pin 1 (ED1): input bias pull down output drive strength (8 mA) input enabled
 pin 2 (ED2): input bias pull down output drive strength (8 mA) input enabled

With this commit:

 # head -5 pinconf-pins
 Pin config settings per pin
 Format: pin (name): configs
 pin 0 (ED0): input bias pull down, output drive strength (8 mA), input enabled
 pin 1 (ED1): input bias pull down, output drive strength (8 mA), input enabled
 pin 2 (ED2): input bias pull down, output drive strength (8 mA), input enabled
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent cd8f61f1
...@@ -53,7 +53,7 @@ static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev, ...@@ -53,7 +53,7 @@ static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev,
struct seq_file *s, const char *gname, struct seq_file *s, const char *gname,
unsigned pin, unsigned pin,
const struct pin_config_item *items, const struct pin_config_item *items,
int nitems) int nitems, int *print_sep)
{ {
int i; int i;
...@@ -75,8 +75,10 @@ static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev, ...@@ -75,8 +75,10 @@ static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev,
seq_printf(s, "ERROR READING CONFIG SETTING %d ", i); seq_printf(s, "ERROR READING CONFIG SETTING %d ", i);
continue; continue;
} }
/* Space between multiple configs */ /* comma between multiple configs */
seq_puts(s, " "); if (*print_sep)
seq_puts(s, ", ");
*print_sep = 1;
seq_puts(s, items[i].display); seq_puts(s, items[i].display);
/* Print unit if available */ /* Print unit if available */
if (items[i].has_arg) { if (items[i].has_arg) {
...@@ -105,19 +107,21 @@ void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev, struct seq_file *s, ...@@ -105,19 +107,21 @@ void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev, struct seq_file *s,
const char *gname, unsigned pin) const char *gname, unsigned pin)
{ {
const struct pinconf_ops *ops = pctldev->desc->confops; const struct pinconf_ops *ops = pctldev->desc->confops;
int print_sep = 0;
if (!ops->is_generic) if (!ops->is_generic)
return; return;
/* generic parameters */ /* generic parameters */
pinconf_generic_dump_one(pctldev, s, gname, pin, conf_items, pinconf_generic_dump_one(pctldev, s, gname, pin, conf_items,
ARRAY_SIZE(conf_items)); ARRAY_SIZE(conf_items), &print_sep);
/* driver-specific parameters */ /* driver-specific parameters */
if (pctldev->desc->num_custom_params && if (pctldev->desc->num_custom_params &&
pctldev->desc->custom_conf_items) pctldev->desc->custom_conf_items)
pinconf_generic_dump_one(pctldev, s, gname, pin, pinconf_generic_dump_one(pctldev, s, gname, pin,
pctldev->desc->custom_conf_items, pctldev->desc->custom_conf_items,
pctldev->desc->num_custom_params); pctldev->desc->num_custom_params,
&print_sep);
} }
void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, void pinconf_generic_dump_config(struct pinctrl_dev *pctldev,
......
...@@ -310,7 +310,7 @@ static int pinconf_pins_show(struct seq_file *s, void *what) ...@@ -310,7 +310,7 @@ static int pinconf_pins_show(struct seq_file *s, void *what)
if (desc == NULL) if (desc == NULL)
continue; continue;
seq_printf(s, "pin %d (%s):", pin, desc->name); seq_printf(s, "pin %d (%s): ", pin, desc->name);
pinconf_dump_pin(pctldev, s, pin); pinconf_dump_pin(pctldev, s, pin);
...@@ -347,7 +347,7 @@ static int pinconf_groups_show(struct seq_file *s, void *what) ...@@ -347,7 +347,7 @@ static int pinconf_groups_show(struct seq_file *s, void *what)
while (selector < ngroups) { while (selector < ngroups) {
const char *gname = pctlops->get_group_name(pctldev, selector); const char *gname = pctlops->get_group_name(pctldev, selector);
seq_printf(s, "%u (%s):", selector, gname); seq_printf(s, "%u (%s): ", selector, gname);
pinconf_dump_group(pctldev, s, selector, gname); pinconf_dump_group(pctldev, s, selector, gname);
seq_printf(s, "\n"); seq_printf(s, "\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment