From: Robin Murphy <robin.murphy@arm.com>
To: Soeren Moch <smoch@web.de>, Lee Jones <lee.jones@linaro.org>
Cc: linux-rockchip@lists.infradead.org,
Heiko Stuebner <heiko@sntech.de>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: rk808: Always use poweroff when requested
Date: Mon, 9 Dec 2019 13:43:05 +0000 [thread overview]
Message-ID: <40f82334-8f89-e2bd-985a-b09f71be20ce@arm.com> (raw)
In-Reply-To: <20191209115746.12953-1-smoch@web.de>
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 <robin.murphy@arm.com>
> Signed-off-by: Soeren Moch <smoch@web.de>
> ---
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Heiko Stuebner <heiko@sntech.de>
> 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
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-09 13:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 11:57 [PATCH] mfd: rk808: Always use poweroff when requested Soeren Moch
2019-12-09 12:32 ` Heiko Stübner
2019-12-09 13:43 ` Robin Murphy [this message]
2019-12-10 12:42 ` Anand Moon
2019-12-10 12:55 ` Markus Reichl
2019-12-10 16:40 ` Soeren Moch
2019-12-11 2:00 ` Anand Moon
2019-12-11 10:55 ` Soeren Moch
2019-12-12 0:28 ` Robin Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40f82334-8f89-e2bd-985a-b09f71be20ce@arm.com \
--to=robin.murphy@arm.com \
--cc=heiko@sntech.de \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=smoch@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).