From: Stephen Boyd <swboyd@chromium.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Doug Anderson <dianders@chromium.org>
Subject: [PATCH v3 0/3] pinctrl: msm interrupt and muxing fixes
Date: Thu, 16 Aug 2018 13:06:45 -0700 [thread overview]
Message-ID: <20180816200648.90458-1-swboyd@chromium.org> (raw)
Here's a collection of pinctrl fixes for the qcom driver that
make things a little smoother for DT writers while also fixing
a problem seen with level triggered interrupts.
The first patch fixes an issue where we always see one extra level
triggered interrupt when the interrupt triggers. The second and third
patches make things nice for DT writers so they don't have to explicitly
mux out pins as 'GPIO' function and as 'input' instead of output so that
interrupts work properly and also makes sure that a gpio is muxed out
properly to 'GPIO' function when a gpio is requested by gpiod_request()
and friends.
The discussion never really completed on the previous thread so I'm just
resending these patches to restart the conversation. In the cases
where a driver needs to do both pinctrl muxing for some non-gpio
function and also GPIO control they'll need to explicitly mux the pins
at the right time. If we force them to mux the pins into the function
mode after requesting the GPIO at boot then we'll be better off because
it will force the code to mux out the function or GPIO explicitly all
the time.
We will have a case in the near future where the UART driver will want
to mux the RX pin into GPIO mode so it can get a wakeup interrupt during
suspend path and then swizzle the pin back into QUP/UART mode when the
wakeup interrupt isn't necessary anymore. In this case, I imagine the
driver will request the pin as an interrupt during probe, that will
convert the GPIO into an irq and mux it out as a GPIO function input
pin, disable that IRQ because it's only needed at suspend time, and then
need to explicitly mux the device into "UART" mode before finishing
driver probe. Then when it goes into suspend, it will need to remux the
pin as a GPIO function input pin, enable the irq, and wait for wakeup.
On resume, it will disable the irq and remux the pin as "UART" mode.
Changes from v2:
* Better comment in patch#1 to describe this stuff
* Squashed the raw status bit part into the same write in mask path
based on suggestion from Doug Andersson
Changes from v1:
* Squashed the raw status bit part into the same write in unmask path
based on suggestion from Doug Andersson
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
Stephen Boyd (3):
pinctrl: msm: Really mask level interrupts to prevent latching
pinctrl: msm: Mux out gpio function with gpio_request()
pinctrl: msm: Configure interrupts as input and gpio mode
drivers/pinctrl/qcom/pinctrl-msm.c | 77 ++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
--
Sent by a computer through tubes
next reply other threads:[~2018-08-16 20:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-16 20:06 Stephen Boyd [this message]
2018-08-16 20:06 ` [PATCH v3 1/3] pinctrl: msm: Really mask level interrupts to prevent latching Stephen Boyd
2018-08-16 20:49 ` Doug Anderson
2018-08-23 7:57 ` Linus Walleij
2018-08-27 3:05 ` Bjorn Andersson
2018-08-29 7:40 ` Linus Walleij
2018-08-29 7:44 ` Linus Walleij
2018-08-16 20:06 ` [PATCH v3 2/3] pinctrl: msm: Mux out gpio function with gpio_request() Stephen Boyd
2018-08-27 3:06 ` Bjorn Andersson
2018-08-29 7:42 ` Linus Walleij
2018-08-16 20:06 ` [PATCH v3 3/3] pinctrl: msm: Configure interrupts as input and gpio mode Stephen Boyd
2018-08-27 3:06 ` Bjorn Andersson
2018-08-29 7:43 ` Linus Walleij
2018-09-12 10:34 ` [PATCH v3 0/3] pinctrl: msm interrupt and muxing fixes Niklas Cassel
2018-10-01 18:46 ` Stephen Boyd
2018-10-01 19:34 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180816200648.90458-1-swboyd@chromium.org \
--to=swboyd@chromium.org \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).