Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2437806pxu; Sat, 28 Nov 2020 14:07:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyTNNcNxmpyVxEFNDmlMEGUYl1lOpRV63a61RLZuK7bKoHA5Wzmlq37uDqC1Ghc/ud/Eky X-Received: by 2002:a17:906:2582:: with SMTP id m2mr14078061ejb.271.1606601265875; Sat, 28 Nov 2020 14:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606601265; cv=none; d=google.com; s=arc-20160816; b=BlA0tfC49w++N9hXJ6t+1BHpZ4oxXQyXCM2C5de15/XVdMsRoqMRIZAchFdvchknL3 MmVK3Ux2eCRLfnwxOhSvAw8BHB0VMPkuUNek4jxDWVclnwq0nvPvT+pUtLQXu8rWYtDG Q7Hzt4Jz3EMBi7CZPwVDS6Nfh7tZJI0E5ht1yesVqtl1LNPxpYjx463+pWClhFrYNSMh Jh5jcrLl2XmOC/MXO2d+ptJSdKYDSGIa/h9qWBn1uEUTrHwPoYEoqRiB7zxZOmLs9QTX ZC+5dXKCx4SRfwL0nXTOI4wdIrgzbDIgPRVstlRmkDrtVHihVxB8QLCCrssjnOiWQN1g /b0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Hq254jPPKxCC5RMUk78VI37BIcd/Qc5Ug03wP6lEyP8=; b=q5JHFvo7DXzfohPAAV8aCHQ1Fg0ZnvU9YcML8ZFj1+l+5oaiTRnbTRC7E+rD8CG3fY VDOpGYyUhYA4lBi/Vks4yLwlDr3EOWg2zajiEmU3pcx/71XQkgnwYqDQFL8xiUo7lypL f0Ih/fHkzz6AWjKVdfSuZHVX8AfL2WO532uvDa9Qw5VWo+6Llgwg43RXgideQotoFRcS gTcOL3dY+4uInCKD285zjkF/HQuLC3Wzokbk44M64T3Di8kDoMWuUgEuFuyYcbbXsxZs fkGyi6fkF7v8j5CQly8TRpGmwUdWpqAc52CuHGbL8wL/w66D4Yqz91g9px/Spr7hI20x nQ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=N1JGwbtP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=aIuexSNY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si9313690ejd.407.2020.11.28.14.07.23; Sat, 28 Nov 2020 14:07:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=N1JGwbtP; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=aIuexSNY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728005AbgK1VuS (ORCPT + 99 others); Sat, 28 Nov 2020 16:50:18 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:34293 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733153AbgK1SLt (ORCPT ); Sat, 28 Nov 2020 13:11:49 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3390A9BB; Sat, 28 Nov 2020 05:40:00 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 28 Nov 2020 05:40:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=Hq254jPPKxCC5RMUk78VI37BIcd /Qc5Ug03wP6lEyP8=; b=N1JGwbtP9OsrqES3Fuqr59oHPuf4krVuOcTJMK/Djgo Ul5GpbQZlByT0xPbgmQE/eWSHz64MtfB2sWF5CSXQwcqsFJWlcmuaY+4VWR1jknz hdV9p0jGIxXWjOp91NkjXuJ/G+STUHkxARShHMVXjaL3TdU2TkfgB1j8EjwhstSV erkWprwIXpIftvLDTSvSKQ4CzbmjtcHS6XK2kFHKk78ftqrtJuIrLtEuWk62VJuJ sTi++bNmFSxlP3A2JAGdlJeut5KWr1etzfUAwwaleILMLC7yKw0yvvKxSEgvB5Ah H+9lxv4IDAoOW/iJgX58mGBfKLOASbNzCdKBb5yMBUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Hq254j PPKxCC5RMUk78VI37BIcd/Qc5Ug03wP6lEyP8=; b=aIuexSNYLpnZb2jou1H6ih geR+FWulciiYaJO1ufW8D0hvmdCF3WghzgmnJfKUx+6CoEaPy9i3GtKxRKudYdBS bfjPaToT5SmiuPB67OL4pOWE5ZCYylpz2e8cnVYHgViG/BN/erXkDe9wPFS0Qyk0 shBoJA0R2YrhntEBoiAgfYzKzcaYNZqNqnKAxC1OX/L7u3m4P1P7mFlFfXzG8vE1 W7047cRX4IH5lRxXpbIB5qldnvi5T7tVf/PFJiluLRSMVSg9aqGVdpTdXzzh70p+ w6mLatlMgJ5PIi+Hp7ZGD55vYVRjeyUw212HjEIv+1omg95duUX89bqp9DCKyoQA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudehiedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 1ABE53064AAA; Sat, 28 Nov 2020 05:39:59 -0500 (EST) Date: Sat, 28 Nov 2020 11:39:58 +0100 From: Maxime Ripard To: Michael Klein Cc: Rob Herring , Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ARM: dts: sun8i-h2-plus-bananapi-m2-zero: add poweroff node to DT Message-ID: <20201128103958.q6glewhhch7vtczr@gilmour> References: <20201124131933.2l2go6z6ltar5fpa@gilmour> <20201124133633.672259-1-michael@fossekall.de> <20201124142656.wz6ipwa2xayn433x@gilmour> <20201124223159.GA2865084@a98shuttle.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="stejl7vgq72gqvys" Content-Disposition: inline In-Reply-To: <20201124223159.GA2865084@a98shuttle.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --stejl7vgq72gqvys Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2020 at 11:31:59PM +0100, Michael Klein wrote: > On Tue, Nov 24, 2020 at 03:26:56PM +0100, Maxime Ripard wrote: > > On Tue, Nov 24, 2020 at 02:36:33PM +0100, Michael Klein wrote: > > > Add poweroff node to allow the board to power itself off after shutdo= wn > > > by disabling the SYSTEM and CPUX regulators (U5 resp. U6). The RST > > > button can be used to restart the board. > > >=20 > > > Signed-off-by: Michael Klein > > > --- > > > arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts | 5 +++++ > > > 1 file changed, 5 insertions(+) > >=20 > > You should have a summary of the changes between versions here > >=20 > > > diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/a= rch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > > > index 4c6704e4c57e..ea2fa48a1647 100644 > > > --- a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > > > +++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > > > @@ -46,6 +46,11 @@ sw4 { > > > }; > > > }; > > >=20 > > > + poweroff { > > > + compatible =3D "gpio-poweroff"; > > > + gpios =3D <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */ > > > + }; > > > + > >=20 > > Like I said in the previous version, this should really be modelled as a > > regulator instead of just a GPIO >=20 > Please excuse my ignorance, do you mean something like this? >=20 > reg_vdd_sys: vdd-sys { > compatible =3D "regulator-fixed"; > regulator-name =3D "vdd-sys"; > regulator-min-microvolt =3D <1200000>; > regulator-max-microvolt =3D <1200000>; > regulator-always-on; > regulator-boot-on; > enable-active-high; > gpio =3D <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ > vin-supply =3D <®_vcc5v0>; > }; >=20 > With this, the board still draws 60mA (cheap USB ampere meter) after > shutdown, presumably because of "regulator-always-on". Without this > property the board powers off shortly after booting up. Yes, because you're only describing the regulator itself here, but you're not telling linux that it needs to shut it down to power-down the board. You'd need a driver similar to gpio-poweroff, using a regulator instead, and calling regulator_force_disable to shut it down Maxime --stejl7vgq72gqvys Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX8Io/QAKCRDj7w1vZxhR xXyaAP9dhQ6ZoKWFbs6dcJc5Sqvox9mY6u0YvG1VjDCv//w7bgEAnAvV7LTYzXcP gvqQIqZAI1Y6fd0YSrdnwif+0yfjhgI= =lHji -----END PGP SIGNATURE----- --stejl7vgq72gqvys--