12 #define pr_fmt(fmt) "generic pinconfig core: " fmt
14 #include <linux/kernel.h>
16 #include <linux/device.h>
17 #include <linux/slab.h>
26 #ifdef CONFIG_DEBUG_FS
28 struct pin_config_item {
29 const enum pin_config_param
param;
34 #define PCONFDUMP(a, b, c) { .param = a, .display = b, .format = c }
36 struct pin_config_item conf_items[] = {
37 PCONFDUMP(PIN_CONFIG_BIAS_DISABLE,
"input bias disabled",
NULL),
38 PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
"input bias high impedance",
NULL),
39 PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP,
"input bias pull up",
NULL),
40 PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN,
"input bias pull down",
NULL),
41 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL,
"output drive push pull",
NULL),
42 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN,
"output drive open drain",
NULL),
43 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE,
"output drive open source",
NULL),
44 PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT,
"input schmitt trigger",
NULL),
45 PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE,
"input debounce",
"time units"),
46 PCONFDUMP(PIN_CONFIG_POWER_SOURCE,
"pin power source",
"selector"),
47 PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE,
"pin low power",
"mode"),
50 void pinconf_generic_dump_pin(
struct pinctrl_dev *pctldev,
53 const struct pinconf_ops *
ops = pctldev->
desc->confops;
64 config = pinconf_to_config_packed(conf_items[i].
param, 0);
70 seq_printf(s,
"ERROR READING CONFIG SETTING %d ", i);
77 if (conf_items[i].
format &&
78 pinconf_to_config_argument(config) != 0)
80 pinconf_to_config_argument(config),
85 void pinconf_generic_dump_group(
struct pinctrl_dev *pctldev,
86 struct seq_file *s,
const char *gname)
88 const struct pinconf_ops *ops = pctldev->
desc->confops;
99 config = pinconf_to_config_packed(conf_items[i].
param, 0);
106 seq_printf(s,
"ERROR READING CONFIG SETTING %d ", i);
113 if (conf_items[i].
format && config != 0)
115 pinconf_to_config_argument(config),