linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Yang <decatf@gmail.com>
To: Tony Lindgren <tony@atomide.com>, Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: [PATCH] mfd: tps65910: Properly disable the power on state
Date: Thu, 28 Feb 2019 11:57:30 -0500	[thread overview]
Message-ID: <20190228165730.GA14387@r> (raw)

In the tps65910/1 datasheets under "Device POWER ON Disable Conditions".
There are four conditions which can disable power on:
Long press interrupt (PWRON_LP_IT) OR thermal trip OR DEV_OFF bit OR
DEV_OFF_RST bit.

The Ouya game console has TPS65911. Before this patch the device will not
power off through the pm_power_off call. The power light stays on and the
device heatsink is warm. Long pressing the power button can power off the
device. After this patch the device powers off correctly when calling power
off through userspace software.

Signed-off-by: Robert Yang <decatf@gmail.com>
---
 drivers/mfd/tps65910.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index aa3d472a10ff..c067dcacbe61 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -445,8 +445,12 @@ static void tps65910_power_off(void)
 			DEVCTRL_PWR_OFF_MASK) < 0)
 		return;
 
-	tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL,
-			DEVCTRL_DEV_ON_MASK);
+	if (tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL,
+			DEVCTRL_DEV_ON_MASK) < 0)
+		return;
+
+	tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL,
+		DEVCTRL_DEV_OFF_MASK);
 }
 
 static int tps65910_i2c_probe(struct i2c_client *i2c,
-- 
2.17.1


                 reply	other threads:[~2019-02-28 16:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190228165730.GA14387@r \
    --to=decatf@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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).