Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753802AbbHYEtG (ORCPT ); Tue, 25 Aug 2015 00:49:06 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:8427 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbbHYEtE (ORCPT ); Tue, 25 Aug 2015 00:49:04 -0400 X-AuditID: cbfec7f5-f794b6d000001495-66-55dbf3bc0579 Message-id: <55DBF3B9.4060602@samsung.com> Date: Tue, 25 Aug 2015 13:48:57 +0900 From: Krzysztof Kozlowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-version: 1.0 To: Vaibhav Hiremath , linux-arm-kernel@lists.infradead.org Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, lee.jones@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH-v3 2/2] regulator: 88pm800: Add support for configuration of dual phase on BUCK1 References: <1440420006-31556-1-git-send-email-vaibhav.hiremath@linaro.org> <1440420006-31556-3-git-send-email-vaibhav.hiremath@linaro.org> In-reply-to: <1440420006-31556-3-git-send-email-vaibhav.hiremath@linaro.org> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t/xK7p7Pt8ONfi9zdBi6sMnbBbzj5xj tXj9wtDi/tejjBabHl9jtbi8aw6bReveI+wW169uZHHg8Ni0qpPN4861PWwem5fUe/RtWcXo 8XmTXABrFJdNSmpOZllqkb5dAlfGlo/P2AqaJCpeHf3G1MC4TLiLkZNDQsBE4v+8A8wQtpjE hXvr2UBsIYGljBJ/ZiV2MXIB2V8YJVZ1fGUBSfAKaEnMf9zCCGKzCKhKzNpxnRXEZhMwlti8 fAlYs6hAhMTy1ScZIeoFJX5MvgfWKyIQJbFr31n2LkYODmaBGonfk31AwsICaRJ3dp5kgtjb yyhxtIcfpIRTwEfi9+4UiGo9ifsXtUAqmAXkJTavecs8gVFgFpL5sxCqZiGpWsDIvIpRNLU0 uaA4KT3XSK84Mbe4NC9dLzk/dxMjJMS/7mBceszqEKMAB6MSD++M+bdDhVgTy4orcw8xSnAw K4nwPt8IFOJNSaysSi3Kjy8qzUktPsQozcGiJM47c9f7ECGB9MSS1OzU1ILUIpgsEwenVAOj zKV+bY/bM1/eNv/+0bRXb6d6a+q+KR8avs6WmmJ/LWKitVIsY92sTx+VG4t/+hRuX9TlmJ88 e+PKw1uWprjemjPrQrPKm/BTVQd2pmW7HN7izGx5/LjIsjZJiSaD5MMRYpIHG6PcbY79tLyg 9PrDr53tQT/ZfF5drdLc73g2MVewNmzKycYwJZbijERDLeai4kQAWCL3D20CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3233 Lines: 91 On 24.08.2015 21:40, Vaibhav Hiremath wrote: > 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 if dual phase mode is enabled, then BUCK1B will not be > registered to the regulator framework and the current capacity of > BUCK1(A) would be set to 6A [3A of BUCK1A + 3A of BUCK1B]. > > Signed-off-by: Vaibhav Hiremath > --- > drivers/regulator/88pm800.c | 40 ++++++++++++++++++++++++++++++++++++++++ > include/linux/mfd/88pm80x.h | 3 +++ > 2 files changed, 43 insertions(+) > > diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c > index 365a154..7aca6d17 100644 > --- a/drivers/regulator/88pm800.c > +++ b/drivers/regulator/88pm800.c > @@ -267,6 +267,37 @@ 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_regulator_info *info) > +{ > + struct pm800_regulators *pm800_data = platform_get_drvdata(pdev); > + struct pm80x_chip *chip = pm800_data->chip; > + int ret = 0; > + > + /* 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")) { > + /* Update the constraint to [3A (BUCK1A) + 3A (BUCK1B)] */ > + info[PM800_ID_BUCK1].max_ua = 6000000; > + /* Remove BUCK1B from the list, as we are in dual phase mode */ > + memset(&info[PM800_ID_BUCK1B], 0, sizeof(*info)); > + /* Enable dual phase mode */ > + 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 ret; > +} > + > static int pm800_regulator_probe(struct platform_device *pdev) > { > struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); > @@ -311,11 +342,20 @@ static int pm800_regulator_probe(struct platform_device *pdev) > return -ENODEV; > } > > + ret = pm800_regulator_init(pdev, info); > + if (ret) { > + dev_err(&pdev->dev, "failed to init 88pm800 regulator device\n"); > + return ret; > + } > + > config.dev = chip->dev; > config.regmap = pm800_data->map; > for (i = 0; i < PM800_ID_RG_MAX; i++) { > struct regulator_dev *regulator; > > + if (!info[i].desc.name) > + continue; How the driver was working without this on 88PM800? There is a gap in pm800_regulator_info - three regulators are not set. The patch itself looks good Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/