From: Sebastian Rasmussen Date: Fri, 12 Aug 2011 08:28:53 +0000 (+0200) Subject: mfd: db8500-prcmu reset code retrieval X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=597045de35caaef68a11b6defbb618710e1a1e52;p=linux-beck.git mfd: db8500-prcmu reset code retrieval 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 Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index cb58e44b1e45..6fd4e2993520 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -1835,6 +1835,17 @@ void db8500_prcmu_system_reset(u16 reset_code) writel(1, PRCM_APE_SOFTRST); } +/** + * 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 */