All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <mike@compulab.co.il>
To: David Vrabel <david.vrabel@csr.com>
Cc: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org,
	madhu.cr@ti.com, Mike Rapoport <mike@compulab.co.il>
Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
Date: Wed, 24 Feb 2010 12:07:17 +0200	[thread overview]
Message-ID: <4B84FA55.5040804@compulab.co.il> (raw)
In-Reply-To: <cover.1266847842.git.david.vrabel@csr.com>

Hi David,

David Vrabel wrote:
> These patches add support for SDIO cards to the omap_hsmmc driver.
> Power management changes to prevent SDIO cards from being turned off
> and losing all state, and card interrupts.

I've tested your patches with libertas_sdio and after several small
additions I've made it work.

  drivers/mmc/host/omap_hsmmc.c |   19 +++++++++++++------
  1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 53fa85d..6ed71b7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -82,6 +82,7 @@
  #define BWR_ENABLE		(1 << 4)
  #define BRR_ENABLE		(1 << 5)
  #define CTPL			(1 << 11)
+#define CLKEXTFREE		(1 << 16)
  #define INIT_STREAM		(1 << 1)
  #define DP_SELECT		(1 << 21)
  #define DDIR			(1 << 4)
@@ -189,6 +190,7 @@ struct omap_hsmmc_host {
  	int			protect_card;
  	int			reqs_blocked;
  	int			use_reg;
+	int			sdio_int;

  	struct	omap_mmc_platform_data	*pdata;
  };
@@ -763,16 +765,19 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
  	struct mmc_data *data)
  {
  	int cmdreg = 0, resptype = 0, cmdtype = 0;
+	int int_en_mask = INT_EN_MASK;

  	dev_dbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n",
  		mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
  	host->cmd = cmd;

  	if (host->use_dma)
-		OMAP_HSMMC_WRITE(host->base, IE,
-				 INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE));
-	else
-		OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+		int_en_mask &= ~(BRR_ENABLE | BWR_ENABLE);
+
+	if (host->sdio_int)
+		int_en_mask |= CIRQ;
+
+	OMAP_HSMMC_WRITE(host->base, IE, int_en_mask);

  	host->response_busy = 0;
  	if (cmd->flags & MMC_RSP_PRESENT) {
@@ -1619,10 +1624,12 @@ static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
  	if (enable) {
  		clk_enable(host->fclk);
  		ie |= CIRQ_ENABLE;
-		con |= CTPL;
+		con |= CTPL | CLKEXTFREE;
+		host->sdio_int = 1;
  	} else {
  		ie &= ~CIRQ_ENABLE;
-		con &= ~CTPL;
+		con &= ~(CTPL | CLKEXTFREE);
+		host->sdio_int = 0;
  	}
  	OMAP_HSMMC_WRITE(host->base, CON, con);
  	OMAP_HSMMC_WRITE(host->base, IE, ie);
-- 
1.6.4.4


> I've been unable to test these exact patches as I only have an N900 for 
> testing and the N900 support in mainline is incomplete.
> 
> Changes since v1:
> - (hopefully) get all cards working again by removing a second call to
>   read MMCi_STAT in the interrupt handler.
> - flush posted writes after enabling/disabling SDIO interrupts.
> - tweak the FIXME commit on disabling FCLK to better match what really
>   going on (at least I think so anyway).
> 
> David Vrabel (2):
>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
>   mmc: omap_hsmmc: enable SDIO card interrupts
> 
>  drivers/mmc/host/omap_hsmmc.c |  114 ++++++++++++++++++++++++++++-------------
>  1 files changed, 79 insertions(+), 35 deletions(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Sincerely yours,
Mike.


  parent reply	other threads:[~2010-02-24 10:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
2010-02-22 14:24 ` [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
2010-02-22 14:24 ` [PATCH 2/2] mmc: omap_hsmmc: enable SDIO card interrupts David Vrabel
2010-02-22 14:55 ` [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) Felipe Contreras
2010-02-22 15:11   ` David Vrabel
2010-02-22 15:50     ` Felipe Contreras
2010-02-24 10:07 ` Mike Rapoport [this message]
2010-08-27 19:22 ` Chris Ball
2010-08-31  8:59   ` David Vrabel
2010-09-01 18:07     ` mike
2010-09-02  6:02     ` Mike Rapoport
2010-10-04 16:32       ` Steve Sakoman
2010-10-04 16:45         ` Madhusudhan
2010-10-04 16:57           ` Steve Sakoman
2010-10-04 17:33             ` Madhusudhan
2010-10-04 18:09               ` Steve Sakoman
2010-10-06  6:17                 ` Mike Rapoport
2010-10-06 12:55                   ` Steve Sakoman
2010-10-06 13:45                     ` Mike Rapoport
2010-10-06 15:22                       ` Steve Sakoman
2010-10-06 18:28                         ` Madhusudhan Chikkature
2010-10-06 19:02                           ` David Vrabel
2010-10-06 19:21                             ` Madhusudhan
2010-10-07  7:15                           ` Mike Rapoport
2010-10-07 13:56                             ` Steve Sakoman
2010-10-07 16:52                               ` Madhusudhan
2010-10-07 17:56                                 ` Steve Sakoman
2010-10-10  6:50                                 ` Mike Rapoport
2010-10-29 11:33                                   ` Enric Balletbò i Serra

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=4B84FA55.5040804@compulab.co.il \
    --to=mike@compulab.co.il \
    --cc=david.vrabel@csr.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=madhu.cr@ti.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.