From patchwork Tue Mar 27 07:54:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Liu X-Patchwork-Id: 7479 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 2FE0A23E12 for ; Tue, 27 Mar 2012 07:54:38 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id CCB0EA1828C for ; Tue, 27 Mar 2012 07:54:37 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so12514401iag.11 for ; Tue, 27 Mar 2012 00:54:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=ccJaa+sv4T6ONmqqznXei8bLnqTljxUW1jWKWXVJoaM=; b=cMBTQ8z7TANm8Q/o6z80rTzOZWdh+QYva7RLFoA3SwRdI3SGaIYET0UdbQGJEinj5r cOb7X4kmjaW1zgxoBot8NTrzOkbYSjpl60wqQe8RWZjuAFmMq6MQEZ84GoAPWJvZOS0I CBOobpLwX3W4/kMY2suMH5Jzo97LTtKVnwYxfVTtYGY/S9jrXlW5+X5uuKn6FrlpN6A7 ZFB4ERdrvKHzeVk2sFmgS9s6UyQpaky0aYgUs7ofrp0KLmaxfnFMGh6LMMYzs5LdO4xZ cSGAvdjULNadd/+ybGjpSpEnYUdIsrgS5JN2CoQ1MK/Aoa4lJ46bexxaBvNnHYxuGsnu 58EA== Received: by 10.50.45.234 with SMTP id q10mr7875361igm.54.1332834877611; Tue, 27 Mar 2012 00:54:37 -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.231.5.205 with SMTP id 13csp10589ibw; Tue, 27 Mar 2012 00:54:37 -0700 (PDT) Received: by 10.50.185.201 with SMTP id fe9mr7800074igc.47.1332834877053; Tue, 27 Mar 2012 00:54:37 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id m2si18210196icz.13.2012.03.27.00.54.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Mar 2012 00:54:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of paul.liu@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of paul.liu@linaro.org) smtp.mail=paul.liu@linaro.org Received: by iakl21 with SMTP id l21so12948173iak.37 for ; Tue, 27 Mar 2012 00:54:36 -0700 (PDT) Received: by 10.42.155.9 with SMTP id s9mr14307310icw.51.1332834876234; Tue, 27 Mar 2012 00:54:36 -0700 (PDT) Received: from freya.lan (host-77.138-185-111.static.totalbb.net.tw. [111.185.138.77]) by mx.google.com with ESMTPS id gh8sm12086403igb.16.2012.03.27.00.54.33 (version=SSLv3 cipher=OTHER); Tue, 27 Mar 2012 00:54:35 -0700 (PDT) From: "Ying-Chun Liu (PaulLiu)" To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org, "Ying-Chun Liu (PaulLiu)" , Shawn Guo , Mark Brown , Liam Girdwood Subject: [PATCH] Regulator: anatop-regulator: patching to device-tree property "reg". Date: Tue, 27 Mar 2012 15:54:01 +0800 Message-Id: <1332834841-13925-1-git-send-email-paul.liu@linaro.org> X-Mailer: git-send-email 1.7.9.1 X-Gm-Message-State: ALoCoQk5JSVakOl2R/SlFr3azhaQtWtsLqyxq0A+pcoiZKAmkZoMdB0LSt+wEwUrkktba7dqBvQo From: "Ying-Chun Liu (PaulLiu)" Change "reg" to "anatop-reg-offset" due to there is a warning of handling no size field in reg. This patch also adds the missing device-tree binding documentation. Signed-off-by: Ying-Chun Liu (PaulLiu) Cc: Shawn Guo Cc: Mark Brown Cc: Liam Girdwood Acked-by: Shawn Guo --- .../bindings/regulator/anatop-regulator.txt | 29 ++++++++++++++++++++ drivers/regulator/anatop-regulator.c | 5 ++- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/anatop-regulator.txt diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt new file mode 100644 index 0000000..357758c --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt @@ -0,0 +1,29 @@ +Anatop Voltage regulators + +Required properties: +- compatible: Must be "fsl,anatop-regulator" +- anatop-reg-offset: Anatop MFD register offset +- anatop-vol-bit-shift: Bit shift for the register +- anatop-vol-bit-width: Number of bits used in the register +- anatop-min-bit-val: Minimum value of this register +- anatop-min-voltage: Minimum voltage of this regulator +- anatop-max-voltage: Maximum voltage of this regulator + +Any property defined as part of the core regulator +binding, defined in regulator.txt, can also be used. + +Example: + + regulator-vddpu { + compatible = "fsl,anatop-regulator"; + regulator-name = "vddpu"; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; + anatop-reg-offset = <0x140>; + anatop-vol-bit-shift = <9>; + anatop-vol-bit-width = <5>; + anatop-min-bit-val = <1>; + anatop-min-voltage = <725000>; + anatop-max-voltage = <1300000>; + }; diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 17499a5..53969af 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -138,9 +138,10 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev) rdesc->type = REGULATOR_VOLTAGE; rdesc->owner = THIS_MODULE; sreg->mfd = anatopmfd; - ret = of_property_read_u32(np, "reg", &sreg->control_reg); + ret = of_property_read_u32(np, "anatop-reg-offset", + &sreg->control_reg); if (ret) { - dev_err(dev, "no reg property set\n"); + dev_err(dev, "no anatop-reg-offset property set\n"); goto anatop_probe_end; } ret = of_property_read_u32(np, "anatop-vol-bit-width",