From patchwork Mon Feb 4 11:53:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14472 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 D7BD723F96 for ; Mon, 4 Feb 2013 11:56:31 +0000 (UTC) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by fiordland.canonical.com (Postfix) with ESMTP id 9F31FA18F62 for ; Mon, 4 Feb 2013 11:56:31 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id cy12so2062537veb.34 for ; Mon, 04 Feb 2013 03:56:31 -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=h0ZSIuNYBasV4/fj2QKPT1Ll77nrtMppXfnEzejUaJQ=; b=QsuDFMPXyt+NP/RmIram8Vf8QYk7BN8PMn07DEE5+lY9ThFeeW8Huq7kmk1rtcKDwG E28mWl7XQG3x47awhJP9mCoT7eZVxo1EARDtgtgyESydjz/WaAewFje0sWoexqU2Ijpk IRT9MW2s6DwzIi5josAnZUteAmkZOzCoa40MrpcpN7v+oQiyBqSf9LQZ2awG/QZOIJpS BIe/hc5vQc+yION7+759cNjwyi9xSPgmYtEvsbngUSOMxF4jKiiwRBnA+n36d1Vs1OLF XQmRnaRLexBGxp203E39jd3QdCQgTQaEh/dL6Gw6e/Gzcd4jjf9xgtY2fR5FL7nWMHJC vzkg== X-Received: by 10.52.21.146 with SMTP id v18mr18929748vde.79.1359978991174; Mon, 04 Feb 2013 03:56:31 -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.252.8 with SMTP id zo8csp83054vec; Mon, 4 Feb 2013 03:56:30 -0800 (PST) X-Received: by 10.194.108.229 with SMTP id hn5mr34792303wjb.8.1359978990368; Mon, 04 Feb 2013 03:56:30 -0800 (PST) Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]) by mx.google.com with ESMTPS id uz4si5707787wjc.251.2013.02.04.03.56.30 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:56:30 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::230 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::230; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::230 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-f176.google.com with SMTP id s43so4836549wey.35 for ; Mon, 04 Feb 2013 03:56:30 -0800 (PST) X-Received: by 10.195.13.11 with SMTP id eu11mr34709815wjd.39.1359978989973; Mon, 04 Feb 2013 03:56:29 -0800 (PST) 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 j9sm12937128wia.5.2013.02.04.03.56.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:56:28 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones , Bengt Jonsson Subject: [PATCH 23/73] regulator: ab8500: Init debug from regulator driver Date: Mon, 4 Feb 2013 11:53:38 +0000 Message-Id: <1359978868-28736-24-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> References: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlGwpPfvAJ98wRi5ghHw0tE0hdteT5GwBrcTQFC9YDXyF7zLEQJ99V1CV27lxiYZGZW4XEs 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: Bengt Jonsson Signed-off-by: Lee Jones Reviewed-by: Jonas ABERG --- 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 0e3dd64..406c561 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -998,6 +998,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; @@ -1048,6 +1053,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