Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5003767pxj; Tue, 25 May 2021 23:56:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycLAgmyBuGfXA5qfFh9UBlmwSvBXxWu2SXpnmfZ3zfuFskV/I0T8fE4AlNuRQMQKIwxU5A X-Received: by 2002:a17:906:3b8f:: with SMTP id u15mr32110657ejf.444.1622012164702; Tue, 25 May 2021 23:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622012164; cv=none; d=google.com; s=arc-20160816; b=Ra2BUkOBm3knphQQBCHTdin+GniMjhsZxNdjP5spPmbWHNgu/ynSMzh6Cu+J/wtEi9 NiyiE0rGGlTcGLwKUR1HPhmborvPcL30ym2bhUwpylzAJufk+LJmtJMRikpBalxFAuGN z5ulOPlDHvECHfA2d24TW123lu4ZB0v95nPreN1NgZZNnVCGbkgmoZk32+Nm8yDdPb9m 7BwDPC9oTUpkRHRqc0uvTaidd0SLBW2KExxOa04JsTateU7i698p8mMnA+9Rwf9tA3wA XWVlXE9I5rrJH2Niv4BepAMGEm2mE6wEdeLeU1LRZlpKVdxGjjy3rcsMdMnJh/IxBiCb VIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/v1QQTcREiN6/+Er5o4Rhm/2omeG7aAqfEnf8Wpxww0=; b=UBV3yWswV8dbzPcKT8v+TEuTGo5v5I/gzF5F02tQ6DBHOQgiQsHqJKj7MCsRhwSeK0 Snm7r7xl7NXVcNPEvHKsljmnLSv4gnYMmVPuTIhRdNlXqKkQ51df5F4f0uqWLtp/zXrm Hu3r0MAw//WcBOU1DOktwCQ2Q7Hmod2LsS5HaCrsroWhbghu9kLKTx2zmmhBw5x9hbCB CqA+zNaQK50hR3sFgkg6Knx7UMiiO7d/UlELa9cyXK1ZZVzzBj1wW7oPKG19TLqZxH56 ijyhJSSzsE7pC5Wp3kDAvv1aMzKMfo504URmEo2yLfrC8TrrUNB5w52GAwsE4eMIODSz DP3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si16597484edw.414.2021.05.25.23.55.40; Tue, 25 May 2021 23:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232991AbhEZGx6 (ORCPT + 99 others); Wed, 26 May 2021 02:53:58 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:37230 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232869AbhEZGxs (ORCPT ); Wed, 26 May 2021 02:53:48 -0400 X-UUID: bbcbee18ddf841739a1cc09ddd5a1bd2-20210526 X-UUID: bbcbee18ddf841739a1cc09ddd5a1bd2-20210526 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 941265013; Wed, 26 May 2021 14:52:13 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 26 May 2021 14:52:12 +0800 Received: from mtksdaap41.mediatek.inc (172.21.77.4) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 26 May 2021 14:52:12 +0800 From: Hsin-Hsiung Wang To: Lee Jones , Rob Herring , Matthias Brugger , Liam Girdwood , Mark Brown , Eddie Huang , Alessandro Zummo , Alexandre Belloni , Fei Shao CC: Sean Wang , Hsin-Hsiung Wang , Yuchen Huang , , , , , , , Subject: [PATCH v8 2/8] rtc: mt6397: refine RTC_TC_MTH Date: Wed, 26 May 2021 14:52:01 +0800 Message-ID: <1622011927-359-3-git-send-email-hsin-hsiung.wang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1622011927-359-1-git-send-email-hsin-hsiung.wang@mediatek.com> References: <1622011927-359-1-git-send-email-hsin-hsiung.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds RTC_TC_MTH_MASK to support new chips. Signed-off-by: Yuchen Huang Signed-off-by: Hsin-Hsiung Wang Acked-by: Alexandre Belloni --- 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