summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-sc27xx.c
AgeCommit message (Collapse)AuthorFilesLines
2018-10-25rtc: sc27xx: Always read normal alarm when registering RTC deviceBaolin Wang1-2/+6
When registering one RTC device, it will check to see if there is an alarm already set in RTC hardware by reading RTC alarm, at this time we should always read the normal alarm put in always-on region by checking the rtc->registered flag. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-10-25rtc: sc27xx: Add check to see if need to enable the alarm interruptBaolin Wang1-0/+33
The RTC interrupt enable register is not put in always-power-on region supplied by VDDRTC, so we should check if we need enable the alarm interrupt when system booting. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-10-25rtc: sc27xx: Remove interrupts disable and clear in probe()Baolin Wang1-20/+0
When registering one rtc device, it will check to see if there is an alarm already set in rtc hardware by issuing __rtc_read_alarm(). So we should not disable the RTC interrupts and clear the interrupts status in probe() function. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-10-25rtc: sc27xx: Clear SPG value update interrupt statusBaolin Wang1-1/+2
We should clear the SPG value update interrupt status once the SPG value is updated successfully, in case incorrect status validation for next time. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-10-25rtc: sc27xx: Set wakeup capability before registering rtc deviceBaolin Wang1-1/+3
Set wakeup capability before registering rtc device, in case the alarmtimer can find one available rtc device. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-06-01rtc: sprd: Add new RTC power down check methodBaolin Wang1-23/+24
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>
2018-05-03rtc: sprd: Add RTC hardware rangeBaolin Wang1-0/+2
The SC27xx RTC can support dates from 1970-01-01 00:00:00 to 2149-06-06 23:59:59. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-05-03rtc: sprd: Change to use devm_rtc_allocate_device()Baolin Wang1-4/+10
This is a preparation patch, changing to use devm_rtc_allocate_device() that can allow driver to set 'range_max' and 'range_min' for the RTC device. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-02rtc: sc27xx: stop validating rtc_time in .read_timeAlexandre Belloni1-1/+1
rtc_time64_to_tm never generates an invalid tm. It is not necessary to validate it. Also, the RTC core is always calling rtc_valid_tm after the read_time callback. Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2017-11-21rtc: sc27xx: Add Spreadtrum SC27xx PMIC RTC driverBaolin Wang1-0/+662
This patch adds the Spreadtrum RTC driver, which embedded in the Spreadtrum SC27xx series PMICs. Signed-off-by: Baolin Wang <baolin.wang@spreadtrum.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>