From patchwork Fri Aug 12 08:28:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3410 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 62C2D23F4D for ; Fri, 12 Aug 2011 08:29:08 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3205AA1875B for ; Fri, 12 Aug 2011 08:29:08 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 31so2010813qyk.11 for ; Fri, 12 Aug 2011 01:29:08 -0700 (PDT) Received: by 10.229.16.200 with SMTP id p8mr442851qca.22.1313137747965; Fri, 12 Aug 2011 01:29:07 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.190.71 with SMTP id dh7cs141468qcb; Fri, 12 Aug 2011 01:29:07 -0700 (PDT) Received: from mr.google.com ([10.213.3.153]) by 10.213.3.153 with SMTP id 25mr532224ebn.15.1313137747635 (num_hops = 1); Fri, 12 Aug 2011 01:29:07 -0700 (PDT) Received: by 10.213.3.153 with SMTP id 25mr402534ebn.15.1313137746841; Fri, 12 Aug 2011 01:29:06 -0700 (PDT) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id o53si2016544eeb.30.2011.08.12.01.29.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Aug 2011 01:29:06 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTkTkTLJninDMLCVdiW5RRpjkQFG9XpMq@postini.com; Fri, 12 Aug 2011 08:29:06 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 672E2121; Fri, 12 Aug 2011 08:28:57 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1642317B; Fri, 12 Aug 2011 08:28:57 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 9286CA807D; Fri, 12 Aug 2011 10:28:52 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 12 Aug 2011 10:28:56 +0200 From: Linus Walleij To: Samuel Ortiz , Cc: Lee Jones , Sebastian Rasmussen , Linus Walleij Subject: [PATCH 10/23] mfd/db8500-prcmu: reset code retrieval Date: Fri, 12 Aug 2011 10:28:53 +0200 Message-ID: <1313137733-30914-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Sebastian Rasmussen This implements the reset code retrieval function so we can ipso facto get to know how the system was reset. Signed-off-by: Sebastian Rasmussen Signed-off-by: Linus Walleij --- drivers/mfd/db8500-prcmu.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index cb58e44..6fd4e29 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -1836,6 +1836,17 @@ void db8500_prcmu_system_reset(u16 reset_code) } /** + * db8500_prcmu_get_reset_code - Retrieve SW reset reason code + * + * Retrieves the reset reason code stored by prcmu_system_reset() before + * last restart. + */ +u16 db8500_prcmu_get_reset_code(void) +{ + return readw(tcdm_base + PRCM_SW_RST_REASON); +} + +/** * prcmu_reset_modem - ask the PRCMU to reset modem */ void prcmu_modem_reset(void)