linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: lee.jones@linaro.org
Cc: linux-kernel@vger.kernel.org, heiko@sntech.de,
	linux-rockchip@lists.infradead.org, smoch@web.de
Subject: [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested
Date: Sun, 12 Jan 2020 01:55:00 +0000	[thread overview]
Message-ID: <233bf172a5310658d703b11be6e637d6c4d46338.1578789410.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1578789410.git.robin.murphy@arm.com>

From: Soeren Moch <smoch@web.de>

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 does tend to reveal a warning on shutdown due to the Rockchip I2C
driver not implementing an atomic transfer method, however since the
write to DEV_OFF takes effect immediately the I2C completion interrupt
is moot anyway, and as the very last thing written to the console it is
only visible to users going out of their way to capture serial output.

Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
[ rm: note potential warning in commit message ]
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 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


  reply	other threads:[~2020-01-12  1:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12  1:54 [PATCH v2 0/5] mfd: RK8xx tidyup Robin Murphy
2020-01-12  1:55 ` Robin Murphy [this message]
2020-02-26 10:32   ` [PATCH v2 1/5] mfd: rk808: Always use poweroff when requested Lee Jones
2020-01-12  1:55 ` [PATCH v2 2/5] mfd: rk808: Ensure suspend/resume hooks always work Robin Murphy
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` [PATCH v2 3/5] mfd: rk808: Stop using syscore ops Robin Murphy
2020-02-26  9:45   ` Lee Jones
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` [PATCH v2 4/5] mfd: rk808: Reduce shutdown duplication Robin Murphy
2020-02-26 10:32   ` Lee Jones
2020-01-12  1:55 ` [PATCH v2 5/5] mfd: rk808: Convert RK805 to shutdown/suspend hooks Robin Murphy
2020-02-26 10:33   ` Lee Jones
2020-01-12 10:17 ` [PATCH v2 0/5] mfd: RK8xx tidyup Soeren Moch
2020-01-13 14:51 ` Anand Moon
2020-02-18 21:44 ` Robin Murphy
2020-04-27 18:41 ` Anand Moon
2020-04-27 18:46   ` Soeren Moch
2020-04-27 18:56     ` Anand Moon

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=233bf172a5310658d703b11be6e637d6c4d46338.1578789410.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=heiko@sntech.de \
    --cc=lee.jones@linaro.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).