hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pinctrl/pinconf-generic.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Core driver for the generic pin config portions of the pin control subsystem
34 *
....@@ -5,8 +6,6 @@
56 * Written on behalf of Linaro for ST-Ericsson
67 *
78 * Author: Linus Walleij <linus.walleij@linaro.org>
8
- *
9
- * License terms: GNU General Public License (GPL) version 2
109 */
1110
1211 #define pr_fmt(fmt) "generic pinconfig core: " fmt
....@@ -31,14 +30,15 @@
3130 PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL, false),
3231 PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL, false),
3332 PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL, false),
34
- PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL, false),
33
+ PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", "ohms", true),
3534 PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
36
- "input bias pull to pin specific state", NULL, false),
37
- PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false),
35
+ "input bias pull to pin specific state", "ohms", true),
36
+ PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", "ohms", true),
3837 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false),
3938 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false),
4039 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false),
4140 PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true),
41
+ PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH_UA, "output drive strength", "uA", true),
4242 PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true),
4343 PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false),
4444 PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false),
....@@ -167,6 +167,7 @@
167167 { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 },
168168 { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 },
169169 { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 },
170
+ { "drive-strength-microamp", PIN_CONFIG_DRIVE_STRENGTH_UA, 0 },
170171 { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 },
171172 { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
172173 { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 },
....@@ -230,9 +231,10 @@
230231 * pinconf_generic_parse_dt_config()
231232 * parse the config properties into generic pinconfig values.
232233 * @np: node containing the pinconfig properties
234
+ * @pctldev: pincontrol device
233235 * @configs: array with nconfigs entries containing the generic pinconf values
234236 * must be freed when no longer necessary.
235
- * @nconfigs: umber of configurations
237
+ * @nconfigs: number of configurations
236238 */
237239 int pinconf_generic_parse_dt_config(struct device_node *np,
238240 struct pinctrl_dev *pctldev,
....@@ -391,8 +393,10 @@
391393 for_each_available_child_of_node(np_config, np) {
392394 ret = pinconf_generic_dt_subnode_to_map(pctldev, np, map,
393395 &reserved_maps, num_maps, type);
394
- if (ret < 0)
396
+ if (ret < 0) {
397
+ of_node_put(np);
395398 goto exit;
399
+ }
396400 }
397401 return 0;
398402