power: qpnp-qg: Ignore the shutdown SOC based on certain conditions

There might be a case where the battery-temperature changes
significantly (cold -> good) across shutdown, which may
result in a huge change the SOC. Using shutdown SOC under this
condition may not be ideal, hence add a logic to ignore the
shutdown SOC if battery-temperature exceeds a temperature. This
temperature difference can be specified via the DT property
"qcom,shutdown-temp-diff".

Also, ignore the shutdown SOC based on the SOC difference
between shutdown SOC and PON SOC. Use "qcom,shutdown-soc-threshold"
property to specify the SOC difference.

Change-Id: I14b274dd7cad98b55fdce1aaa27783272231afdf
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
3 files changed