From patchwork Thu Mar 28 16:11:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15729 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 DA21523E10 for ; Thu, 28 Mar 2013 16:12:12 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 94819A184BD for ; Thu, 28 Mar 2013 16:12:12 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id ox1so3633768veb.7 for ; Thu, 28 Mar 2013 09:12:12 -0700 (PDT) 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=o208zvYMGZS3J6A0eM4QitLUSP/ydFaisJEnR8CMdh8=; b=feYMTbJgdCKahy0K+KfDdbtAW00J1c/lEwHT00tCrkAO8rxcAmLY0csVkEzVmeCMfE cKPfwWfq++NW59U8j9okR3ri1CMMq4ieVARg1u5pDpi05lbkLSPGm/QRwNGCvr76wvnv M2Hu2Ebva15LPcXOhGmAhA7OQFGISyH2TYKMFXrRzAz771zIFU3Fq8HH1B4MAEZGxQmM XGIXngKtSTZVMGhhmoDvrmvHLjESXT24VZNACrL+8qkwBg37/TiZBpEZxlIQ7nL/HFqQ VzQwmxv1m7ijvinNSPA9lLhwJ7QCUhMHDVRfBWyQpIA0AnXKY6cm0vwiDUC0nFVZ6ECk /Smg== X-Received: by 10.220.154.199 with SMTP id p7mr27971046vcw.46.1364487132081; Thu, 28 Mar 2013 09:12:12 -0700 (PDT) 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.59.4.204 with SMTP id cg12csp22400ved; Thu, 28 Mar 2013 09:12:11 -0700 (PDT) X-Received: by 10.180.79.227 with SMTP id m3mr17419093wix.12.1364487130721; Thu, 28 Mar 2013 09:12:10 -0700 (PDT) Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]) by mx.google.com with ESMTPS id uc6si10114376wjc.73.2013.03.28.09.12.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:10 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::232 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::232; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::232 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-we0-f178.google.com with SMTP id z53so3496972wey.37 for ; Thu, 28 Mar 2013 09:12:10 -0700 (PDT) X-Received: by 10.180.189.17 with SMTP id ge17mr17470375wic.17.1364487127711; Thu, 28 Mar 2013 09:12:07 -0700 (PDT) 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 o5sm16765926wix.3.2013.03.28.09.12.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:12:06 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones Subject: [PATCH 09/33] regulator: ab8500: Init debug from regulator driver Date: Thu, 28 Mar 2013 16:11:09 +0000 Message-Id: <1364487093-19551-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364487093-19551-1-git-send-email-lee.jones@linaro.org> References: <1364487093-19551-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnQB3Me/QP/dWRCC7xNY6wy5oDzqIU3wfjCeW5JeiiaS/NVl0kU1ntGt+VcA370jt447Bx2 The purpose of this patch is to guarantee that ab8500-debug will record the regulator registers before they are modified by the ab8500 regulator driver. Signed-off-by: Lee Jones --- drivers/regulator/ab8500.c | 10 ++++++++++ include/linux/regulator/ab8500.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 4d88a60..bf34c4c 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -911,6 +911,11 @@ static int ab8500_regulator_probe(struct platform_device *pdev) return -EINVAL; } + /* initialize debug (initial state is recorded with this call) */ + err = ab8500_regulator_debug_init(pdev); + if (err) + return err; + /* initialize registers */ for (i = 0; i < pdata->num_reg_init; i++) { int id, mask, value; @@ -961,6 +966,11 @@ static int ab8500_regulator_remove(struct platform_device *pdev) if (err) return err; + /* remove regulator debug */ + err = ab8500_regulator_debug_exit(pdev); + if (err) + return err; + return 0; } diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index b86e089..592a3f3 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h @@ -178,4 +178,18 @@ inline int ab8500_ext_regulator_exit(struct platform_device *pdev) } #endif +#ifdef CONFIG_REGULATOR_AB8500_DEBUG +int ab8500_regulator_debug_init(struct platform_device *pdev); +int ab8500_regulator_debug_exit(struct platform_device *pdev); +#else +static inline int ab8500_regulator_debug_init(struct platform_device *pdev) +{ + return 0; +} +static inline int ab8500_regulator_debug_exit(struct platform_device *pdev) +{ + return 0; +} +#endif + #endif