Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758377AbbBERdm (ORCPT ); Thu, 5 Feb 2015 12:33:42 -0500 Received: from seldrel01.sonyericsson.com ([212.209.106.2]:3985 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758000AbbBERdl (ORCPT ); Thu, 5 Feb 2015 12:33:41 -0500 Message-ID: <54D3A96B.2020704@sonymobile.com> Date: Thu, 5 Feb 2015 09:33:31 -0800 From: Tim Bird User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Mark Brown CC: "lgirdwood@gmail.com" , "linux-kernel@vger.kernel.org" , =?windows-1252?Q?=22Andersson=2C_Bj=F6rn=22?= Subject: Re: [PATCH] regulator: Support different config and dev of_nodes in regulator_register References: <54D2A91D.5090700@sonymobile.com> <20150205015945.GQ21293@sirena.org.uk> In-Reply-To: <20150205015945.GQ21293@sirena.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2404 Lines: 60 On 02/04/2015 05:59 PM, Mark Brown wrote: > On Wed, Feb 04, 2015 at 03:19:57PM -0800, Tim Bird wrote: > >> Support calling regulator_register with a dev node and a config node >> with different of_nodes. This is useful when a single driver >> wishes to register multiple child regulators. > >> Without this you get silent failures allocating a supply >> for a regulator which is registered using the device node of the >> regulator's DT parent (but it's own DT node). > > This is explicitly not supported; such bindings are invariably attempts > to encode the Linux MFD structure into the device tree (which isn't a > wonderful idea as the way we split things into subsystems can and does > change) or... Sorry - what is the "Linux MFD structure"? > >> charger@1000 { >> compatible = "qcom,pm8941-charger"; >> reg = <0x1000 0x700>; >> .... >> chg_otg { >> regulator_name = "chg_otg"; >> otg-supply = <&pm8941_mvs1>; >> ... >> } >> } > > ...this which just looks like the supply has been placed in the wrong > place, it should be in the parent node. Supplies are always defined at > the package level, that way we can consistently define the bindings for > supplies for a device without having to completely support it and we > don't have to bind the same supply multiple times. It should really be > possible to wire up the supplies based only on the schematics. > Well, the above DT node is not complete. Let me give some more context. I eventually want to have the charger driver support 2 regulators - one for the OTG vbus output (shown above) and one for a boost hardware device, which controls voltage for this and other parts of the system. These are both for IP blocks that are in the register range of this charger hardware (and hence belong, IMHO in this driver). I can easily move the otg-supply to the charger DT node, as you request, but what do I do about other regulator attributes, if I need to specify them for both the chg_otg and boost regulators provided by this driver? How would this be handled? I can't put them all in the charger DT node. Thanks, -- Tim -- 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/