From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Tony Lindgren <tony@atomide.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
Chunyan Zhang <zhang.chunyan@linaro.org>,
Faiz Abbas <faiz_abbas@ti.com>,
Kishon Vijay Abraham I <kishon@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
<linux-mmc@vger.kernel.org>, <linux-omap@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH 5/5] mmc: sdhci-omap: Configure optional wakeirq
Date: Wed, 22 Sep 2021 18:23:10 +0300 [thread overview]
Message-ID: <eafa3743-1f73-8a6e-bcb4-d97405dcdb11@ti.com> (raw)
In-Reply-To: <20210921111600.24577-6-tony@atomide.com>
On 21/09/2021 14:16, Tony Lindgren wrote:
> Configure optional wakeirq. This may be optionally configured for SDIO
> dat1 pin for wake-up events for SoCs that support deeper idle states.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/mmc/host/sdhci-omap.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -12,8 +12,10 @@
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/of_device.h>
> +#include <linux/of_irq.h>
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
> +#include <linux/pm_wakeirq.h>
> #include <linux/regulator/consumer.h>
> #include <linux/pinctrl/consumer.h>
> #include <linux/sys_soc.h>
> @@ -117,6 +119,7 @@ struct sdhci_omap_host {
>
> struct pinctrl *pinctrl;
> struct pinctrl_state **pinctrl_state;
> + int wakeirq;
> unsigned long context_valid:1;
> unsigned long is_runtime_suspended:1;
> unsigned long needs_resume:1;
> @@ -1360,6 +1363,21 @@ static int sdhci_omap_probe(struct platform_device *pdev)
> sdhci_omap_context_save(omap_host);
> omap_host->context_valid = 1;
>
> + of_irq_get_byname(dev->of_node, "wakeup");
No assign to omap_host->wakeirq
> + if (omap_host->wakeirq == -EPROBE_DEFER) {
> + ret = -EPROBE_DEFER;
> + goto err_cleanup_host;
> + }
> + if (omap_host->wakeirq > 0) {
> + device_init_wakeup(dev, true);
> + ret = dev_pm_set_dedicated_wake_irq(dev, omap_host->wakeirq);
> + if (ret) {
> + device_init_wakeup(dev, false);
> + goto err_cleanup_host;
> + }
> + host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
> + }
> +
> pm_runtime_put_sync(dev);
>
> return 0;
> @@ -1385,6 +1403,7 @@ static int sdhci_omap_remove(struct platform_device *pdev)
>
> pm_runtime_get_sync(dev);
> sdhci_remove_host(host, true);
> + dev_pm_clear_wake_irq(dev);
> pm_runtime_put_sync(dev);
> pm_runtime_disable(dev);
> sdhci_pltfm_free(pdev);
>
--
Best regards,
grygorii
next prev parent reply other threads:[~2021-09-22 15:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 11:15 [PATCH 0/5] More SoCs for sdhci-omap to deprecate omap_hsmmc Tony Lindgren
2021-09-21 11:15 ` [PATCH 1/5] dt-bindings: sdhci-omap: Update binding for legacy SoCs Tony Lindgren
2021-09-23 22:30 ` Rob Herring
2021-09-21 11:15 ` [PATCH 2/5] mmc: sdhci-omap: Handle voltages to add support omap4 Tony Lindgren
2021-09-21 11:15 ` [PATCH 3/5] mmc: sdhci-omap: Add omap_offset to support omap3 and earlier Tony Lindgren
2021-09-21 11:15 ` [PATCH 4/5] mmc: sdhci-omap: Implement PM runtime functions Tony Lindgren
2021-09-21 11:16 ` [PATCH 5/5] mmc: sdhci-omap: Configure optional wakeirq Tony Lindgren
2021-09-22 15:23 ` Grygorii Strashko [this message]
2021-09-23 5:33 ` Tony Lindgren
2021-09-24 7:08 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2021-09-30 6:57 [PATCHv2 0/5] More SoCs for sdhci-omap to deprecate omap_hsmmc Tony Lindgren
2021-09-30 6:57 ` [PATCH 5/5] mmc: sdhci-omap: Configure optional wakeirq Tony Lindgren
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=eafa3743-1f73-8a6e-bcb4-d97405dcdb11@ti.com \
--to=grygorii.strashko@ti.com \
--cc=adrian.hunter@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=faiz_abbas@ti.com \
--cc=kishon@ti.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=ssantosh@kernel.org \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
--cc=zhang.chunyan@linaro.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