From patchwork Tue Jul 21 16:23:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 51321 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 2C10122AA3 for ; Tue, 21 Jul 2015 16:26:01 +0000 (UTC) Received: by lbbvz8 with SMTP id vz8sf48825897lbb.2 for ; Tue, 21 Jul 2015 09:26:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Q/VCJLyr9P6ygTB1SLISJchY6bNweXcXZ6PoFCruDug=; b=FfxOH62nzNJ9B9GS+13z1G1RPe2kaEYuR3w+st0CS2p12rp53p0QqjjzJdQmQ0cIfl YSqKt7SmZj6v2NJ9flMjqA5sNxUYFhasvtZyHTR5KWOerE/mSZKQiRjuQ7vP21X4Av8a qfTE0PpdEyLnC22W6H9CO2g1sLtFvng2/bjwwXw6+NGJUF55vdy3glaJUScBZykGQcf6 0wtMHwqDubxW29BfvVI4jGN7e4jl+dPySNhHXjzlhaJgvmlyGY0ym780lGqLsfAH8l3m mLyeYBidjT5he2j1Cjf/4J2asZD0nGG01LK/nnto4tksOSnWuCuI4QonZJ2seobjxcdb 0tbQ== X-Gm-Message-State: ALoCoQkU4CgkEk4h15WyD99tEGKBuCMOvrdCgwL+aOtfavKo50CVqoz5FWgYqPo3a4dx7ICtAVC0 X-Received: by 10.112.51.177 with SMTP id l17mr4969790lbo.1.1437495960166; Tue, 21 Jul 2015 09:26:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.65 with SMTP id yg1ls848010lab.26.gmail; Tue, 21 Jul 2015 09:26:00 -0700 (PDT) X-Received: by 10.152.121.42 with SMTP id lh10mr34508732lab.0.1437495959979; Tue, 21 Jul 2015 09:25:59 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id yo1si21149634lbb.167.2015.07.21.09.25.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2015 09:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagw2 with SMTP id w2so121329079lag.3 for ; Tue, 21 Jul 2015 09:25:59 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr33149350lbc.112.1437495959854; Tue, 21 Jul 2015 09:25:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1553755lba; Tue, 21 Jul 2015 09:25:58 -0700 (PDT) X-Received: by 10.66.101.104 with SMTP id ff8mr34604091pab.59.1437495958022; Tue, 21 Jul 2015 09:25:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mj9si44487690pab.42.2015.07.21.09.25.57; Tue, 21 Jul 2015 09:25:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933235AbbGUQZx (ORCPT + 28 others); Tue, 21 Jul 2015 12:25:53 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:32771 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933174AbbGUQZu (ORCPT ); Tue, 21 Jul 2015 12:25:50 -0400 Received: by padck2 with SMTP id ck2so122295243pad.0 for ; Tue, 21 Jul 2015 09:25:50 -0700 (PDT) X-Received: by 10.66.65.142 with SMTP id x14mr74643026pas.135.1437495950117; Tue, 21 Jul 2015 09:25:50 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by smtp.gmail.com with ESMTPSA id k5sm28385222pdn.10.2015.07.21.09.25.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jul 2015 09:25:48 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, lee.jones@linaro.org, broonie@kernel.org, k.kozlowski@samsung.com, linux-kernel@vger.kernel.org, Vaibhav Hiremath Subject: [PATCH-v2 2/2] regulator: 88pm800: Add support for configuration of dual phase on BUCK1 Date: Tue, 21 Jul 2015 21:53:02 +0530 Message-Id: <1437495782-15767-3-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437495782-15767-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1437495782-15767-1-git-send-email-vaibhav.hiremath@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 88PM860 device supports dual phase mode on BUCK1 output. In normal usecase, BUCK1A and BUCK1B operates independently with 3A capacity. And they both can work as a dual phase providing 6A capacity. This patch updates the regulator driver to read the respective DT property and enable dual-phase mode on BUCK1. Note that, this is init time (one time) initialization. Signed-off-by: Vaibhav Hiremath --- drivers/regulator/88pm800.c | 31 +++++++++++++++++++++++++++++++ include/linux/mfd/88pm80x.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c index e846e4c..1bf2b35 100644 --- a/drivers/regulator/88pm800.c +++ b/drivers/regulator/88pm800.c @@ -267,6 +267,31 @@ static struct pm800_regulator_info pm860_regulator_info[] = { PM800_LDO(ldo20, LDO20, LDO_ENA1_3, 3, 10000, ldo_volt_table2), }; +static int pm800_regulator_init(struct platform_device *pdev) +{ + struct pm800_regulators *pm800_data = platform_get_drvdata(pdev); + struct pm80x_chip *chip = pm800_data->chip; + int ret; + + /* Currently only supported on 88pm860 device */ + if (chip->type != CHIP_PM860) + return 0; + + if (of_property_read_bool(pdev->dev.of_node, + "marvell,88pm860-buck1-dualphase-en")) { + ret = regmap_update_bits(chip->subchip->regmap_power, + PM860_BUCK1_MISC, + BUCK1_DUAL_PHASE_SEL, + BUCK1_DUAL_PHASE_SEL); + if (ret) { + dev_err(chip->dev, "failed to set dual-pase mode %d\n", ret); + return ret; + } + } + + return 0; +} + static int pm800_regulator_probe(struct platform_device *pdev) { struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); @@ -336,6 +361,12 @@ static int pm800_regulator_probe(struct platform_device *pdev) } } + ret = pm800_regulator_init(pdev); + if (ret) { + dev_err(&pdev->dev, "failed to init 88pm800 regulator device\n"); + return ret; + } + return 0; } diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index a92d173..05d9bad 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h @@ -295,6 +295,9 @@ enum { #define PM860_BUCK4_MISC2 (0x82) #define PM860_BUCK4_FULL_DRV BIT(2) +#define PM860_BUCK1_MISC (0x8E) +#define BUCK1_DUAL_PHASE_SEL BIT(2) + struct pm80x_rtc_pdata { int vrtc; int rtc_wakeup;