From: Lina Iyer <ilina@codeaurora.org>
To: marc.zyngier@arm.com, bjorn.andersson@linaro.org,
sboyd@kernel.org, evgreen@chromium.org, linus.walleij@linaro.org
Cc: rplsssn@codeaurora.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org,
devicetree@vger.kernel.org, andy.gross@linaro.org,
dianders@chromium.org
Subject: Re: [PATCH v2 0/5] Wakeup GPIO support for SDM845 SoC
Date: Fri, 17 Aug 2018 13:31:01 -0600 [thread overview]
Message-ID: <20180817193101.GQ5081@codeaurora.org> (raw)
In-Reply-To: <20180817163849.30750-1-ilina@codeaurora.org>
Please ignore this series. The series is incorrectly marked as v2. I am
resending it as v1.
On Fri, Aug 17 2018 at 10:39 -0600, Lina Iyer wrote:
>Hi,
>
>Changes in v1:
> - Avoid GPIO-PDC map in .c file
> - Trigger GPIO by writing to the hardware
> - Hooked up to suspend/resume callbacks
> - Dropped PDC DT bindings (see dependencies)
>
>Dependencies:
> https://lkml.org/lkml/2018/8/17/137
> https://lkml.org/lkml/2018/8/15/289
>
>This is an attempt at a solution to enable wake up from suspend and deep idle
>using GPIO as a wakeup source. The 845 uses a new interrupt controller (PDC)
>that lies in the always-on domain and can sense interrupts that are routed to
>it, when the GIC is powered off. It would then wakeup the GIC and replay the
>interrupt which would then be relayed to the AP. The PDC interrupt controller
>driver is merged upstream [1],[2]. The following set of patches extends the
>wakeup capability to GPIOs using the PDC. The TLMM pinctrl driver for the SoC
>available at [3].
>
>The complexity with the solution stems from the fact that only a selected few
>GPIO lines are routed to the PDC in addition the TLMMs. They are also from
>different banks on the pinctrl and the TLMM summary line is not routed to the
>PDC. Hence the PDC cannot be considered as parent of the TLMM irqchip (or can
>we ?). This is what it looks like -
>
> [ PIN ] -----[ TLMM ]---------------> [ GIC ] ---> [ CPU ]
> | <summary IRQ> ^
> | |
> ----------------------------------> [ PDC ]
> <wakeup IRQs>
>
>I had a brief discussion with Linus on this and the idea implemented is based
>on his suggestion.
>
>When an IRQ (let's call this latent IRQ) for a GPIO is requested, the
>->irq_request_resources() is used by the TLMM driver to request a PDC pin. The
>PDC pin associated with the GPIO is read from a static map available in the
>pinctrl-sdm845.c. (I think there should be a better location than a static map,
>more on that later). Knowing the PDC pin from the map, we could look up the DT
>bindings and request the PDC interrupt with the same trigger mask as the
>interrupt requested. The ->set_type and ->set_wake are also trapped to set the
>PDC IRQ's polarity and enable it when the latent IRQ is requested. When the PDC
>detects the interrupt at suspend, it wakes up the GIC and replays the wakeup
>IRQ. The GPIO handler function for the latent IRQ is invoked in turn.
>
>Please review these patches and your inputs would be greatly appreciated and
>(kindly) let me know if I have committed any blunders with this approach. There
>is definitely opportunity to improve the location of the static GPIO-PDC pin
>map. We could possibly put it as an data argument in the interrupts definition
>of the PDC or with interrupt names. Also, I am still sorting out some issues
>with the IRQ handling part of these patches. And I am unsure of how to set the
>polarity of the PDC pin without locking, since we are not in hierarchy with the
>PDC interrupt controller. Again, your inputs on these would be greatly helpful.
>
>Thanks,
>Lina
>
>[1]. drivers/irqchip/qcom-pdc.c
>[2]. Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.txt
>[3]. drivers/pinctrl/qcom/pinctrl-msm.c
>
>Lina Iyer (5):
> drivers: pinctrl: qcom: add wakeup capability to GPIO
> dt-bindings: pinctrl: add wakeup capable GPIOs for SDM845
> drivers: pinctrl: msm: enable PDC interrupt only during suspend
> drivers: pinctrl: qcom: sdm845: support GPIO wakeup from suspend
> arm64: dts: qcom: add wake up interrupts for GPIOs for SDM845
>
> .../bindings/pinctrl/qcom,sdm845-pinctrl.txt | 58 ++++++-
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 57 ++++++-
> drivers/pinctrl/qcom/pinctrl-msm.c | 155 ++++++++++++++++++
> drivers/pinctrl/qcom/pinctrl-msm.h | 3 +
> drivers/pinctrl/qcom/pinctrl-sdm845.c | 6 +
> 5 files changed, 275 insertions(+), 4 deletions(-)
>
>--
>The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>a Linux Foundation Collaborative Project
>
next prev parent reply other threads:[~2018-08-17 19:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 16:38 [PATCH v2 0/5] Wakeup GPIO support for SDM845 SoC Lina Iyer
2018-08-17 16:38 ` [PATCH v2 1/5] drivers: pinctrl: qcom: add wakeup capability to GPIO Lina Iyer
2018-08-21 6:08 ` Bjorn Andersson
2018-08-27 16:51 ` Lina Iyer
2018-08-26 14:33 ` Linus Walleij
2018-08-27 16:56 ` Lina Iyer
2018-08-28 0:26 ` Bjorn Andersson
2018-08-28 1:46 ` Lina Iyer
2018-08-28 3:20 ` Bjorn Andersson
2018-08-17 16:38 ` [PATCH v2 2/5] dt-bindings: pinctrl: add wakeup capable GPIOs for SDM845 Lina Iyer
2018-08-17 16:38 ` [PATCH v2 3/5] drivers: pinctrl: msm: enable PDC interrupt only during suspend Lina Iyer
2018-08-17 16:38 ` [PATCH v2 4/5] drivers: pinctrl: qcom: sdm845: support GPIO wakeup from suspend Lina Iyer
2018-08-17 16:38 ` [PATCH v2 5/5] arm64: dts: qcom: add wake up interrupts for GPIOs for SDM845 Lina Iyer
2018-08-17 19:31 ` Lina Iyer [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-24 20:01 [PATCH v2 0/5] Wakeup GPIO support for SDM845 SoC Lina Iyer
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=20180817193101.GQ5081@codeaurora.org \
--to=ilina@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=evgreen@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=rnayak@codeaurora.org \
--cc=rplsssn@codeaurora.org \
--cc=sboyd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.