From patchwork Tue Jan 15 12:55:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14067 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 04E4623E2E for ; Tue, 15 Jan 2013 12:56:59 +0000 (UTC) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by fiordland.canonical.com (Postfix) with ESMTP id B66A5A1931C for ; Tue, 15 Jan 2013 12:56:58 +0000 (UTC) Received: by mail-vc0-f174.google.com with SMTP id d16so54725vcd.33 for ; Tue, 15 Jan 2013 04:56:58 -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=lr2wpyfKpPB0ip8do+EKaajjJIHOgUjGk9Wi9L08wag=; b=kX5OL7tpQU4JIS3jz+wuu6okfBAVmpKq86W7uZxfOFBHNh0Jko/j0kOL1FPBtXz5yk rfL8IZ3prVO9u0qTPEry1nPoo92K+qatpkW8eudycyoNk4OncFN1KsiuE2iuYazTQ+QJ lJKM4G6hPKwecVTLG/bxAb+QYB1qWO2WnBS8chAHAAsltcwxtnfLIUEslk2Sw8+u8LCM 1PcA5BF6+ugrkrBnxJCbfoRoMVeoiBKixxpQplshIHIWdgg9SU2AJ8JfaiTPF65dA0f0 eS2THCkPV7/9Ap55Z/z08i0s0BhjR8rKT4R9wqLvOjXVfgTZ9fCx1bkooWA0+bZ1pWoR gyBQ== X-Received: by 10.220.157.9 with SMTP id z9mr105717730vcw.45.1358254618265; Tue, 15 Jan 2013 04:56:58 -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.58.145.101 with SMTP id st5csp110623veb; Tue, 15 Jan 2013 04:56:57 -0800 (PST) X-Received: by 10.194.174.234 with SMTP id bv10mr26252828wjc.47.1358254617322; Tue, 15 Jan 2013 04:56:57 -0800 (PST) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx.google.com with ESMTPS id cu9si3393612wib.3.2013.01.15.04.56.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.182 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.182; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.182 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-f182.google.com with SMTP id hn14so59870wib.15 for ; Tue, 15 Jan 2013 04:56:56 -0800 (PST) X-Received: by 10.194.90.238 with SMTP id bz14mr132598959wjb.9.1358254616924; Tue, 15 Jan 2013 04:56:56 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id eo10sm3672833wib.9.2013.01.15.04.56.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:56 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, sameo@linux.intel.com, Mian Yousaf Kaukab , Lee Jones Subject: [PATCH 18/26] mfd: ab8500-core: Allow the possibility to dump all AB8500 registers Date: Tue, 15 Jan 2013 12:55:58 +0000 Message-Id: <1358254566-12419-19-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358254566-12419-1-git-send-email-lee.jones@linaro.org> References: <1358254566-12419-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQn91Nk/4LNNWKXQDMTKOT8UyiadBhIosC470C2Jx55SYnLckzjIJznVK7nO7gh8BRFmc7lC From: Mian Yousaf Kaukab Implement an API so that a user may dump all AB8500 registers via debugfs file access. Signed-off-by: Lee Jones Signed-off-by: Mian Yousaf Kaukab Reviewed-by: Linus WALLEIJ Reviewed-by: Jonas ABERG --- drivers/mfd/ab8500-core.c | 1 + drivers/mfd/ab8500-debugfs.c | 13 +++++++++++++ include/linux/mfd/abx500/ab8500.h | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 1667c77..0f84fc0 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -319,6 +319,7 @@ static struct abx500_ops ab8500_ops = { .mask_and_set_register = ab8500_mask_and_set_register, .event_registers_startup_state_get = NULL, .startup_irq_enabled = NULL, + .dump_all_banks = ab8500_dump_all_banks, }; static void ab8500_irq_lock(struct irq_data *data) diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index a1ce55e..ec57e43 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -581,6 +581,19 @@ static int ab8500_print_all_banks(struct seq_file *s, void *p) return 0; } +/* Dump registers to kernel log */ +void ab8500_dump_all_banks(struct device *dev) +{ + unsigned int i; + + printk(KERN_INFO"ab8500 register values:\n"); + + for (i = 1; i < AB8500_NUM_BANKS; i++) { + printk(KERN_INFO" bank %u:\n", i); + ab8500_registers_print(dev, i, NULL); + } +} + static int ab8500_all_banks_open(struct inode *inode, struct file *file) { struct seq_file *s; diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 3f4e6d1..4c8d966 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -345,4 +345,10 @@ static inline int is_ab8500_2p0(struct ab8500 *ab) return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); } +#ifdef CONFIG_AB8500_DEBUG +void ab8500_dump_all_banks(struct device *dev); +#else +static inline void ab8500_dump_all_banks(struct device *dev) {} +#endif + #endif /* MFD_AB8500_H */