aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rk808.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-rk808.c')
-rw-r--r--drivers/rtc/rtc-rk808.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rk808.c b/drivers/rtc/rtc-rk808.c
index df42257668ac..91ca0bc1b484 100644
--- a/drivers/rtc/rtc-rk808.c
+++ b/drivers/rtc/rtc-rk808.c
@@ -67,15 +67,21 @@ static int rk808_rtc_readtime(struct device *dev, struct rtc_time *tm)
67 /* Force an update of the shadowed registers right now */ 67 /* Force an update of the shadowed registers right now */
68 ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG, 68 ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG,
69 BIT_RTC_CTRL_REG_RTC_GET_TIME, 69 BIT_RTC_CTRL_REG_RTC_GET_TIME,
70 0); 70 BIT_RTC_CTRL_REG_RTC_GET_TIME);
71 if (ret) { 71 if (ret) {
72 dev_err(dev, "Failed to update bits rtc_ctrl: %d\n", ret); 72 dev_err(dev, "Failed to update bits rtc_ctrl: %d\n", ret);
73 return ret; 73 return ret;
74 } 74 }
75 75
76 /*
77 * After we set the GET_TIME bit, the rtc time can't be read
78 * immediately. So we should wait up to 31.25 us, about one cycle of
79 * 32khz. If we clear the GET_TIME bit here, the time of i2c transfer
80 * certainly more than 31.25us: 16 * 2.5us at 400kHz bus frequency.
81 */
76 ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG, 82 ret = regmap_update_bits(rk808->regmap, RK808_RTC_CTRL_REG,
77 BIT_RTC_CTRL_REG_RTC_GET_TIME, 83 BIT_RTC_CTRL_REG_RTC_GET_TIME,
78 BIT_RTC_CTRL_REG_RTC_GET_TIME); 84 0);
79 if (ret) { 85 if (ret) {
80 dev_err(dev, "Failed to update bits rtc_ctrl: %d\n", ret); 86 dev_err(dev, "Failed to update bits rtc_ctrl: %d\n", ret);
81 return ret; 87 return ret;