From patchwork Mon Nov 11 18:52:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 3169261 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 C0B6AC045B for ; Mon, 11 Nov 2013 18:57:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08CD5203DB for ; Mon, 11 Nov 2013 18:57:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22F2F20177 for ; Mon, 11 Nov 2013 18:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755162Ab3KKS5H (ORCPT ); Mon, 11 Nov 2013 13:57:07 -0500 Received: from mail-ea0-f169.google.com ([209.85.215.169]:43867 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754941Ab3KKS5F (ORCPT ); Mon, 11 Nov 2013 13:57:05 -0500 Received: by mail-ea0-f169.google.com with SMTP id l9so168446eaj.28 for ; Mon, 11 Nov 2013 10:57:04 -0800 (PST) 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=AdTuRXSsADIDZ0/EHV79jztd0LAyyO85io9loq/8HtQ=; b=zhE7b8NI7Cj7YJSHVohIuZIgegYRwz6kBpUjwWSJHOZ7G4+f4YuPcj8MiyG1l6S6JE 8b1VN0XmSencnVXs3/buGUxuFqB8nxX9Aci4hCiV1BkA4xM88s0V0M++g4cIlyZjQKab sK+JQuNAruL5J+IKgf7c71lSpDl1gIOBI8aeu/8rryBsyn6iI5pBQ9OBwPvvkQitLLva UnAAG51ObXZwZ8Yqy8m2QxN+gd82vq3u0Ti16rrLfHF13DhK1PqdevyZygtY7u5LkBod U27CSMrUAHXPKH+htz/tO8606kk7pCQEyk4yRBefw0uGZhiV+u+ersPSgFaEj3VjSz67 0cvw== X-Received: by 10.15.111.13 with SMTP id ci13mr13190eeb.136.1384196224259; Mon, 11 Nov 2013 10:57:04 -0800 (PST) Received: from localhost (cust.static.84-253-15-149.cybernet.ch. [84.253.15.149]) by mx.google.com with ESMTPSA id z1sm66225434eeo.14.2013.11.11.10.56.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 11 Nov 2013 10:57:03 -0800 (PST) From: afenkart@gmail.com To: Chris Ball Cc: Tony Lindgren , Grant Likely , Felipe Balbi , Balaji T K , zonque@gmail.com, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Fenkart Subject: [PATCH 3/3] mmc: omap_hsmmc: Extend debugfs for SDIO IRQ, GPIO and pinmux. Date: Mon, 11 Nov 2013 19:52:59 +0100 Message-Id: <5281287f.01d50e0a.1189.74ea@mx.google.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1384195979-14726-1-git-send-email-y> References: <1384195979-14726-1-git-send-email-y> 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.8 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: Andreas Fenkart Add SDIO IRQ entries to debugfs entry. Note that PSTATE shows current state of data lines, incl. SDIO IRQ pending Signed-off-by: Andreas Fenkart --- drivers/mmc/host/omap_hsmmc.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index e880b44..34e2ee0 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 @@ -1800,6 +1801,23 @@ 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; + bool suspended; + + 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")); + suspended = host->dev->power.runtime_status != RPM_ACTIVE; + if (host->flags & HSMMC_SWAKEUP_QUIRK) { + seq_printf(s, "pinmux config\t%s\n", (suspended ? + "gpio" : "sdio")); + if (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"); @@ -1807,9 +1825,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",