Skip to content

Commit

Permalink
rtc: mt6397: refine RTC_TC_MTH
Browse files Browse the repository at this point in the history
This patch adds RTC_TC_MTH_MASK to support new chips.

Signed-off-by: Yuchen Huang <yuchen.huang@mediatek.com>
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Hsin-Hsiung Wang authored and Lee Jones committed Jun 1, 2021
1 parent d8570c1 commit be60652
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-mt6397.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static int __mtk_rtc_read_time(struct mt6397_rtc *rtc,
tm->tm_min = data[RTC_OFFSET_MIN];
tm->tm_hour = data[RTC_OFFSET_HOUR];
tm->tm_mday = data[RTC_OFFSET_DOM];
tm->tm_mon = data[RTC_OFFSET_MTH];
tm->tm_mon = data[RTC_OFFSET_MTH] & RTC_TC_MTH_MASK;
tm->tm_year = data[RTC_OFFSET_YEAR];

ret = regmap_read(rtc->regmap, rtc->addr_base + RTC_TC_SEC, sec);
Expand Down
1 change: 1 addition & 0 deletions include/linux/mfd/mt6397/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define RTC_AL_MASK_DOW BIT(4)

#define RTC_TC_SEC 0x000a
#define RTC_TC_MTH_MASK 0x000f
/* Min, Hour, Dom... register offset to RTC_TC_SEC */
#define RTC_OFFSET_SEC 0
#define RTC_OFFSET_MIN 1
Expand Down

0 comments on commit be60652

Please sign in to comment.