[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1622011927-359-3-git-send-email-hsin-hsiung.wang@mediatek.com>
Date: Wed, 26 May 2021 14:52:01 +0800
From: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
To: Lee Jones <lee.jones@...aro.org>, Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Eddie Huang <eddie.huang@...iatek.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Fei Shao <fshao@...omium.org>
CC: Sean Wang <sean.wang@...iatek.com>,
Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>,
Yuchen Huang <yuchen.huang@...iatek.com>,
<devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-rtc@...r.kernel.org>,
<srv_heupstream@...iatek.com>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: [PATCH v8 2/8] rtc: mt6397: refine RTC_TC_MTH
This patch adds RTC_TC_MTH_MASK to support new chips.
Signed-off-by: Yuchen Huang <yuchen.huang@...iatek.com>
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>
Acked-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
changes since v7:
- no change.
---
drivers/rtc/rtc-mt6397.c | 2 +-
include/linux/mfd/mt6397/rtc.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 6655035..80dc479 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -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);
diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h
index c3748b5..068ae1c 100644
--- a/include/linux/mfd/mt6397/rtc.h
+++ b/include/linux/mfd/mt6397/rtc.h
@@ -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
--
2.6.4
Powered by blists - more mailing lists