From patchwork Thu Mar 28 16:11:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15722 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 4B9FE23E10 for ; Thu, 28 Mar 2013 16:11:58 +0000 (UTC) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by fiordland.canonical.com (Postfix) with ESMTP id 05B4DA18873 for ; Thu, 28 Mar 2013 16:11:57 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id cy12so3499330veb.18 for ; Thu, 28 Mar 2013 09:11:57 -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=hWSAvhNmzKnksW7RiEMsaRkp3u0o3FwOdTeLOCfAP+E=; b=E6YyExi1oePe2X13HGF9Gxx4HLUcFjvaKXPnYlZMRMq4yeg5/SvAb2Uk9xlx1NwnnH LeZMginCqkZQSUsrhe/E9NDDsyDbXq/Xm80ZtnvsDNA69Cu6+LLeeELqMP6i8gqglWQU ElnLg9o8+i8timkx+6twKLNomMpCHyrAKgZDRlqo3BUakt9cPgC4tZ1ALPFX3XwjQdJe TJHCHdt/0JM2ZLNBkswvLnn5SUkENipm/6J3l5V2fv4KFYbCZSOTT5QNisjDeyVP0zQT 2hUZxnB9N6K/5yEQEUr2n9/dUALmgEXGxKY/NLsTZBXU75pzBfKtcfVruP6EOcRBvI4k BNMQ== X-Received: by 10.58.224.101 with SMTP id rb5mr27998287vec.17.1364487117559; Thu, 28 Mar 2013 09:11:57 -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 cg12csp22386ved; Thu, 28 Mar 2013 09:11:56 -0700 (PDT) X-Received: by 10.194.173.167 with SMTP id bl7mr39638085wjc.50.1364487116533; Thu, 28 Mar 2013 09:11:56 -0700 (PDT) Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]) by mx.google.com with ESMTPS id u2si10090455wjq.230.2013.03.28.09.11.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:11:56 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::231 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::231; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::231 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-f177.google.com with SMTP id hm14so3402624wib.4 for ; Thu, 28 Mar 2013 09:11:56 -0700 (PDT) X-Received: by 10.180.101.69 with SMTP id fe5mr4045457wib.19.1364487116003; Thu, 28 Mar 2013 09:11:56 -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.11.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Mar 2013 09:11:55 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones Subject: [PATCH 03/33] ARM: ux500: Provide a mechanism to over-ride regulator init values Date: Thu, 28 Mar 2013 16:11:03 +0000 Message-Id: <1364487093-19551-4-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: ALoCoQkpuIU7nObA/AXH8A52TuRuzjnWlToC8DzF3EUZCZTcGaIq4p8yITeNiionaIARCytP6EE/ If particular platforms require non-standard initialisation values, they can use this function to adapt them as required. Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500-regulators.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 089cf2a..22dfaf3 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c @@ -476,3 +476,21 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { .ext_regulator = ab8500_ext_regulators, .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), }; + +static void ab8500_modify_reg_init(int id, u8 mask, u8 value) +{ + int i; + + for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) { + if (ab8500_reg_init[i].id == id) { + u8 initval = ab8500_reg_init[i].value; + initval = (initval & ~mask) | (value & mask); + ab8500_reg_init[i].value = initval; + + BUG_ON(mask & ~ab8500_reg_init[i].mask); + return; + } + } + + BUG_ON(1); +}