From patchwork Fri May 23 08:30:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 4228941 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47A969F381 for ; Fri, 23 May 2014 08:31:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75B162017D for ; Fri, 23 May 2014 08:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C2A62038F for ; Fri, 23 May 2014 08:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbaEWIbr (ORCPT ); Fri, 23 May 2014 04:31:47 -0400 Received: from mail-ee0-f50.google.com ([74.125.83.50]:53235 "EHLO mail-ee0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbaEWIbp (ORCPT ); Fri, 23 May 2014 04:31:45 -0400 Received: by mail-ee0-f50.google.com with SMTP id e51so3360381eek.23 for ; Fri, 23 May 2014 01:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q7VWuvdTdF8XIfTeGX4OzbOeLL4R2CTZckH2GFUt78E=; b=PBg+NgE2fsNg0ni5y66AjTtWtPD+81EN3bRcuTWs0ZPZkd5/ByJXaStkRDpzB+jLGF Hb29dnOb0BQZ2YESaFYOh8x5oyqhadpTfwkfmA9pr+pUAAeroT1z6K3+I9r1bQ2sS0lp +segkLbSU5JykMJsT/Nndgczl43RRnr/pvWeqgUeiwSoJPcX/qdNRKSA/XUNMY+8aev8 P2lCaJxToCf3Ns0ppLRafWBPTrafcMWQxRgTEMVfpUz8A7s4KU7zg1maFnxxvMeXCBCo PIwC7As/KqjHUQ/74Dgj0j3NMlp3UA1G9BztRDqiVAxKXtPuFTEFOQDNzWerWQPMpu5u 4lYA== X-Received: by 10.14.10.5 with SMTP id 5mr1678374eeu.78.1400833904282; Fri, 23 May 2014 01:31:44 -0700 (PDT) Received: from localhost (ip-89-176-190-91.net.upcbroadband.cz. [89.176.190.91]) by mx.google.com with ESMTPSA id x3sm6587812een.17.2014.05.23.01.31.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 May 2014 01:31:43 -0700 (PDT) From: Andreas Fenkart To: Tony Lindgren Cc: Chris Ball , Grant Likely , Felipe Balbi , Balaji T K , Andreas Mueller , Sebastian Reichel , zonque@gmail.com, galak@codeaurora.org, linux-doc@vger.kernel.org, linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Fenkart Subject: [PATCH v13 4/7] mmc: omap_hsmmc: enable wakeup event for sdio OMAP4 Date: Fri, 23 May 2014 10:30:31 +0200 Message-Id: <1400833834-15893-5-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1400833834-15893-1-git-send-email-afenkart@gmail.com> References: <1400833834-15893-1-git-send-email-afenkart@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To detect sdio irqs properly without spurious events, OMAP4 needs IWE in CON and CTPL, CLKEXTFREE in HCTL to be set Tested-by: Andreas Fenkart Signed-off-by: Balaji T K diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index cfd2bfb..dfc593e 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -94,7 +94,10 @@ #define BCE (1 << 1) #define FOUR_BIT (1 << 1) #define HSPE (1 << 2) +#define IWE (1 << 24) #define DDR (1 << 19) +#define CLKEXTFREE (1 << 16) +#define CTPL (1 << 11) #define DW8 (1 << 5) #define OD 0x1 #define STAT_CLEAR 0xFFFFFFFF @@ -689,6 +692,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) capa = VS18; } + if (host->mmc->caps & MMC_CAP_SDIO_IRQ) + hctl |= IWE; + OMAP_HSMMC_WRITE(host->base, HCTL, OMAP_HSMMC_READ(host->base, HCTL) | hctl); @@ -1681,19 +1687,23 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) { struct omap_hsmmc_host *host = mmc_priv(mmc); - u32 irq_mask; + u32 irq_mask, con; unsigned long flags; spin_lock_irqsave(&host->irq_lock, flags); + con = OMAP_HSMMC_READ(host->base, CON); irq_mask = OMAP_HSMMC_READ(host->base, ISE); if (enable) { host->flags |= HSMMC_SDIO_IRQ_ENABLED; irq_mask |= CIRQ_EN; + con |= CTPL | CLKEXTFREE; } else { host->flags &= ~HSMMC_SDIO_IRQ_ENABLED; irq_mask &= ~CIRQ_EN; + con &= ~(CTPL | CLKEXTFREE); } + OMAP_HSMMC_WRITE(host->base, CON, con); OMAP_HSMMC_WRITE(host->base, IE, irq_mask); /* @@ -1744,6 +1754,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host) goto err; } + OMAP_HSMMC_WRITE(host->base, HCTL, + OMAP_HSMMC_READ(host->base, HCTL) | IWE); return 0; err: