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: 1977821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 79A9ADF264 for ; Tue, 15 Jan 2013 13:08:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tv6AP-0000Pf-1v; Tue, 15 Jan 2013 13:03:01 +0000 Received: from mail-wg0-f54.google.com ([74.125.82.54]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tv64Z-0006fu-Cm for linux-arm-kernel@lists.infradead.org; Tue, 15 Jan 2013 12:57:03 +0000 Received: by mail-wg0-f54.google.com with SMTP id fg15so43132wgb.9 for ; Tue, 15 Jan 2013 04:56:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=lr2wpyfKpPB0ip8do+EKaajjJIHOgUjGk9Wi9L08wag=; b=BWG3cFZfrJB8y2P2U31zirkYCoZzzVT5nipoq66n16ljyUOH3OfXUZHJHy06ic0YMD SNnaBeSCSOhq/mPx7FuKnznfBse94AEyMWpw2/bGmygwRxDr3DYdB/1KSjIsC1vG2X1I rY+Y37R1F5QF8EfEG47SdFmRss6E4INqsiqpGOuXwuD8vKZ+Bz3WPQB3HodUGiNLZJs8 g6N366JJW5hpx+evOBWNvWG9uGgOSJuuvOSZ3+iTz3BefdI86K+zLmA4h5S59vbt5CEi BCNxIIpjMdwRR7Z/xfLpyGhpkMc8ShS5I1XPIaczZ2CVRxqLJTUEBWd6fyMZ+Voz983Y fUEQ== 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 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: ALoCoQlC37ZtVUNzdQkWScAs6JZehfntgtqSeLccwEOCDSW/CJeSHyAA2gnJTGosbVLNpX/ZEriN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130115_075700_322790_1C0DE887 X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.54 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mian Yousaf Kaukab , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de, sameo@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 */