From patchwork Wed Jun 24 07:16:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 6666111 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9393EC05AC for ; Wed, 24 Jun 2015 07:16:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C10F420585 for ; Wed, 24 Jun 2015 07:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D25A720616 for ; Wed, 24 Jun 2015 07:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbbFXHQu (ORCPT ); Wed, 24 Jun 2015 03:16:50 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35042 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbbFXHQt (ORCPT ); Wed, 24 Jun 2015 03:16:49 -0400 Received: by pactm7 with SMTP id tm7so23435199pac.2; Wed, 24 Jun 2015 00:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Aq7R6xm1FJ6f3DdScrF9pzj1v0nKuiSPD1XvJePnej4=; b=k1804ZULcjMLiKasUwtdMdxcI+dF+naXSCGv6rmy49FRxPGR4delFDfbK649ALJ+07 7uA3dFF3zXz9Rcu8u+betmHapGZFQqsJpqI+Hiw7AKlwkkOpXZy/l74NoiVPBcbAwN6y WD87C+pwIAbRs3T7Y0Z7Y8x13oQc2gKDkX75WH3Rmc3SLMAKNsPUyPiTu4YoCVJz4mNz YuwD2YhyQFK/xJ7bl6yh1IWBRcoyhaLc97AilYUmoWq3KIsK7cCrRjAsslZIG/mvZs2u HCyDGb65UHA38yVA5ZuzSXWkrPFtD7ZbalR9KEutyWmss2gmvnkqyFQ8rfFK4v4nFrrY vqcw== X-Received: by 10.66.243.69 with SMTP id ww5mr78171285pac.106.1435130208402; Wed, 24 Jun 2015 00:16:48 -0700 (PDT) Received: from localhost.localdomain ([115.117.45.10]) by mx.google.com with ESMTPSA id sc1sm25756947pac.36.2015.06.24.00.16.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 00:16:46 -0700 (PDT) From: Anand Moon To: Sangbeom Kim , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Anand Moon Subject: [PATCH] regulator: s2mps11: Added shutdown function to poweroff Odroid-XU3 Date: Wed, 24 Jun 2015 16:46:28 +0930 Message-Id: <1435130188-4087-1-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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]: Could not acquire the 'org.freedesktop.ModemManager1' service name ModemManager[2134]: 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, };