From patchwork Tue Jan 15 12:55:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14057 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 74F3523E2E for ; Tue, 15 Jan 2013 12:56:41 +0000 (UTC) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by fiordland.canonical.com (Postfix) with ESMTP id 1F570A192FC for ; Tue, 15 Jan 2013 12:56:41 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id ft2so57192vbb.9 for ; Tue, 15 Jan 2013 04:56:40 -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=QHuLe+ZaF9RtOVGQsARtNqCQG9PoY955a8jgVx0Oh9k=; b=n8AzAqVuStQ/NvUiAfF8mTkCsGzgpvMCO6LhpQnPJYbdSQUllJCLDgCvNrAyTJBtFA wAdNYbIJTp4ix4GGxwBa8dbGF34yTnHh4dexit2VF478vOVEZhevtlPZsbSAyi5x60+I srxBRhR2/qPHBF3zsOpm4V1VaQ3cDlOhGx6iVQVHQh8p3eqvlmp9G6rO4rpAKsiRgMR8 5R3gkN+fcdl1XHHpHfqfReSSYByUsvYciAy82dixtpAs5f8NNIFKjMfxukXYBNvlpnWz z8bPXkWmXcCpaacoK/d9Yc39xrX53n+IIqZAOrR1lfI9132DyRLrFF1h+cEYiR6iXUyL ry/w== X-Received: by 10.58.74.196 with SMTP id w4mr13557670vev.7.1358254600635; Tue, 15 Jan 2013 04:56:40 -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 st5csp110598veb; Tue, 15 Jan 2013 04:56:39 -0800 (PST) X-Received: by 10.180.8.130 with SMTP id r2mr3586762wia.28.1358254599302; Tue, 15 Jan 2013 04:56:39 -0800 (PST) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id rx16si475827wjb.24.2013.01.15.04.56.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:39 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.48 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.48 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-wg0-f48.google.com with SMTP id 16so40368wgi.27 for ; Tue, 15 Jan 2013 04:56:38 -0800 (PST) X-Received: by 10.194.90.238 with SMTP id bz14mr132597409wjb.9.1358254598855; Tue, 15 Jan 2013 04:56:38 -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.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:38 -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 08/26] mfd: abx500-core: Provide an API to dump all ABx500 registers Date: Tue, 15 Jan 2013 12:55:48 +0000 Message-Id: <1358254566-12419-9-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: ALoCoQmci0y1aAm0im5ghw0DRZ79p2MHj6Yv13guS5ifs+w0Zi8kj7LWPhIFKmIMUvC0gs6AAOTv From: Mian Yousaf Kaukab Some drivers can detect subsystem failures e.g. shared memory driver can detect modem sub system failures. It would be helpful in analyzing these failures if AB register dump is available at that point. This patch adds the API for the drivers to dump AB registers in the kernel log. Signed-off-by: Lee Jones Signed-off-by: Mian Yousaf Kaukab Reviewed-by: Linus WALLEIJ Reviewed-by: Jonas ABERG --- drivers/mfd/abx500-core.c | 16 ++++++++++++++++ include/linux/mfd/abx500.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c index 7ce65f4..9818afb 100644 --- a/drivers/mfd/abx500-core.c +++ b/drivers/mfd/abx500-core.c @@ -153,6 +153,22 @@ int abx500_startup_irq_enabled(struct device *dev, unsigned int irq) } EXPORT_SYMBOL(abx500_startup_irq_enabled); +void abx500_dump_all_banks(void) +{ + struct abx500_ops *ops; + struct device dummy_child = {0}; + struct abx500_device_entry *dev_entry; + + list_for_each_entry(dev_entry, &abx500_list, list) { + dummy_child.parent = dev_entry->dev; + ops = &dev_entry->ops; + + if ((ops != NULL) && (ops->dump_all_banks != NULL)) + ops->dump_all_banks(&dummy_child); + } +} +EXPORT_SYMBOL(abx500_dump_all_banks); + MODULE_AUTHOR("Mattias Wallin "); MODULE_DESCRIPTION("ABX500 core driver"); MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 5d5298d..2667af4 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h @@ -326,6 +326,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, int abx500_get_chip_id(struct device *dev); int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); +void abx500_dump_all_banks(void); struct abx500_ops { int (*get_chip_id) (struct device *); @@ -336,6 +337,7 @@ struct abx500_ops { int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); int (*event_registers_startup_state_get) (struct device *, u8 *); int (*startup_irq_enabled) (struct device *, unsigned int); + void (*dump_all_banks) (struct device *); }; int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);