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: 6837141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D47A0C05AC for ; Tue, 21 Jul 2015 16:28:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFE33204D1 for ; Tue, 21 Jul 2015 16:28:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01912203ED for ; Tue, 21 Jul 2015 16:28:14 +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 1ZHaN0-0004mT-V3; Tue, 21 Jul 2015 16:26:18 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHaMt-0004iz-70 for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2015 16:26:12 +0000 Received: by pdjr16 with SMTP id r16so125355986pdj.3 for ; Tue, 21 Jul 2015 09:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1jw8W0v8Yu7a9qRCfrkwH8FevmgmPlCn37xb1Cx4ZVE=; b=Vx8q+GwVCDGAW6M2zOSfYjjiIXqIEj6lDbdOmSoRWkzgrvZOW+4NbPneipDplYyNiI D4DKyAHjT//RSiCGoVPjxuG/Rnkkwe7H3KrAXutDVNCUnaytwkZGNHNrh89PFIbpMClA dmThvqG36caQ07pRiDUm2UNgRHVhkp24Db9Eaceyy5wInVQqJ8UvEWh/mn7lRbawbyaq H6VnqCH1N4gOof57BZ/TewNdkx5ThP0OMyGDn+M9jpHacP1/LaGbAdotq4sf9WVoXRTz BXNRDcQqODddD0NcsvjWRjJ0G85rd9e8rvylJJCLWVvWAVLo6lwwMh+FcLFbGHqBT0cu 77dQ== X-Gm-Message-State: ALoCoQmnZOC+t5BbtoeJGfzcmN0qQDqyoDDnDvl+MLfByHxhK4mspPTaPb7nVs5skXPZxiSU3n3J 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150721_092611_300271_D73DDC01 X-CRM114-Status: GOOD ( 16.05 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, k.kozlowski@samsung.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, Vaibhav Hiremath , broonie@kernel.org, lee.jones@linaro.org 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=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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;