From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755420AbcFIFLo (ORCPT ); Thu, 9 Jun 2016 01:11:44 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:40414 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754615AbcFIFLi (ORCPT ); Thu, 9 Jun 2016 01:11:38 -0400 X-AuditID: cbfec7f5-f792a6d000001302-36-5758fa86ca30 Subject: Re: [PATCH v3 06/12] power: pwrseq: simple: Add support for regulator and generic property To: Chen-Yu Tsai , Rob Herring References: <1464768141-25420-1-git-send-email-k.kozlowski@samsung.com> <1464768141-25420-7-git-send-email-k.kozlowski@samsung.com> <20160603020218.GA19436@rob-hp-laptop> <575693DE.2010603@samsung.com> <20160608190333.GA5126@rob-hp-laptop> Cc: Mark Rutland , devicetree , Ulf Hansson , linux-samsung-soc@vger.kernel.org, Pawel Moll , Ian Campbell , Dmitry Eremin-Solenikov , Greg Kroah-Hartman , linux-usb , "linux-mmc@vger.kernel.org" , Sebastian Reichel , linux-kernel , Javier Martinez Canillas , Bartlomiej Zolnierkiewicz , Kukjin Kim , Alan Stern , linux-arm-kernel , Kumar Gala , David Woodhouse , hzpeterchen@gmail.com, linux-pm@vger.kernel.or From: Krzysztof Kozlowski Message-id: <5758FA84.3050909@samsung.com> Date: Thu, 09 Jun 2016 07:11:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsVy+t/xK7ptvyLCDabOULfYOGM9q8WkJ++Z LeYfOcdqMXHlZGaL/jcLWS2aF69ns+i6uonN4tyrlYwWb96uYbJ4/cLQov/xa2aLTY+vsVpc 3jWHzeLI/35Gi5kXV7NYzDi/j8li0bJWZoul1y8yWUyYvpbF4v+eHewWp3eXWEz4fYHN4vja cIufh84zOUh4rJm3htHjcl8vk8eGR6tZPXbOusvusXL5FzaPzSu0PDat6mTzuHNtD5vH/rlr 2D02L6n32NIPVDD77g9Gj74tqxg9jnydzuLxeZNcAH8Ul01Kak5mWWqRvl0CV8b+3/tYCg7w V9x/f5O9gXEWTxcjJ4eEgInE0yWH2CBsMYkL99YD2VwcQgJLGSVm/TvCBOE8Y5TYtek6O0iV sECqRM/UXiYQW0TAXuLguWssILaQwB4mifPzY0AamAV+s0nsvr2bFSTBJmAssXn5ErAVvAJa Eod27gVq5uBgEVCVePKuGiQsKhAhMWv7DyaIEkGJH5PvsYCUcAoES1yYyg9iMguoS0yZkgtS wSwgL7F5zVvmCYwCs5A0zEKomoWkagEj8ypG0dTS5ILipPRcI73ixNzi0rx0veT83E2MkCj/ uoNx6TGrQ4wCHIxKPLwaKRHhQqyJZcWVuYcYJTiYlUR4Pe8ChXhTEiurUovy44tKc1KLDzFK c7AoifPO3PU+REggPbEkNTs1tSC1CCbLxMEp1cAoVPZeJ2H9k/n23stNlZ77O6m1a0Uqt13+ /cKp9KV/pFZygGnpm6tLPtpNvLtGREvMJd8pzG3P5cvee484H1C7/rdJ+oWDKBPz4n8v2nbF dqVwvjLsN7F/tc5n4c6uAL5i7RctObxBZ47e/bVQaZ7M4XNSWc/v7zuidyirOGNG/E3F2A6p RXpKLMUZiYZazEXFiQDJ5zGo7gIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2016 04:34 AM, Chen-Yu Tsai wrote: > Hi > > On Thu, Jun 9, 2016 at 3:03 AM, Rob Herring wrote: >> On Tue, Jun 07, 2016 at 11:29:02AM +0200, Krzysztof Kozlowski wrote: >>> On 06/03/2016 04:02 AM, Rob Herring wrote: >>>>> Optional properties: >>>>> - reset-gpios : contains a list of GPIO specifiers. The reset GPIOs are asserted >>>>> @@ -16,6 +22,7 @@ Optional properties: >>>>> See ../clocks/clock-bindings.txt for details. >>>>> - clock-names : Must include the following entry: >>>>> "ext_clock" (External clock provided to the card). >>>>> +- ext-supply : External regulator supply >>>> >>>> What happens when there are 2 supplies? >>>> >>>> I'd prefer the name not be genericish and use the real supply names. >>>> Then the power seq code should just turn on all supplies it finds. If >>>> the order or timing to turn on matters, then sorry, no generic sequence. >>> >>> I think the generic part for regulators might be a problem. Regulator >>> API requires a name for the supply... it cannot get "something" or >>> "everything". >> >> That's the downside of variable property names... >> >>> The driver could attach itself to any kind of node (where power-sequence >>> property exists) so the supply name depends on the bindings of device >>> (not bindings of power sequence driver). >>> >>> The power sequence driver could however iterate over child properties >>> and get the names of all supplies. It is a little bit ugly... >> >> Yes. Like this, right? >> >> for_each_property_of_node(np, pp) { >> if (!strstr(pp->name, "-supply")) >> continue; >> // found supply >> } >> >> The uglyness can always be improved with a function to do this parsing. > > There's already a version of this in simplefb. Maybe it's time to move > this to a common function? Thanks, I'll make a generic one and let's see how Mark will respond to it. Best regards, Krzysztof