From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAAA0C43603 for ; Mon, 9 Dec 2019 13:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A68A5206E0 for ; Mon, 9 Dec 2019 13:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727746AbfLINnI (ORCPT ); Mon, 9 Dec 2019 08:43:08 -0500 Received: from foss.arm.com ([217.140.110.172]:60976 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbfLINnI (ORCPT ); Mon, 9 Dec 2019 08:43:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A0B2328; Mon, 9 Dec 2019 05:43:07 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BFEB23F718; Mon, 9 Dec 2019 05:43:06 -0800 (PST) Subject: Re: [PATCH] mfd: rk808: Always use poweroff when requested To: Soeren Moch , Lee Jones Cc: linux-rockchip@lists.infradead.org, Heiko Stuebner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20191209115746.12953-1-smoch@web.de> From: Robin Murphy Message-ID: <40f82334-8f89-e2bd-985a-b09f71be20ce@arm.com> Date: Mon, 9 Dec 2019 13:43:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191209115746.12953-1-smoch@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/12/2019 11:57 am, Soeren Moch wrote: > With the device tree property "rockchip,system-power-controller" we > explicitly request to use this PMIC to power off the system. So always > register our poweroff function, even if some other handler (probably > PSCI poweroff) was registered before. This seems preferable to abusing syscore ops, and at least it does allow the firmware behaviour to be encapsulated in the DT (and thus more easily updated if and when a firmware-based shutdown can be achieved on currently-crippled boards) rather than baking assumptions into the kernel. And in the meantime, I *would* quite like to be able to power down my RK3399 board without having to lean on the button... so I guess, Acked-by: Robin Murphy > Signed-off-by: Soeren Moch > --- > Cc: Lee Jones > Cc: Heiko Stuebner > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-rockchip@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/mfd/rk808.c | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c > index a69a6742ecdc..616e44e7ef98 100644 > --- a/drivers/mfd/rk808.c > +++ b/drivers/mfd/rk808.c > @@ -550,7 +550,7 @@ static int rk808_probe(struct i2c_client *client, > const struct mfd_cell *cells; > int nr_pre_init_regs; > int nr_cells; > - int pm_off = 0, msb, lsb; > + int msb, lsb; > unsigned char pmic_id_msb, pmic_id_lsb; > int ret; > int i; > @@ -674,16 +674,9 @@ static int rk808_probe(struct i2c_client *client, > goto err_irq; > } > > - pm_off = of_property_read_bool(np, > - "rockchip,system-power-controller"); > - if (pm_off && !pm_power_off) { > + if (of_property_read_bool(np, "rockchip,system-power-controller")) { > rk808_i2c_client = client; > pm_power_off = rk808->pm_pwroff_fn; > - } > - > - if (pm_off && !pm_power_off_prepare) { > - if (!rk808_i2c_client) > - rk808_i2c_client = client; > pm_power_off_prepare = rk808->pm_pwroff_prep_fn; > } > > -- > 2.17.1 > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip >