From patchwork Thu Jan 22 15:39:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 5686151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D5E29F333 for ; Thu, 22 Jan 2015 15:42:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CD0620222 for ; Thu, 22 Jan 2015 15:42:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1E3820221 for ; Thu, 22 Jan 2015 15:42:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEJs3-0002mT-Vc; Thu, 22 Jan 2015 15:40:35 +0000 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEJr6-0001Jg-Kc for linux-arm-kernel@lists.infradead.org; Thu, 22 Jan 2015 15:39:38 +0000 Received: from mirror2.csie.ntu.edu.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (Authenticated sender: b93043) by smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id 18D352031A; Thu, 22 Jan 2015 23:39:13 +0800 (CST) Received: by mirror2.csie.ntu.edu.tw (Postfix, from userid 1000) id EDCDA5F9B3; Thu, 22 Jan 2015 23:39:12 +0800 (CST) From: Chen-Yu Tsai To: Mark Brown , Lee Jones , Rob Herring , Grant Likely , Maxime Ripard Subject: [PATCH v9 3/5] regulators: axp20x: Use "clock-frequency" property for dcdc work frequency Date: Thu, 22 Jan 2015 23:39:05 +0800 Message-Id: <1421941147-9682-4-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421941147-9682-1-git-send-email-wens@csie.org> References: <1421941147-9682-1-git-send-email-wens@csie.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150122_073936_840842_92540064 X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) Cc: devicetree@vger.kernel.org, Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);