All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balaji T K <balajitk@ti.com>
To: Andreas Fenkart <afenkart@gmail.com>
Cc: Chris Ball <cjb@laptop.org>, Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Felipe Balbi <balbi@ti.com>,
	zonque@gmail.com, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/3] mmc: omap_hsmmc: Enable SDIO IRQ.
Date: Tue, 12 Nov 2013 22:52:38 +0530	[thread overview]
Message-ID: <528263DE.2030001@ti.com> (raw)
In-Reply-To: <1384200405-8402-2-git-send-email-afenkart@gmail.com>

On Tuesday 12 November 2013 01:36 AM, Andreas Fenkart wrote:
> For now, only support SDIO interrupt if we are booted with
> DT. This is because some platforms need special quirks. And
> we don't want to add new legacy mux platform init code
> callbacks any longer as we are moving to DT based booting
> anyways.
>
> Broken hardware, missing the swakueup line, should fallback
> to polling, by setting 'ti,quirk-swakup-missing' in the
> device tree. Otherwise pending SDIO IRQ are not detected
> while in suspend. This affects am33xx processors.
>
> For the DT-Binding portion:
> Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
> Acked-by: Kumar Gala <galak@codeaurora.org>
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> ---
>   .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   18 ++++
>   drivers/mmc/host/omap_hsmmc.c                      |   86 ++++++++++++++++++--
>   2 files changed, 95 insertions(+), 9 deletions(-)
>

> +static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
> +{
> +	struct omap_hsmmc_host *host = mmc_priv(mmc);
> +	u32 irq_mask;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&host->irq_lock, flags);
> +
Hi Andreas,

Thanks for the patch,
You don't check for runtime pm status here before read/write to HSMMC registers,
can you please explain ?

> +	irq_mask = OMAP_HSMMC_READ(host->base, ISE);
> +	if (enable) {
> +		host->flags |= HSMMC_SDIO_IRQ_ENABLED;
> +		irq_mask |= CIRQ_EN;
> +	} else {
> +		host->flags &= ~HSMMC_SDIO_IRQ_ENABLED;
> +		irq_mask &= ~CIRQ_EN;
> +	}
> +	OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
> +
> +	/*
> +	 * if enable, piggy back detection on current request
> +	 * but always disable immediately
> +	 */
> +	if (!host->req_in_progress || !enable)
> +		OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
> +
> +	/* flush posted write */
> +	OMAP_HSMMC_READ(host->base, IE);
> +
> +	spin_unlock_irqrestore(&host->irq_lock, flags);
> +}
> +
>   static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
>   {
>   	u32 hctl, capa, value;
> @@ -1635,7 +1687,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
>   	.get_cd = omap_hsmmc_get_cd,
>   	.get_ro = omap_hsmmc_get_ro,
>   	.init_card = omap_hsmmc_init_card,
> -	/* NYET -- enable_sdio_irq */
> +	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
>   };
>
>   #ifdef CONFIG_DEBUG_FS
> @@ -2021,6 +2073,22 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>   		dev_warn(&pdev->dev,
>   			"pins are not configured from the driver\n");
>
> +	/*
> +	 * For now, only support SDIO interrupt if we are booted with
> +	 * DT. This is because some platforms need special quirks. And
> +	 * we don't want to add new legacy mux platform init code
> +	 * callbacks any longer as we are moving to DT based booting
> +	 * anyways.
> +	 */
> +	if (pdev->dev.of_node) {
> +		mmc->caps |= MMC_CAP_SDIO_IRQ;
> +		if (of_find_property(host->dev->of_node,
> +				     "ti,quirk-swakeup-missing", NULL)) {
> +			/* no wakeup from deeper power states, use polling */
> +			mmc->caps &= ~MMC_CAP_SDIO_IRQ;
> +		}
> +	}
> +
>   	omap_hsmmc_protect_card(host);
>
>   	mmc_add_host(mmc);
>


  parent reply	other threads:[~2013-11-12 17:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 20:06 [PATCH 0/3] mmc: omap_hsmmc: Enable SDIO IRQ Andreas Fenkart
2013-11-11 20:06 ` [PATCH 1/3] " Andreas Fenkart
     [not found]   ` <1384200405-8402-2-git-send-email-afenkart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-11-12 11:23     ` Michael Trimarchi
2013-11-12 17:22   ` Balaji T K [this message]
2013-11-14  9:09     ` Andreas Fenkart
2013-11-11 20:06 ` [PATCH 2/3] mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x Andreas Fenkart
2013-11-12 11:27   ` Michael Trimarchi
2013-11-11 20:06 ` [PATCH 3/3] mmc: omap_hsmmc: Extend debugfs for SDIO IRQ, GPIO and pinmux Andreas Fenkart
     [not found] <1384195979-14726-1-git-send-email-y>
2013-11-11 18:52 ` [PATCH 1/3] mmc: omap_hsmmc: Enable SDIO IRQ afenkart
  -- strict thread matches above, loose matches on Subject: below --
2013-11-02 20:26 Andreas Fenkart

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=528263DE.2030001@ti.com \
    --to=balajitk@ti.com \
    --cc=afenkart@gmail.com \
    --cc=balbi@ti.com \
    --cc=cjb@laptop.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=zonque@gmail.com \
    /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.