From patchwork Wed Feb 6 10:53:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14590 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 3401C2423C for ; Wed, 6 Feb 2013 10:55:11 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id DEDBAA187B7 for ; Wed, 6 Feb 2013 10:55:10 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id p16so747411vcq.1 for ; Wed, 06 Feb 2013 02:55:10 -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=Bd95lshUdqQBtWKdzZUCL6PVk5zs0q86UlzYjYLAfwU=; b=lfY8cIWAXcp3xmg9cuOuXtJ3+1WnzRb2nNtH9bC0e8qAg0DEx0IDfX0T7x4Nk0bYKs SjP+ZZiK0ekKhaJMnHAlFhZ8l7zvxMq5a8YWmnoCiCwZmMpwLgno059+ZjVRIAeeL12e ainTQ43MQ1sGHBwYQanaYWF93rytt3oo5lU/kPygnBWf37ZQlKuUlik3kEB3+nrWBhnz PXHgWXE80d91OW2RCfoEhW9R2BC9zP0fCWZGUDW+M1H6NvLopZcuBqkg1vmlCNRxe6qb lgO1kXiSQDoZCY67bFyS6AlzNDIwQSM7Yz9LdArlQl7y/tLt85m1Ku5ShNXDKdSxdjfd EIig== X-Received: by 10.220.219.204 with SMTP id hv12mr31411738vcb.71.1360148110406; Wed, 06 Feb 2013 02:55:10 -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 zo8csp12944vec; Wed, 6 Feb 2013 02:55:09 -0800 (PST) X-Received: by 10.194.238.226 with SMTP id vn2mr48647063wjc.23.1360148093469; Wed, 06 Feb 2013 02:54:53 -0800 (PST) Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]) by mx.google.com with ESMTPS id k10si512062wiz.39.2013.02.06.02.54.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:54:53 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::233 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::233; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::233 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-f179.google.com with SMTP id x43so999030wey.38 for ; Wed, 06 Feb 2013 02:54:53 -0800 (PST) X-Received: by 10.180.105.232 with SMTP id gp8mr3977908wib.33.1360148091898; Wed, 06 Feb 2013 02:54:51 -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 be1sm2406649wib.10.2013.02.06.02.54.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:54:51 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Lee Jones Subject: [PATCH 14/49] regulator: ab8500: Init debug from regulator driver Date: Wed, 6 Feb 2013 10:53:36 +0000 Message-Id: <1360148051-7560-15-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> References: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnrzX2/XgOseCEH8R44JADob1JVTbhszO5YKfgSThqi1sYNNemTez8GZEjV/AVrcnyM8UPc 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 48dd0ed..2b29ffa 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