summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2018-10-01 23:49:05 +0200
committerLinus Walleij <linus.walleij@linaro.org>2018-10-02 10:48:43 +0200
commitde0c18a87cfa094cb23655624859e09da5146e2a (patch)
tree9ebe0888c597eb292d7ad46df3cef695cc57dd69 /drivers/pinctrl
parentpinctrl: core: make sure strcmp() doesn't get a null parameter (diff)
downloadlinux-de0c18a87cfa094cb23655624859e09da5146e2a.tar.xz
linux-de0c18a87cfa094cb23655624859e09da5146e2a.zip
pinctrl: msm: Actually use function 0 for gpio selection
This code needs to select function #0, which is the first int in the array of functions, not the number 0 which may or may not be the function for "GPIO mode" per the enum mapping. We were getting lucky on SDM845, where this was tested, because the function 0 matched the enum value for "GPIO mode". On other platforms, e.g. MSM8996, the gpio enum value is the last one in the list so this code doesn't work and we see a warning at boot. Fix it by grabbing the first element out of the array of functions. Cc: Doug Anderson <dianders@chromium.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Niklas Cassel <niklas.cassel@linaro.org> Reported-by: Niklas Cassel <niklas.cassel@linaro.org> Fixes: 1de7ddb3a15c ("pinctrl: msm: Mux out gpio function with gpio_request()") Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 0726c8a09065..d12bed7bb541 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -207,7 +207,7 @@ static int msm_pinmux_request_gpio(struct pinctrl_dev *pctldev,
return 0;
/* For now assume function 0 is GPIO because it always is */
- return msm_pinmux_set_mux(pctldev, 0, offset);
+ return msm_pinmux_set_mux(pctldev, g->funcs[0], offset);
}
static const struct pinmux_ops msm_pinmux_ops = {