From patchwork Sun May 11 11:28:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 4150261 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 ABE969F23C for ; Sun, 11 May 2014 11:29:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3D2A202F0 for ; Sun, 11 May 2014 11:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11D86202DD for ; Sun, 11 May 2014 11:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758064AbaEKL34 (ORCPT ); Sun, 11 May 2014 07:29:56 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:59910 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758044AbaEKL3z (ORCPT ); Sun, 11 May 2014 07:29:55 -0400 Received: by mail-vc0-f170.google.com with SMTP id lf12so7403677vcb.15 for ; Sun, 11 May 2014 04:29:55 -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=jX6Qcw4UJTM7tFfVJ+WwjwalLB2jPsXhrxbfBv9T1Ww=; b=Jbql50OnoVlxVH6lK8xcq0OeUnfxshOZUxGVA67U26EqyGhgjss55wCVN3anmvTQgd 1nLmWxZpDnufPVP8+wVPauQtBRM20IWk6q2vApwPDJ3jCCMet53YaSB7uhHjn9xiWw7U ciANhArZ38oyTGlCuUuW3ZZvOGYjWqljuxOP8YimXvx9nlhGNx6n61OO59SZZKE2CLPX PhJB4yQPTh55ukugA7favWwnGh5xzpnM+ZmU6VTH405TE39lLabRu/d3gcLy/2Td9tho yYeFNhGsL24bzhxj3lOTenPLfO8/9K1zYmBKNdWV2BWH37nKEPIK2Hw04NdnodyTfVci SvPw== X-Received: by 10.52.78.231 with SMTP id e7mr15128638vdx.28.1399807794983; Sun, 11 May 2014 04:29:54 -0700 (PDT) Received: from localhost (ip-89-176-190-91.net.upcbroadband.cz. [89.176.190.91]) by mx.google.com with ESMTPSA id bk6sm10624238vec.6.2014.05.11.04.29.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 11 May 2014 04:29:54 -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 v11 2/6] mmc: omap_hsmmc: enable wakeup event for sdio OMAP4 Date: Sun, 11 May 2014 13:28:54 +0200 Message-Id: <1399807738-32223-3-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399807738-32223-1-git-send-email-afenkart@gmail.com> References: <1399807738-32223-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=ham 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 edd53adc..4ee4645 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -93,7 +93,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 @@ -686,6 +689,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); @@ -1682,19 +1688,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: