diff mbox

[0/2] mmc: omap_hsmmc: support SDIO cards (#2)

Message ID 4B84FA55.5040804@compulab.co.il (mailing list archive)
State Awaiting Upstream, archived
Delegated to: Tony Lindgren
Headers show

Commit Message

Mike Rapoport Feb. 24, 2010, 10:07 a.m. UTC
None
diff mbox

Patch

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);