devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Mark Brown <broonie@kernel.org>, Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: devicetree@vger.kernel.org, Chen-Yu Tsai <wens@csie.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 3/5] regulators: axp20x: Use "clock-frequency" property for dcdc work frequency
Date: Thu, 22 Jan 2015 23:39:05 +0800	[thread overview]
Message-ID: <1421941147-9682-4-git-send-email-wens@csie.org> (raw)
In-Reply-To: <1421941147-9682-1-git-send-email-wens@csie.org>

Since the dcdc regulator work frequency is a property of the regulators
DT sub-tree, there is no issue of naming collisions, so we can use the
standard "clock-frequency" binding for this.

The driver sets a reasonable default value (same as the datasheet), and
only 1 dts has the old binding, with the default value.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/regulator/axp20x-regulator.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e4331f5e5d7d..990ac453abc8 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -186,8 +186,10 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
 	if (!regulators) {
 		dev_warn(&pdev->dev, "regulators node not found\n");
 	} else {
-		dcdcfreq = 1500;
-		of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
+		dcdcfreq = 1500000;
+		of_property_read_u32(regulators, "clock-frequency", &dcdcfreq);
+		/* axp20x_set_dcdc_freq() takes kHZ */
+		dcdcfreq /= 1000;
 		ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
 		if (ret < 0) {
 			dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret);
-- 
2.1.4

  parent reply	other threads:[~2015-01-22 15:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 15:39 [PATCH v9 0/5] mfd: axp20x: add support for AXP202 and AXP209 Chen-Yu Tsai
2015-01-22 15:39 ` [PATCH v9 1/5] dt-bindings: add vendor-prefix for X-Powers Chen-Yu Tsai
2015-01-22 15:39 ` [PATCH v9 2/5] mfd: AXP20x: Add bindings documentation Chen-Yu Tsai
2015-01-22 16:02   ` Lee Jones
2015-01-31 16:49     ` Chen-Yu Tsai
2015-02-02  8:53       ` Lee Jones
2015-02-10  7:34         ` Chen-Yu Tsai
2015-01-22 15:39 ` Chen-Yu Tsai [this message]
     [not found]   ` <1421941147-9682-4-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>
2015-01-27 12:14     ` [PATCH v9 3/5] regulators: axp20x: Use "clock-frequency" property for dcdc work frequency Mark Brown
2015-01-22 15:39 ` [PATCH v9 4/5] regulators: axp20x: Change dcdc-workmode DT property to boolean flag Chen-Yu Tsai
2015-01-27 12:27   ` Mark Brown
2015-01-22 15:39 ` [PATCH v9 5/5] ARM: sunxi: dts: axp209: Use clock-frequency for DC-DC work frequency Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421941147-9682-4-git-send-email-wens@csie.org \
    --to=wens@csie.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).