rtc: sprd: Add new RTC power down check method
authorBaolin Wang <baolin.wang@linaro.org>
Thu, 31 May 2018 09:18:08 +0000 (17:18 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 31 May 2018 21:02:11 +0000 (23:02 +0200)
commita0defd7cfc2804796144545e00aaf74a486adbe7
treed0b7b5732a69eb92010805f4f044009b84953254
parent09018d4bd7994c2c9f775029bc24589bc85f76fa
rtc: sprd: Add new RTC power down check method

We should use the new method to check if RTC was powered down, which
is more solid. Since we have introduced power control and power status
registers, and we just check if the power status is the default value
(0x96), if yes that means the RTC has been powered down. Meanwhile We
can set the power control register to be one valid value to change
the power status to indicate RTC device is valid now.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-sc27xx.c