sc7180: Handle the exception cases of power on
sc7180: Handle the exception cases of power on

Make the switchcap and PMIC functions return a success or error
code. In the power on sequence, an error happening in the middle
will make it skip the remaining steps, and then calls the power
off sequence to restore back S5. The power off sequence don't
care about any error and perform the entire procedure.

BRANCH=None
BUG=b:159101052
TEST=Manually trigger power on and power off.
TEST=Forced to a switchcap error, it went back to S5.
> gpioset DA9313_GPIO0 0
> power on
Requesting power on
> RTC: 0x5ed1d4a7 (1590809767.00 s)
[7177.018477 power state 4 = G3->S5, in 0x0005]
RTC: 0x5ed1d4a7 (1590809767.00 s)
[7177.019409 power state 1 = S5, in 0x0005]
[7177.019918 power on 4]
RTC: 0x5ed1d4a7 (1590809767.00 s)
[7177.021168 power state 5 = S5->S3, in 0x0005]
[7177.021700 power button released in time]
[7177.024143 set_system_power(1)]
[7177.076708 SWITCHCAP NO POWER GOOD!]
[7177.187407 set_system_power(0)]
RTC: 0x5ed1d4a7 (1590809767.00 s)
[7177.188564 power state 1 = S5, in 0x0005]

Change-Id: Iaf2676d84513056b3a1deb4f4c554c607e588c37
Signed-off-by: Wai-Hong Tam <04b587fdf5845741a0c5a8b9cd59ca72d73ef8fc@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2250668
Reviewed-by: Alexandru M Stan <1784cbba6d7675b1eba55eaefe41c7672ad9da3b@chromium.org>
Reviewed-by: Stephen Boyd <eeb31768d3df4444d6703fd44d40e628b44c8e77@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec