From mboxrd@z Thu Jan 1 00:00:00 1970 From: Javier Martinez Canillas Subject: Re: [RFT v3 06/14] regulator: max77802: Remove support for board files Date: Thu, 30 Oct 2014 15:02:41 +0100 Message-ID: <54524501.8030604@collabora.co.uk> References: <1414668053-31370-1-git-send-email-k.kozlowski@samsung.com> <1414668053-31370-7-git-send-email-k.kozlowski@samsung.com> <54522615.7040002@collabora.co.uk> <1414671037.23399.2.camel@AMDC1943> <54522D2C.9050002@collabora.co.uk> <1414672235.23399.7.camel@AMDC1943> <54523224.3010407@collabora.co.uk> <1414673587.23399.13.camel@AMDC1943> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1414673587.23399.13.camel@AMDC1943> Sender: linux-samsung-soc-owner@vger.kernel.org To: Krzysztof Kozlowski Cc: Samuel Ortiz , Lee Jones , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Ben Dooks , Kukjin Kim , Russell King , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Chanwoo Choi List-Id: devicetree@vger.kernel.org Hello Krzysztof, On 10/30/2014 01:53 PM, Krzysztof Kozlowski wrote: > > To me a intuitive structure would be: > MFD device > | > - clock device > | > - clock1 > - clock2 > - regulator device > | > - LDO1 > - LDO2 > etc. > > This also maps to structure in DTS. dev_err* messages and any > allocations should be done on behalf of regulator device, not parent. > > Various drivers do this differently... The wm8* drivers set it mostly to > parent (MFD)... > > I do not insists, especially because using parent's device would make > this driver simpler. > Another reason to set it to the parent is to lookup the regulator input supply node. The regulator_register() function does: if (supply) { struct regulator_dev *r; r = regulator_dev_lookup(dev, supply, &ret); where dev = config->dev so that will determine on which device node your input supplies have to be defined. For example on the Peach Pit DTS has this: max77802: max77802-pmic@9 { ... inb1-supply = <&tps65090_dcdc2>; ... inb10-supply = <&tps65090_dcdc1>; inl1-supply = <&buck5_reg>; ... inl10-supply = <&buck7_reg>; ... regulators { ... }; }; which is how most (all?) DTS define the input supplies. If you instead do config.dev = &pdev->dev, then the input supplies have to be in the "regulators" node which is not the standard AFAICT. This is not a problem for max77686 because I see that DTS don't define the input supplies but I guess that is because the power scheme is not completely modeled. > Mark, maybe you could shed light on it? > > > Best regards, > Krzysztof > > Best regards, Javier