public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Sangbeom Kim <sbkim73@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	Anand Moon <linux.amoon@gmail.com>
Subject: [PATCH] regulator: s2mps11: Added shutdown function to poweroff Odroid-XU3
Date: Wed, 24 Jun 2015 16:46:28 +0930	[thread overview]
Message-ID: <1435130188-4087-1-git-send-email-linux.amoon@gmail.com> (raw)

Added .shutdown function to s2mps11 to help poweroff the board succefully.
The device drivers set the register to turn off the PMIC.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
Changes fixes the poweroff
root@odroidxu3:~# poweroff

Broadcast message from root@odroidxu3
        (/dev/ttySAC2) at 13:08 ...

The system is going down for power off NOW!
root@odroidxu3:~# wait-for-state stop/waiting
 * Stopping rsync daemon rsync                                           [ OK ]
 * Stopping RDP Session manager                                          [ OK ]
 * Stopping NTP server ntpd                                              [ OK ]
 * Asking all remaining processes to terminate...                        [ OK ]
 * All processes ended within 1 seconds...                               [ OK ]
nm-dispatcher.action: Caught signal 15, shutting down...
ModemManager[2134]: <warn>  Could not acquire the 'org.freedesktop.ModemManager1' service name

ModemManager[2134]: <info>  ModemManager is shut down

 * Unmounting temporary filesystems...                                   [ OK ]
 * Deactivating swap...                                                  [ OK ]
 * Unmounting local filesystems...                                       [ OK ]
 * Will now halt
[  209.020280] reboot: Power down
[  209.122039] Power down failed, please power off system manually.
---
 drivers/regulator/s2mps11.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index ff82811..871f7b8 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -1060,6 +1060,13 @@ out:
 	return ret;
 }
 
+static void s2mps11_pmic_shutdown(struct platform_device *pdev)
+{
+	struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+
+	regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_CTRL1, 0xff, 0x00);
+}
+
 static const struct platform_device_id s2mps11_pmic_id[] = {
 	{ "s2mps11-pmic", S2MPS11X},
 	{ "s2mps13-pmic", S2MPS13X},
@@ -1074,6 +1081,7 @@ static struct platform_driver s2mps11_pmic_driver = {
 		.name = "s2mps11-pmic",
 	},
 	.probe = s2mps11_pmic_probe,
+	.shutdown = s2mps11_pmic_shutdown,
 	.id_table = s2mps11_pmic_id,
 };
 
-- 
1.9.1


             reply	other threads:[~2015-06-24  7:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  7:16 Anand Moon [this message]
2015-06-24  7:57 ` [PATCH] regulator: s2mps11: Added shutdown function to poweroff Odroid-XU3 Krzysztof Kozlowski
2015-06-24 10:32   ` Anand Moon
2015-06-24 10:57     ` Krzysztof Kozlowski
2015-07-11  7:12       ` Anand Moon
2015-07-11  7:57         ` Krzysztof Kozlowski
2015-07-14  9:33           ` Marek Szyprowski
2015-07-14  9:44             ` Krzysztof Kozlowski

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=1435130188-4087-1-git-send-email-linux.amoon@gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sbkim73@samsung.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