From patchwork Thu Mar 21 15:59: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: 15486 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 C13B423E14 for ; Thu, 21 Mar 2013 16:00:25 +0000 (UTC) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by fiordland.canonical.com (Postfix) with ESMTP id 80B7BA18F8D for ; Thu, 21 Mar 2013 16:00:25 +0000 (UTC) Received: by mail-vb0-f52.google.com with SMTP id fa15so1987720vbb.39 for ; Thu, 21 Mar 2013 09:00:25 -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=PDkHnfYYV3w152HlFsY+nW5YsM7Y2zAHHkBMnXr1qWY=; b=Yg54WaPYOG+NxJ0mCdTVj6J0/R5K9afkz2rxBozPjbHkO1/FTUmNuQGaVv3Y6JlP+W 2H4nIPKuP5++TsVjmBV+xsPLYE3Cp4dFglhqPHLVH8H8IPwEOFUe2cqnfQT+irUYQazy LOAN3jO+ZUoxQxh5F2fOyR/fD8lxVe/6qwBJx2vTEyRPD+qJ4xnWxMoVkwIaUDvqRLMM chlWLCp6jepAQJCTM24zvzC2VaVImbQfYUDtENn5gEcNtr0VRSMJoJSdSJaUfiafmlRr rFcu4mSGWIZZ1Oc/sO5iEDDCkYtaLdQ5oct6S2mqPcEx5D9BuJAEkiD/BwWEoRVgxQgQ JpjQ== X-Received: by 10.58.224.101 with SMTP id rb5mr14389870vec.17.1363881624988; Thu, 21 Mar 2013 09:00:24 -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.58.233.198 with SMTP id ty6csp66765vec; Thu, 21 Mar 2013 09:00:24 -0700 (PDT) X-Received: by 10.180.79.6 with SMTP id f6mr5814349wix.26.1363881624047; Thu, 21 Mar 2013 09:00:24 -0700 (PDT) Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]) by mx.google.com with ESMTPS id b3si1442229wix.75.2013.03.21.09.00.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:24 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22e is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22e; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::22e 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 hi8so6751268wib.1 for ; Thu, 21 Mar 2013 09:00:23 -0700 (PDT) X-Received: by 10.180.185.197 with SMTP id fe5mr6039575wic.3.1363881623565; Thu, 21 Mar 2013 09:00:23 -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 h10sm6110847wic.8.2013.03.21.09.00.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:22 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones Subject: [PATCH 12/46] regulator: ab8500: Init debug from regulator driver Date: Thu, 21 Mar 2013 15:59:09 +0000 Message-Id: <1363881583-15234-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> References: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkLXNruk0Zu1Y3sBKfO8qsJg9a9USUxO1hb688+woiITqTPZgNzIYAUQEXS8S3SzS1TUpbo 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 dfe191c..74620cc 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -962,6 +962,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; @@ -1012,6 +1017,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 9a2da6a..094d24c 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h @@ -190,4 +190,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