Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754411AbbHFGG0 (ORCPT ); Thu, 6 Aug 2015 02:06:26 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:29011 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbbHFGGY (ORCPT ); Thu, 6 Aug 2015 02:06:24 -0400 X-AuditID: cbfec7f5-f794b6d000001495-a9-55c2f95cec7d Message-id: <55C2F95D.3060608@samsung.com> Date: Thu, 06 Aug 2015 15:06:21 +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 Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, broonie@kernel.org, lee.jones@linaro.org Subject: Re: [PATCH-v2 2/2] regulator: 88pm800: Add support for configuration of dual phase on BUCK1 References: <1437495782-15767-1-git-send-email-vaibhav.hiremath@linaro.org> <1437495782-15767-3-git-send-email-vaibhav.hiremath@linaro.org> <55C1CD47.3060400@linaro.org> <55C2A340.6020809@samsung.com> <55C2F8CC.1010308@linaro.org> In-reply-to: <55C2F8CC.1010308@linaro.org> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsVy+t/xy7qxPw+FGsx1spj68Ambxfwj51gt Xr8wtLj/9SijxabH11gtLu+aw2bRuvcIu8X1qxtZHDg8Nq3qZPO4c20Pm8fmJfUefVtWMXp8 3iQXwBrFZZOSmpNZllqkb5fAlXH12UzGguXiFX8X3GFrYDwk1MXIySEhYCLxcfVjFghbTOLC vfVsXYxcHEICSxklrqz8zAaSEBL4wiixbzMTiM0roCVx/84/sAYWAVWJdf17weJsAsYSm5cv AasXFYiQWL76JCNEvaDEj8n3wOpFBIwkTveuZQdZwCywhFHi0IRT7CAJYYE0iSndd1ggNm9m kvgz9SJYNyfQtr9rXwLZHEAd6hJTpuSChJkF5CU2r3nLPIFRYBaSHbMQqmYhqVrAyLyKUTS1 NLmgOCk910ivODG3uDQvXS85P3cTIyTQv+5gXHrM6hCjAAejEg+vxfpDoUKsiWXFlbmHGCU4 mJVEeLdeAArxpiRWVqUW5ccXleakFh9ilOZgURLnnbnrfYiQQHpiSWp2ampBahFMlomDU6qB Mbd9s6LwYz2fY/snbpz5mzuuL8v7n5NPY/K+hjuS2a2r9es1pHQ0Qw3Wz+O7/WIze+KVjx+1 ph4xqHmzK4cn8LTFLc0TZ2plVLbZ37r4p2K5hsmRE5tcwx8Ut/14ej9y16rs3Ny6yqeJm732 vq5OdPFT/J67XnXy61DO9YKLXsY8ka8X89o0S4mlOCPRUIu5qDgRALkn9nRwAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3133 Lines: 100 On 06.08.2015 15:03, Vaibhav Hiremath wrote: > > > On Thursday 06 August 2015 05:28 AM, Krzysztof Kozlowski wrote: >> On 05.08.2015 17:45, Vaibhav Hiremath wrote: >>> >>> >>> On Thursday 23 July 2015 10:21 AM, Krzysztof Kozlowski wrote: >>>> 2015-07-22 1:23 GMT+09:00 Vaibhav Hiremath >>>> : >>>>> 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. >>>>> >>> >>> Sorry for delayed response, was on bed rest almost for week. >>> >>>>> Signed-off-by: Vaibhav Hiremath >>>>> --- >>>>> drivers/regulator/88pm800.c | 31 +++++++++++++++++++++++++++++++ >>>>> include/linux/mfd/88pm80x.h | 3 +++ >>>>> 2 files changed, 34 insertions(+) >>>> >>>> Don't you need to update the constraints also? I think the BUCK1 >>>> regulator has fixed constraint of 3 A: >>>> PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, >>>> 0x55), >>>> and now it can handle 6 A. >>>> >>> >>> Actually, BUCK1A and BUCK1B both combined together provide 6A capacity. >>> And as discussed earlier, we need board change for this. >>> >>> I am quite not sure. >> >> AFAIU the regulator driver creates one BUCK1 regulator with constraints >> 3 A. However after your change the regulator will handle up to 6 A. >> >> This means that constraints set by driver are wrong. >> >> Additionally I can't find BUCK1A and BUCK1B regulators. Driver provides >> only BUCK1. >> > > My patch does add BUCK1A and BUCK1B, please refer to the PATCH[4/5] of > earlier series, which is accepted. > > https://patchwork.kernel.org/patch/6810461/ Indeed. > > >>> >>> Should I read the property and update the constraint runtime during >>> probe? >> >> Driver should provide real constraints. Find the proper way to do this. >> >> The pm800_regulator_info[] array is not const so you can change it in >> whatever way you want (although it should be const for existing driver >> because regulator core accepts const and passing it to driver_data is >> not necessary). >> > > > Probably that is the only way to handle this. > > how about, > > As you mentioned, pm800_regulator_info[] is not constant, so I can > update the constraint before regulator_register() and also do not > register BUCK1B, if dual phase is enabled. > > So in summary, > > if (dual phase is enabled) > { > Update constraint of BUCK1 to 6A > and do not register BUCK1B > } else { > register both BUCK1A and BUCK1B with default constraint of 3A. > } This idea looks good to me. 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/