Commit 07101e1
pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant
[ Upstream commit 1cf86bc ]
If you do this on an sdm845 board:
grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups
...it looks like nonsense. For every pin you see listed:
input bias disabled, input bias high impedance, input bias pull down, input bias pull up, ...
That's because pmic_gpio_config_get() isn't complying with the rules
that pinconf_generic_dump_one() expects. Specifically for boolean
parameters (anything with a "struct pin_config_item" where has_arg is
false) the function expects that the function should return its value
not through the "config" parameter but should return "0" if the value
is set and "-EINVAL" if the value isn't set.
Let's fix this.
>From a quick sample of other pinctrl drivers, it appears to be
tradition to also return 1 through the config parameter for these
boolean parameters when they exist. I'm not one to knock tradition,
so I'll follow tradition and return 1 in these cases. While I'm at
it, I'll also continue searching for four leaf clovers, kocking on
wood three times, and trying not to break mirrors.
NOTE: This also fixes an apparent typo for reading
PIN_CONFIG_BIAS_DISABLE where the old driver was accidentally
using "=" instead of "==" and thus was setting some internal
state when you tried to query PIN_CONFIG_BIAS_DISABLE. Oops.
Fixes: eadff30 ("pinctrl: Qualcomm SPMI PMIC GPIO pin controller driver")
Signed-off-by: Douglas Anderson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent a5d093d commit 07101e1
1 file changed
+24
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
394 | 396 | | |
395 | 397 | | |
396 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
397 | 401 | | |
398 | 402 | | |
399 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
400 | 406 | | |
401 | 407 | | |
402 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
403 | 411 | | |
404 | 412 | | |
405 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
406 | 416 | | |
407 | 417 | | |
408 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
409 | 421 | | |
410 | 422 | | |
411 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
412 | 426 | | |
413 | 427 | | |
414 | 428 | | |
415 | 429 | | |
416 | 430 | | |
417 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
418 | 434 | | |
419 | 435 | | |
420 | 436 | | |
| |||
0 commit comments