Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbdFAGUg (ORCPT ); Thu, 1 Jun 2017 02:20:36 -0400 Received: from mout.gmx.net ([212.227.17.22]:62666 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbdFAGUf (ORCPT ); Thu, 1 Jun 2017 02:20:35 -0400 Subject: Re: [PATCH v2 5/6] regulator: pfuze100-regulator: provide pm_power_off_prepare handler To: Andrew Morton , Oleksij Rempel References: <20170531061457.23744-1-o.rempel@pengutronix.de> <20170531061457.23744-6-o.rempel@pengutronix.de> <20170531135942.20a72fe106667791e874fb20@linux-foundation.org> Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org From: Oleksij Rempel Message-ID: Date: Thu, 1 Jun 2017 08:19:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170531135942.20a72fe106667791e874fb20@linux-foundation.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="foHKUsUSpsFubdcvhVXqRseTCpGGkd7N9" X-Provags-ID: V03:K0:33qk9k6benGsfd2Gq4TA+lCa3uwa5u8B42zxLBH+FtQwYRxjTMd ixChxFZ5DlJPXb/SFd7cIVOE6qMtki/hMnW4XrnvpQOQ8asNBD01PvObevZ3VnClWI0qh+S ZMS2U2U1cZ6yxSCv/AL54fgvQLkjOdclf3MnqWrBhUeDMORA8cLGC9jjaZqtuPEF0c+S/8q 09ypyMyd1FqwhfPhMkM0w== X-UI-Out-Filterresults: notjunk:1;V01:K0:oeTW6g9YjLM=:QHUcPbdyVmDf32rMPz9/GN 1VQFzUj7vTnABG6uUzHKwYhmrZzhE8q95P3e5SwcSTetEoxWen1qaZ6oAlyjdYxb3aDh4JYU7 a3dIt5AsxPTDWDghrVvcHXHwaFhkQZRsphB+b4XinFfn4X7QLH+hWMgU87nO/eG7vJIlHaeo1 DVA4UvLCmnNn53RTt5IqBYrujQOyJzyMwMvTnARmg5UF/hDKDxS6c4c+P9pVRWj2XshLDfjXz 6pbSMHRsH3uyqL5IQKTB+hjPMgBfXkP5br4eRPumOLoqd/HLtRFb27nYfxipNXT/23ct5B1F+ niLTGJKc474ICoCs7+OxjSBNVAlH3GOAAaoA+hNEkAXBtVfe/OjRMCeor2EidvkZGuDsH29aT Ej2z0oC67moCm7tqM7i6wIo+z97SB6B3AiqXmtX60jGHINJgrp0tVJ+ikCEzolg3t1Yicjvs7 YHd6N0oKj3B9NsQWvVuHVZ6iqawGkqLhh/+/4k1OFPBkAaVfKu47IuTzQ2c/vMFeyYUvohfDW un/T+sdgiavZaCh2X6exOry7WdoVBl8QYb7v4gcgkGi4fsRMCeCRt8rf6X8urIJy3R21Oa+QP Ojp81kS8cHzP/0YQ8p4AKqRdfpWAMuTUr36R9VV53zCWELcG/fJAXsMCRo1FL/AgZuVodf0Ne inYfgj3e+VbwCkfCNq2Ovf3E9agfvL/hdQBtDXSpNfJjCuCn86AzyHXA4R4HhImteMLPm6ohq 3I0iBHiZw6B3QRDcUtTh9HDEayg8R33xkNTmFxsFthXSkZKIxeG9EiQAQHM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3219 Lines: 102 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --foHKUsUSpsFubdcvhVXqRseTCpGGkd7N9 Content-Type: multipart/mixed; boundary="WB3W0HmsIJDe5cDEtaGgLchTOFkt034Vm"; protected-headers="v1" From: Oleksij Rempel To: Andrew Morton , Oleksij Rempel Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH v2 5/6] regulator: pfuze100-regulator: provide pm_power_off_prepare handler References: <20170531061457.23744-1-o.rempel@pengutronix.de> <20170531061457.23744-6-o.rempel@pengutronix.de> <20170531135942.20a72fe106667791e874fb20@linux-foundation.org> In-Reply-To: <20170531135942.20a72fe106667791e874fb20@linux-foundation.org> --WB3W0HmsIJDe5cDEtaGgLchTOFkt034Vm Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable Am 31.05.2017 um 22:59 schrieb Andrew Morton: > On Wed, 31 May 2017 08:14:56 +0200 Oleksij Rempel wrote: >=20 >> On some boards the SoC can use one pin "PMIC_STBY_REQ" to notify th PM= IC >> about state changes. In this case internal state of PMIC must be >> preconfigured for upcomming state change. >> It works fine with the current regulator framework, except with the >> power-off case. >> >> This patch is providing an optional pm_power_off_prepare handler >> which will configure the PMIC_StandBy state to disable all power lines= =2E >> >> In my power consumption test on RIoTBoard, I got the following results= : >> poweroff without this patch: 320 mA >> poweroff with this patch: 2 mA >> suspend to ram: 40 mA >> >> ... >> >> +static int pfuze_poweroff_pre_init(struct pfuze_chip *pfuze_chip) >> +{ >> + if (pfuze_chip->chip_id !=3D PFUZE100) { >> + dev_warn(pfuze_chip->dev, "Requested pm_power_off_prepare handler f= or not supoorted chip\n"); >> + return -ENODEV; >> + } >> + >> + if (pm_power_off_prepare) { >> + dev_warn(pfuze_chip->dev, "pm_power_off_prepare is already registre= d.\n"); >> + return -EBUSY; >> + } >> + >> + syspm_pfuze_chip =3D pfuze_chip; >> + pm_power_off_prepare =3D pfuze_poweroff_pre; >> + >> + return 0; >> +} >> + >=20 > Ah, there it is. >=20 > This looks a bit dodgy. What happens after someone does rmmod on this > driver? ok, got it. > (typo in comment: "supoorted") >=20 > (I wish we could get "poweroff" and "power_off" consistent) Hm.. only in this case or in DT bindings too? Which variant should be used? Driver: *_power_off_*; DT: *-power-off-* ? --=20 Regards, Oleksij --WB3W0HmsIJDe5cDEtaGgLchTOFkt034Vm-- --foHKUsUSpsFubdcvhVXqRseTCpGGkd7N9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlkvsfsACgkQHwImuRkmbWlW7wD+NMMjaJXqlk6nsr5IVguvjLoL dDeq1s8jKFp88v1G+toA/1h8W6GSw8N0ZFFEq9hmiWy3gyZYRoJanV4dbtY6Wh8P =35uy -----END PGP SIGNATURE----- --foHKUsUSpsFubdcvhVXqRseTCpGGkd7N9--