From patchwork Thu May 8 23:20:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 4139421 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1FE55C0ACC for ; Thu, 8 May 2014 23:21:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51161202EB for ; Thu, 8 May 2014 23:21:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DCA1202E9 for ; Thu, 8 May 2014 23:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755966AbaEHXVR (ORCPT ); Thu, 8 May 2014 19:21:17 -0400 Received: from mail-ee0-f53.google.com ([74.125.83.53]:52467 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755909AbaEHXVQ (ORCPT ); Thu, 8 May 2014 19:21:16 -0400 Received: by mail-ee0-f53.google.com with SMTP id c13so2130930eek.40 for ; Thu, 08 May 2014 16:21:15 -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=25pOpZQeHqMn9rD9HQo4k35XDXJKmUVOq2wQAmftxSQ=; b=q/VmfpRYqA/8UCMiiuSvVXMX3rFjyNF6HS2ZtiP9qLdg5fRdAD2UZLttoeo6Yp65EI 4wMjy/SerrFJeYrxKuSfzwRY8oIVlHeq/FMbCFL3FgUoJHmAprAdOYIvyn36xWvKIAHe KBxkVrWZrAHgx1XFllvLNq8KPK0eM4/SLO+ACiKgKUzmD24T1A3dRwXMvGJLh/AlHhTF q8xE7c0ACAIA6k5yK4uJWgqDt277wMqmJWm+hmisiuOMatuaiE8YFyA5DhWeIcdkVHDu tJqEyrlP0E4N73yq/XLIDv8KbEWNLQoGR8AiQhEEl0JaNejaPa2EPtC8EBCIocvhaF1x 9cBA== X-Received: by 10.14.246.196 with SMTP id q44mr8763566eer.45.1399591275280; Thu, 08 May 2014 16:21:15 -0700 (PDT) Received: from localhost (13-242.62-81.cust.bluewin.ch. [81.62.242.13]) by mx.google.com with ESMTPSA id a4sm7326127eep.12.2014.05.08.16.21.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 May 2014 16:21:14 -0700 (PDT) From: Andreas Fenkart To: Tony Lindgren Cc: Chris Ball , Grant Likely , Felipe Balbi , Balaji T K , Andreas Mueller , zonque@gmail.com, galak@codeaurora.org, linux-doc@vger.kernel.org, linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v11 3/7] mmc: omap_hsmmc: enable wakeup event for sdio OMAP4 Date: Fri, 9 May 2014 01:20:30 +0200 Message-Id: <1399591234-13089-3-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399591234-13089-1-git-send-email-afenkart@gmail.com> References: <1399591018-12930-1-git-send-email-afenkart@gmail.com> <1399591234-13089-1-git-send-email-afenkart@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 From: Balaji T K To detect sdio irqs properly without spurious events, OMAP4 needs IWE in CON and CTPL, CLKEXTFREE in HCTL to be set Signed-off-by: Balaji T K diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index f43a69e..f76462d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -120,7 +120,10 @@ static void apply_clk_hack(struct device *dev) #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 @@ -713,6 +716,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); @@ -1709,19 +1715,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); /* @@ -1773,6 +1783,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: