.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Core driver for the generic pin config portions of the pin control subsystem |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Written on behalf of Linaro for ST-Ericsson |
---|
6 | 7 | * |
---|
7 | 8 | * Author: Linus Walleij <linus.walleij@linaro.org> |
---|
8 | | - * |
---|
9 | | - * License terms: GNU General Public License (GPL) version 2 |
---|
10 | 9 | */ |
---|
11 | 10 | |
---|
12 | 11 | #define pr_fmt(fmt) "generic pinconfig core: " fmt |
---|
.. | .. |
---|
31 | 30 | PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL, false), |
---|
32 | 31 | PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL, false), |
---|
33 | 32 | 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), |
---|
35 | 34 | 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), |
---|
38 | 37 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false), |
---|
39 | 38 | PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false), |
---|
40 | 39 | PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false), |
---|
41 | 40 | PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true), |
---|
| 41 | + PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH_UA, "output drive strength", "uA", true), |
---|
42 | 42 | PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true), |
---|
43 | 43 | PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), |
---|
44 | 44 | PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), |
---|
.. | .. |
---|
167 | 167 | { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, |
---|
168 | 168 | { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 }, |
---|
169 | 169 | { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, |
---|
| 170 | + { "drive-strength-microamp", PIN_CONFIG_DRIVE_STRENGTH_UA, 0 }, |
---|
170 | 171 | { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, |
---|
171 | 172 | { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, |
---|
172 | 173 | { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, |
---|
.. | .. |
---|
230 | 231 | * pinconf_generic_parse_dt_config() |
---|
231 | 232 | * parse the config properties into generic pinconfig values. |
---|
232 | 233 | * @np: node containing the pinconfig properties |
---|
| 234 | + * @pctldev: pincontrol device |
---|
233 | 235 | * @configs: array with nconfigs entries containing the generic pinconf values |
---|
234 | 236 | * must be freed when no longer necessary. |
---|
235 | | - * @nconfigs: umber of configurations |
---|
| 237 | + * @nconfigs: number of configurations |
---|
236 | 238 | */ |
---|
237 | 239 | int pinconf_generic_parse_dt_config(struct device_node *np, |
---|
238 | 240 | struct pinctrl_dev *pctldev, |
---|
.. | .. |
---|
391 | 393 | for_each_available_child_of_node(np_config, np) { |
---|
392 | 394 | ret = pinconf_generic_dt_subnode_to_map(pctldev, np, map, |
---|
393 | 395 | &reserved_maps, num_maps, type); |
---|
394 | | - if (ret < 0) |
---|
| 396 | + if (ret < 0) { |
---|
| 397 | + of_node_put(np); |
---|
395 | 398 | goto exit; |
---|
| 399 | + } |
---|
396 | 400 | } |
---|
397 | 401 | return 0; |
---|
398 | 402 | |
---|