platform: qpnp-power-on: Set boot reason in procfs

Assigns a value to the boot_reason procfs property in
qpnp-power-on. This property can be read via
/proc/sys/kernel/boot_reason. The value for this property
will reflect lowest bit set in the PON_REASON1 PMIC register.
For example, if bit 0 is set in the register, then
boot_reason will have a value of 1. If no bits are set
in the register, then boot_reason will have a value of 0.

For existing PMIC chips, the following mapping applies
for the value of boot_reason:

0 -> unknown
1 -> hard reset
2 -> sudden momentary power loss (SMPL)
3 -> real time clock (RTC)
4 -> DC charger inserted
5 -> USB charger inserted
6 -> PON1 pin toggled (for secondary PMICs)
7 -> CBLPWR_N pin toggled (for external power supply)
8 -> KPDPWR_N pin toggled (power key pressed)

Change-Id: Icf2be66165fd01d3063282fcbfb2b115480e7b5c
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
1 file changed