Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: pinconf-generic: sort pin configuration params alphabetically

Currently, the dt_params array in drivers/pinctrl/pinconf-generic.c
is not sorted in the same order as the enum pin_config_param in
include/linux/pinctrl/pinconf-generic.h.

Sort enum pin_config_param, conf_items, dt_params, alphabetically
for consistency.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Masahiro Yamada and committed by
Linus Walleij
3c4b23dd 89092fb0

+55 -55
+19 -19
drivers/pinctrl/pinconf-generic.c
··· 28 28 29 29 #ifdef CONFIG_DEBUG_FS 30 30 static const struct pin_config_item conf_items[] = { 31 + PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL, false), 31 32 PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL, false), 32 33 PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL, false), 33 - PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL, false), 34 - PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false), 35 34 PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL, false), 36 35 PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 37 36 "input bias pull to pin specific state", NULL, false), 38 - PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false), 37 + PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false), 39 38 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false), 40 39 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false), 40 + PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false), 41 41 PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true), 42 - PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), 43 - PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL, false), 44 - PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), 45 42 PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true), 46 - PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), 47 - PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), 43 + PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), 44 + PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), 45 + PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL, false), 48 46 PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode", true), 49 47 PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), 48 + PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), 49 + PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), 50 50 }; 51 51 52 52 static void pinconf_generic_dump_one(struct pinctrl_dev *pctldev, ··· 150 150 151 151 #ifdef CONFIG_OF 152 152 static const struct pinconf_generic_params dt_params[] = { 153 + { "bias-bus-hold", PIN_CONFIG_BIAS_BUS_HOLD, 0 }, 153 154 { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 }, 154 155 { "bias-high-impedance", PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0 }, 155 - { "bias-bus-hold", PIN_CONFIG_BIAS_BUS_HOLD, 0 }, 156 156 { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 }, 157 - { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 }, 158 157 { "bias-pull-pin-default", PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 1 }, 159 - { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 }, 158 + { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 }, 160 159 { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 }, 161 160 { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, 161 + { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 }, 162 162 { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, 163 - { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, 164 - { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, 165 - { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, 166 - { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, 167 163 { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, 168 - { "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, 169 - { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 }, 164 + { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, 165 + { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, 166 + { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, 167 + { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, 170 168 { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, 171 - { "output-low", PIN_CONFIG_OUTPUT, 0, }, 169 + { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 }, 172 170 { "output-high", PIN_CONFIG_OUTPUT, 1, }, 173 - { "slew-rate", PIN_CONFIG_SLEW_RATE, 0}, 171 + { "output-low", PIN_CONFIG_OUTPUT, 0, }, 172 + { "power-source", PIN_CONFIG_POWER_SOURCE, 0 }, 173 + { "slew-rate", PIN_CONFIG_SLEW_RATE, 0 }, 174 174 }; 175 175 176 176 /**
+36 -36
include/linux/pinctrl/pinconf-generic.h
··· 20 20 21 21 /** 22 22 * enum pin_config_param - possible pin configuration parameters 23 + * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it 24 + * weakly drives the last value on a tristate bus, also known as a "bus 25 + * holder", "bus keeper" or "repeater". This allows another device on the 26 + * bus to change the value by driving the bus high or low and switching to 27 + * tristate. The argument is ignored. 23 28 * @PIN_CONFIG_BIAS_DISABLE: disable any pin bias on the pin, a 24 29 * transition from say pull-up to pull-down implies that you disable 25 30 * pull-up in the process, this setting disables all biasing. ··· 34 29 * if for example some other pin is going to drive the signal connected 35 30 * to it for a while. Pins used for input are usually always high 36 31 * impedance. 37 - * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it 38 - * weakly drives the last value on a tristate bus, also known as a "bus 39 - * holder", "bus keeper" or "repeater". This allows another device on the 40 - * bus to change the value by driving the bus high or low and switching to 41 - * tristate. The argument is ignored. 42 - * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high 43 - * impedance to VDD). If the argument is != 0 pull-up is enabled, 44 - * if it is 0, pull-up is total, i.e. the pin is connected to VDD. 45 32 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high 46 33 * impedance to GROUND). If the argument is != 0 pull-down is enabled, 47 34 * if it is 0, pull-down is total, i.e. the pin is connected to GROUND. ··· 45 48 * If the argument is != 0 pull up/down is enabled, if it is 0, the 46 49 * configuration is ignored. The proper way to disable it is to use 47 50 * @PIN_CONFIG_BIAS_DISABLE. 48 - * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and 49 - * low, this is the most typical case and is typically achieved with two 50 - * active transistors on the output. Setting this config will enable 51 - * push-pull mode, the argument is ignored. 51 + * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high 52 + * impedance to VDD). If the argument is != 0 pull-up is enabled, 53 + * if it is 0, pull-up is total, i.e. the pin is connected to VDD. 52 54 * @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open 53 55 * collector) which means it is usually wired with other output ports 54 56 * which are then pulled up with an external resistor. Setting this ··· 55 59 * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source 56 60 * (open emitter). Setting this config will enable open source mode, the 57 61 * argument is ignored. 62 + * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and 63 + * low, this is the most typical case and is typically achieved with two 64 + * active transistors on the output. Setting this config will enable 65 + * push-pull mode, the argument is ignored. 58 66 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current 59 67 * passed as argument. The argument is in mA. 60 - * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not 61 - * affect the pin's ability to drive output. 1 enables input, 0 disables 62 - * input. 63 - * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. 64 - * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, 65 - * schmitt-trigger mode is disabled. 66 - * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in 67 - * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, 68 - * the threshold value is given on a custom format as argument when 69 - * setting pins to this mode. 70 68 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 71 69 * which means it will wait for signals to settle when reading inputs. The 72 70 * argument gives the debounce time in usecs. Setting the 73 71 * argument to zero turns debouncing off. 74 - * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 75 - * supplies, the argument to this parameter (on a custom format) tells 76 - * the driver which alternative power source to use. 77 - * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 78 - * this parameter (on a custom format) tells the driver which alternative 79 - * slew rate to use. 72 + * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not 73 + * affect the pin's ability to drive output. 1 enables input, 0 disables 74 + * input. 75 + * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in 76 + * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, 77 + * the threshold value is given on a custom format as argument when 78 + * setting pins to this mode. 79 + * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. 80 + * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, 81 + * schmitt-trigger mode is disabled. 80 82 * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power 81 83 * operation, if several modes of operation are supported these can be 82 84 * passed in the argument on a custom form, else just use argument 1 ··· 83 89 * 1 to indicate high level, argument 0 to indicate low level. (Please 84 90 * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a 85 91 * discussion around this parameter.) 92 + * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 93 + * supplies, the argument to this parameter (on a custom format) tells 94 + * the driver which alternative power source to use. 95 + * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 96 + * this parameter (on a custom format) tells the driver which alternative 97 + * slew rate to use. 86 98 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 87 99 * you need to pass in custom configurations to the pin controller, use 88 100 * PIN_CONFIG_END+1 as the base offset. 89 101 */ 90 102 enum pin_config_param { 103 + PIN_CONFIG_BIAS_BUS_HOLD, 91 104 PIN_CONFIG_BIAS_DISABLE, 92 105 PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 93 - PIN_CONFIG_BIAS_BUS_HOLD, 94 - PIN_CONFIG_BIAS_PULL_UP, 95 106 PIN_CONFIG_BIAS_PULL_DOWN, 96 107 PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 97 - PIN_CONFIG_DRIVE_PUSH_PULL, 108 + PIN_CONFIG_BIAS_PULL_UP, 98 109 PIN_CONFIG_DRIVE_OPEN_DRAIN, 99 110 PIN_CONFIG_DRIVE_OPEN_SOURCE, 111 + PIN_CONFIG_DRIVE_PUSH_PULL, 100 112 PIN_CONFIG_DRIVE_STRENGTH, 101 - PIN_CONFIG_INPUT_ENABLE, 102 - PIN_CONFIG_INPUT_SCHMITT_ENABLE, 103 - PIN_CONFIG_INPUT_SCHMITT, 104 113 PIN_CONFIG_INPUT_DEBOUNCE, 105 - PIN_CONFIG_POWER_SOURCE, 106 - PIN_CONFIG_SLEW_RATE, 114 + PIN_CONFIG_INPUT_ENABLE, 115 + PIN_CONFIG_INPUT_SCHMITT, 116 + PIN_CONFIG_INPUT_SCHMITT_ENABLE, 107 117 PIN_CONFIG_LOW_POWER_MODE, 108 118 PIN_CONFIG_OUTPUT, 119 + PIN_CONFIG_POWER_SOURCE, 120 + PIN_CONFIG_SLEW_RATE, 109 121 PIN_CONFIG_END = 0x7FFF, 110 122 }; 111 123