Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbdLGJr3 (ORCPT ); Thu, 7 Dec 2017 04:47:29 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:42259 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbdLGJrZ (ORCPT ); Thu, 7 Dec 2017 04:47:25 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171207094722euoutp02b9435c40f91bf184bcbd882d1aeca842~9_hq4XFlf2513925139euoutp02I X-AuditID: cbfec7f2-f793b6d000003243-5b-5a290e294496 From: Maciej Purski To: Mark Brown Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Liam Girdwood , Rob Herring , Mark Rutland , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Maciej Purski Subject: [PATCH v3 0/4] Add coupled regulators mechanism Date: Thu, 07 Dec 2017 10:46:11 +0100 Message-id: <1512639975-22241-1-git-send-email-m.purski@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsWy7djPc7qafJpRBvPWKlpsnLGe1WLqwyds FvOPnGO1+Halg8ni8q45bBYLXt5isVh75C67xdLrF5ksWvceYXfg9Fgzbw2jx85Zd9k9Nq3q ZPPo27KK0ePzJrkA1igum5TUnMyy1CJ9uwSujLc3nzIWtIlWvLj6l6mBcbtAFyMnh4SAicSf qS9ZIWwxiQv31rN1MXJxCAksZZS4P2szM4TzmVHi4pU57DAdJ66fZYVILGOU2LDtCyOE859R 4se6X0BVHBxsAloSa9rjQRpEBJQlrn7fywJSwyywk0lix/W5YPuEBSwkpk95CzaVRUBVou/H OkYQm1fAReLW1O1QN8lJ3DzXCXaGhEAHm8Sch19YIBIuEg93rGWEsIUlXh3fAnWejMTlyd1Q NdUSF7/uYoOwayQab2+AqrGW+DxpCzOIzSzAJzFp23RmkKMlBHgl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mU9Txv5bJSG9h0X4bvLG/5wi5+zdosRSnJFoqMVcVJwIADyaa0wY AgAA X-CMS-MailID: 20171207094720eucas1p1eb1c8c2d0e222082ce6918807c4ad492 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171207094720eucas1p1eb1c8c2d0e222082ce6918807c4ad492 X-RootMTR: 20171207094720eucas1p1eb1c8c2d0e222082ce6918807c4ad492 References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2619 Lines: 73 Hi all, this patchset adds a new mechanism to the framework - regulators' coupling. On Odroid XU3/4 and other Exynos5422 based boards there is a case, that different devices on the board are supplied by different regulators with non-fixed voltages. If one of these devices temporarily requires higher voltage, there might occur a situation that the spread between devices' voltages is so high, that there is a risk of changing 'high' and 'low' states on the interconnection between devices powered by those regulators. Algorithmicaly the problem was solved by: Inderpal Singh Doug Anderson The discussion on that subject can be found here: https://lkml.org/lkml/2014/4/29/28 Therefore this patchset is an attempt to apply the idea to regulators core as concluded in the discussion by Mark Brown and Doug Anderson. This feature is required to enable support for generic CPUfreq and devfreq drivers for the mentioned boards. Note on the locking model: When balancing voltage of a group of coupled regulators, we lock all of them for the whole operation. When voltage of an individual regulator is about to change, its suppliers are additionally locked. Best regards, Maciej Purski --- Changes in v3: - move dts parsing code to of_regulator.c, in order to the so, add a new commit in which of_regulator_find_by_node() is moved to of_regulator.c as well - improve error messages - move max_spread variable to constraints - perform resolving of coupled regulators under a list mutex - remove useless locking functions - some minor refactorization - improve commit messages Changes in RFC v2: - allow coupling n regulators (in fact up to constant value, now set to 10) - change algorithm to be more readable - introduce better locking - add more comments - split first patch into two - update commit messages - change sequence of the patches Maciej Purski (4): regulator: core: Move of_find_regulator_by_node() to of_regulator.c regulator: bindings: Add properties for coupled regulators regulator: core: Parse coupled regulators properties regulator: core: Balance coupled regulators voltages .../devicetree/bindings/regulator/regulator.txt | 5 + drivers/regulator/core.c | 424 +++++++++++++++++++-- drivers/regulator/internal.h | 16 + drivers/regulator/of_regulator.c | 74 ++++ include/linux/regulator/driver.h | 16 + include/linux/regulator/machine.h | 4 + 6 files changed, 501 insertions(+), 38 deletions(-) -- 2.7.4