From patchwork Fri Feb 15 12:56:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14898 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6FF8723E01 for ; Fri, 15 Feb 2013 12:57:48 +0000 (UTC) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by fiordland.canonical.com (Postfix) with ESMTP id 12AE2A18025 for ; Fri, 15 Feb 2013 12:57:47 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so2154240vba.41 for ; Fri, 15 Feb 2013 04:57:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=MvqGJXgBfhjOYJM4Yy6SEASazX1QZGlD5LKbyjU/77I=; b=N78TkYJ3TTlJrZHZLzU7VRP3XqHzft6sNRf/YOjCFXf1RMoUoJjOhhH5uiNRX+wk7h JsL/jT0mLe17TwWRq0UUGNib5hatSefZlaWFIob9RggnTQmhWs9CrRm+tADHdMuN2Va4 O8f+JqikxmP/2nHODQdOHazU6FIa6fW+p0isgaChXgtAqQnkTeJx/MAQonKzSjTCXhK0 sZJKH4eqTRSjKrQ9eu+Yb7Wqv+aLT+Yiqbex7vmuiJAlz2/SAZ3K8T4lR4Z1CBK9wLLd RhzOeB+SA5WRiXx4q5NsDu+xBgFjR4RgzjViRW4HRoHDX6Ngce7inpBTcC7E1HC8nfZG KedA== X-Received: by 10.220.142.71 with SMTP id p7mr2981266vcu.3.1360933067569; Fri, 15 Feb 2013 04:57:47 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp11379vcb; Fri, 15 Feb 2013 04:57:47 -0800 (PST) X-Received: by 10.180.97.166 with SMTP id eb6mr5712197wib.20.1360933066724; Fri, 15 Feb 2013 04:57:46 -0800 (PST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx.google.com with ESMTPS id bn10si19394017wjb.150.2013.02.15.04.57.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.174 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.174; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.174 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f174.google.com with SMTP id hi8so1111001wib.7 for ; Fri, 15 Feb 2013 04:57:46 -0800 (PST) X-Received: by 10.180.98.232 with SMTP id el8mr2310466wib.22.1360933066290; Fri, 15 Feb 2013 04:57:46 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.57.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:45 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Jonas Aaberg , Lee Jones Subject: [PATCH 13/35] mfd: ab8500-debug: Add wake-up info Date: Fri, 15 Feb 2013 12:56:44 +0000 Message-Id: <1360933026-30325-14-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlBbHbIPGjexXwH4WcM8kXuCm7dXjHSfJ6eJvY3fkpIHij7Le9H67KP3mGixsRwwZdPRRwQ From: Jonas Aaberg Add information regarding what ab interrupt that caused a wake-up from suspend in /ab8500/interrupts. Also print the name of the interrupts, not just the numbers. Signed-off-by: Jonas Aaberg Signed-off-by: Lee Jones Reviewed-by: Per FORLIN Tested-by: Mattias WALLIN --- drivers/mfd/ab8500-debugfs.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 8b15fc2..51b0e97 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -80,6 +80,7 @@ #include #include #include +#include #include #include @@ -802,22 +803,46 @@ static ssize_t ab8500_val_write(struct file *file, * Interrupt status */ static u32 num_interrupts[AB8500_MAX_NR_IRQS]; +static u32 num_wake_interrupts[AB8500_MAX_NR_IRQS]; static int num_interrupt_lines; +bool __attribute__((weak)) suspend_test_wake_cause_interrupt_is_mine(u32 my_int) +{ + return false; +} + void ab8500_debug_register_interrupt(int line) { - if (line < num_interrupt_lines) + if (line < num_interrupt_lines) { num_interrupts[line]++; + if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500)) + num_wake_interrupts[line]++; + } } static int ab8500_interrupts_print(struct seq_file *s, void *p) { int line; - seq_printf(s, "irq: number of\n"); + seq_printf(s, "name: number: number of: wake:\n"); + + for (line = 0; line < num_interrupt_lines; line++) { + struct irq_desc *desc = irq_to_desc(line + irq_first); + struct irqaction *action = desc->action; - for (line = 0; line < num_interrupt_lines; line++) - seq_printf(s, "%3i: %6i\n", line, num_interrupts[line]); + seq_printf(s, "%3i: %6i %4i", line, + num_interrupts[line], + num_wake_interrupts[line]); + + if (desc && desc->name) + seq_printf(s, "-%-8s", desc->name); + if (action) { + seq_printf(s, " %s", action->name); + while ((action = action->next) != NULL) + seq_printf(s, ", %s", action->name); + } + seq_putc(s, '\n'); + } return 0; } @@ -1869,7 +1894,7 @@ static int ab8500_debug_probe(struct platform_device *plf) dev_err(&plf->dev, "Last irq not found, err %d\n", irq_last); ret = irq_last; - goto out_freeevent_name; + goto out_freeevent_name; } ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);