From patchwork Sat Oct 5 11:17:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 2990991 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 A92EFBF924 for ; Sat, 5 Oct 2013 11:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2201B201FA for ; Sat, 5 Oct 2013 11:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34E84201F4 for ; Sat, 5 Oct 2013 11:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592Ab3JELUA (ORCPT ); Sat, 5 Oct 2013 07:20:00 -0400 Received: from mail-ee0-f49.google.com ([74.125.83.49]:64431 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371Ab3JELT6 (ORCPT ); Sat, 5 Oct 2013 07:19:58 -0400 Received: by mail-ee0-f49.google.com with SMTP id d41so2213781eek.8 for ; Sat, 05 Oct 2013 04:19:56 -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=WKJkPW9bMZFZfFYYNpC95lZ6ZXMLNmYNyhGWwPKNaAE=; b=ygZq+GScQzgToqy20G9ieQiJyxbgG5XkYQTU5uO5RaleM0+JGcPwgGk1Y0wTuKWfWz CK1O0ZUFougoqCXK5x7D6laYEcb8jUFBt57EZWYlUaNVyYc4ZlOKzFY8ehRQWjGH/vKO eRYqqVdLAWOPtvVPm+Hjp9RRsDU2f8tOUocmYqBErax6t0NdrPenprtOYsv5+CNN1WXN dRMcWB29ynT3kRtsT1jgYhu5yt2Jw6+s7Jy4+Prv3LkhZWkdsw65XWrnQIBZUuQaLVzV q/hRwqJFfJetVeCvI8QL2RYeQYmf+td65FcxWcNYF0kIM78v2b3UYLKxKMc8vmbDpU5x MNjw== X-Received: by 10.14.178.67 with SMTP id e43mr2069646eem.59.1380971996274; Sat, 05 Oct 2013 04:19:56 -0700 (PDT) Received: from localhost (ip-89-176-190-241.net.upcbroadband.cz. [89.176.190.241]) by mx.google.com with ESMTPSA id h52sm38697470eez.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 05 Oct 2013 04:19:55 -0700 (PDT) From: Andreas Fenkart To: Chris Ball Cc: Tony Lindgren , Grant Likely , Felipe Balbi , Venkatraman S , Balaji T K , zonque@gmail.com, devicetree-discuss@lists.ozlabs.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Fenkart Subject: [PATCH v3 4/4] mmc: omap_hsmmc: debugfs entries for SDIO IRQ detection and GPIO remuxing. Date: Sat, 5 Oct 2013 13:17:10 +0200 Message-Id: <1380971830-21492-5-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1380971830-21492-1-git-send-email-afenkart@gmail.com> References: <1380971830-21492-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=-6.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, 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 Update the debugfs related code for the SDIO IRQ support. Note that PSTATE shows current state of data lines, incl. SDIO IRQ pending Signed-off-by: Andreas Fenkart diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index a8894ee..f7fe06f 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -81,6 +81,7 @@ static void apply_clk_hack(struct device *dev) #define OMAP_HSMMC_RSP54 0x0118 #define OMAP_HSMMC_RSP76 0x011C #define OMAP_HSMMC_DATA 0x0120 +#define OMAP_HSMMC_PSTATE 0x0124 #define OMAP_HSMMC_HCTL 0x0128 #define OMAP_HSMMC_SYSCTL 0x012C #define OMAP_HSMMC_STAT 0x0130 @@ -1812,6 +1813,22 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data) { struct mmc_host *mmc = s->private; struct omap_hsmmc_host *host = mmc_priv(mmc); + unsigned long flags; + + spin_lock_irqsave(&host->irq_lock, flags); + seq_puts(s, "\n"); + seq_printf(s, "sdio irq\t%s\n", ((host->flags & HSMMC_SDIO_IRQ_ENABLED) + ? "enabled" : "disabled")); + if (host->flags & HSMMC_SWAKEUP_QUIRK) { + seq_printf(s, "pinmux config\t%s\n", ((host->flags & + HSMMC_RUNTIME_SUSPENDED) + ? "gpio" : "sdio")); + if (host->flags & HSMMC_RUNTIME_SUSPENDED) + seq_printf(s, "sdio irq pin\t%s\n", + gpio_get_value(mmc_slot(host).gpio_cirq) ? + "high" : "low"); + } + spin_unlock_irqrestore(&host->irq_lock, flags); if (host->suspended) { seq_printf(s, "host suspended, can't read registers\n"); @@ -1819,9 +1836,11 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data) } pm_runtime_get_sync(host->dev); - + seq_puts(s, "\nregs:\n"); seq_printf(s, "CON:\t\t0x%08x\n", OMAP_HSMMC_READ(host->base, CON)); + seq_printf(s, "PSTATE:\t\t0x%08x\n", + OMAP_HSMMC_READ(host->base, PSTATE)); seq_printf(s, "HCTL:\t\t0x%08x\n", OMAP_HSMMC_READ(host->base, HCTL)); seq_printf(s, "SYSCTL:\t\t0x%08x\n",