From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbcFCCCX (ORCPT ); Thu, 2 Jun 2016 22:02:23 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:34943 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbcFCCCU (ORCPT ); Thu, 2 Jun 2016 22:02:20 -0400 Date: Thu, 2 Jun 2016 21:02:18 -0500 From: Rob Herring To: Krzysztof Kozlowski Cc: hzpeterchen@gmail.com, Ulf Hansson , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Javier Martinez Canillas , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.or, Alan Stern , linux-usb@vger.kernel.org, Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Kukjin Kim , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v3 06/12] power: pwrseq: simple: Add support for regulator and generic property Message-ID: <20160603020218.GA19436@rob-hp-laptop> References: <1464768141-25420-1-git-send-email-k.kozlowski@samsung.com> <1464768141-25420-7-git-send-email-k.kozlowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464768141-25420-7-git-send-email-k.kozlowski@samsung.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 01, 2016 at 10:02:15AM +0200, Krzysztof Kozlowski wrote: > Some devices need real hard-reset by cutting the power. During power > sequence turn off and on the regulator, if it is provided. > > Additionally add support for instantiating the pwrseq-simple device on a > generic property 'power-sequence'. The device will attach itself to the > node containing the property and parse the node's properties like > reset-gpios, ext-supply etc. > > Signed-off-by: Krzysztof Kozlowski > --- > .../bindings/power/pwrseq/pwrseq-simple.txt | 29 +++++++- > drivers/power/pwrseq/pwrseq_simple.c | 85 +++++++++++++++++++++- > 2 files changed, 107 insertions(+), 7 deletions(-) > > diff --git a/Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt b/Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt > index ce0e76749671..a8c3f13ee83f 100644 > --- a/Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt > +++ b/Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt > @@ -1,11 +1,17 @@ > -* The simple MMC power sequence provider > +* The simple power sequence provider > > -The purpose of the simple MMC power sequence provider is to supports a set of > +The purpose of the simple power sequence provider is to supports a set of > common properties between various SOC designs. It thus enables us to use the > same provider for several SOC designs. > > -Required properties: > -- compatible : contains "mmc-pwrseq-simple". > +The driver supports two types of bindings: > +1. Separate node > + Required properties: > + - compatible : contains "mmc-pwrseq-simple". Please note that this is not recommended for new users. > + > +2. Property for any node > + Required properties: > + - power-sequence > > 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. > > Example: > > @@ -24,4 +31,18 @@ Example: > reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; > clocks = <&clk_32768_ck>; > clock-names = "ext_clock"; > + ext-supply = <&buck8>; > } > + > + usb3503@08 { > + compatible = "smsc,usb3503"; > + reg = <0x08>; > + > + intn-gpios = <&gpx3 0 GPIO_ACTIVE_HIGH>; > + connect-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>; > + reset-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>; > + initial-mode = <1>; > + > + power-sequence; > + ext-supply = <&buck8_reg>; > + };