Power: add an API to log wakeup reasons

Squashed commit of following taken from https://android.googlesource.com/kernel/exynos/+/android-5.0.1_r0.2/:

commit 535c3867dddc5a89da97d17e9c587a44695861dd
Author: Ruchi Kandoi <kandoiruchi@google.com>
Date:   Thu Feb 20 17:50:48 2014 -0800

POWER: Add an API call to log wakeup reason

commit 4b3dfc33ff967bf66d58bff983858f71b105a24e
Author: Ruchi Kandoi <kandoiruchi@google.com>
Date:   Thu Apr 24 14:31:57 2014 -0700

    Power: Changes the permission to read only for sysfs file
    /sys/kernel/wakeup_reasons/last_resume_reason

    Change-Id: If25e8e416ee9726996518b58b6551a61dc1591e3
    Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>

commit b5ea40cdfcf38296535f931a7e5e7bf47b6fad7f
Author: Ruchi Kandoi <kandoiruchi@google.com>
Date:   Fri Mar 7 12:54:30 2014 -0800

    Power: Add guard condition for maximum wakeup reasons

    Ensure the array for the wakeup reason IRQs does not overflow.

commit 0084483d5bffb71b1216f4e8f578ffc6e0ff1a83
Author: Ruchi Kandoi <kandoiruchi@google.com>
Date:   Thu Feb 20 19:47:38 2014 -0800

    POWER: fix compile warnings in log_wakeup_reason

    Change I81addaf420f1338255c5d0638b0d244a99d777d1 introduced compile
    warnings, fix these.

commit f7b437fa47b7931daf9884e0046ddfe88ba54374
Author: Ruchi Kandoi <kandoiruchi@google.com>
Date:   Wed Feb 19 15:30:47 2014 -0800

    Power: add an API to log wakeup reasons

    Add API log_wakeup_reason() and expose it to userspace via sysfs path
    /sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: If91cf2731961abbefc38899e512beb48708abba2