Skip to content

Commit

Permalink
pinctrl: qcom: fail to retrieve configuration from invalid pin groups
Browse files Browse the repository at this point in the history
The pinconf-groups debugfs file dumps each valid configuration item of
all pin groups. Some platforms and devices may have pin groups which
cannot be accessed, according to commit 691bf5d ("pinctrl: qcom:
Don't allow protected pins to be requested"). Fail for each
configuration item of an invalid pin group by checking the GPIO chip's
valid mask.

The validity of the pin group cannot be checked in the generic pinconf
dump (function "pinconf_generic_dump_one"), as it does not directly
interact with the gpiochip or the pinmux callbacks (which would give it
access to the request callback). Instead, an entry contains the ID and
name of the pingroup with no properties when all items fail.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Link: https://lore.kernel.org/r/20231128020202.728156-3-mailingradian@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
flamingradian authored and linusw committed Dec 4, 2023
1 parent 142173c commit 27030ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pinctrl/qcom/pinctrl-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev,
int ret;
u32 val;

/* Pin information can only be requested from valid pin groups */
if (!gpiochip_line_is_valid(&pctrl->chip, group))
return -EINVAL;

g = &pctrl->soc->groups[group];

ret = msm_config_reg(pctrl, g, param, &mask, &bit);
Expand Down

0 comments on commit 27030ff

Please sign in to comment.