OSDN Git Service

pinctrl: qcom: Print high/low status of gpios in debugfs
authorStephen Boyd <swboyd@chromium.org>
Tue, 8 May 2018 00:15:23 +0000 (17:15 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 May 2018 13:44:49 +0000 (15:44 +0200)
commit59a18c24ba4d7bc555e4d8327f26943309f51fa0
tree91db3f098b0d0551e88b363438fe7ba885021915
parentc3234d3b4b96dedc473d9872db46b201ca444d39
pinctrl: qcom: Print high/low status of gpios in debugfs

I was debugging some gpio issues and I thought that the output of gpio
debugfs was telling me the high or low level of the gpios with a '1' or
a '0'. We saw a line like this though:

 gpio93  : in 4 2mA pull down

and I started to think that there may be a gas leak in the building
because '4' doesn't mean high or low, and other pins said '0' or '1'. It
turns out, '4' is the function selection for the pinmux of the gpio and
not the value on the pin. Reading code helps decipher what debugfs is
actually saying.

Add support to read the input or output pin depending on how the pin is
configured so we can easily see the high or low value of the pin in
debugfs. Now the output looks like

 gpio93  : in   low  func4 2mA pull down

which clearly shows that the pin is an input, low, with function 4 and a
2mA drive strength plus a pull down.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Alexandru M Stan <amstan@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-msm.c