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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
Sebastian Rasmussen 2011-08-12 10:28:53 +02:00 • committed by Samuel Ortiz
commit 597045de35

View file

@ -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
*/