Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5411406ybg; Tue, 22 Oct 2019 02:52:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTDJm8XK6DFNrnhzcqUAHwq9qfPy5NeBxX+BhttX0E1XmM/ylF7dfnzitFqtDzrLvKHqEQ X-Received: by 2002:aa7:dd18:: with SMTP id i24mr30639580edv.239.1571737970137; Tue, 22 Oct 2019 02:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571737970; cv=none; d=google.com; s=arc-20160816; b=fEcjmqC9l3HQ1itATYKXBN3JaeAanFLhy2jnk91eQC6uNRTmOx3T0EjX+I+ReMUQfV Rmn4Bxt8e0F45xiZn+dVB7Skte4zA7LNCejROwsgIqacYTxb8dp/03aUNzI6VwseVFcA HOFXxEDzbB5130aHxxJkP98QRjP4u6gqR/AiXWP2yRbONunmLUkbvPiEPa5596EusJQ2 uvQR+LnyaEv66sOuftTpHRUEVDgUdkcD+1zd222kTHmE0lU10UFqsd/qz6Wl9zEkWW69 oXGYc7QFpnC5GnHgjxny3aUyx2WjkirGPEolrtNWE0a4Gc41lrLTMF0BDve7bTEdZe+9 NI0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:reply-to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=lViT4axgE++frgRb8P4Vmhsud9Pd9ttHvgeeuSBSZ1o=; b=nTv+XtzBKGL7LGy9DRDqq6bsWCpSkaSC6Yf+ngxzPQb4Ce+qeezZkpmgqmbuxEDpBO nWGAsfzLwlbT2mvXFDrTUyZFBbfY0iUfUfqWP/Fx3nEZPclaiE7VjE4Ju9C9AqzcZIEO I9SEwKttL4/iHN7aYX2U9T1zWdApBU0IXAm9Exfiq0klFJajSITrqPAULq7yZ3KtSiqr sQBle8uQETygOcNLY6uofmgjv9M8dqvo1YGsWTw/QHUwho+R3BljDx76AsuloEUzVZFx vEKOysKZOxYn5F2HLlTyAJSznScizgh/+iTI/jxVBTREbClILLJp6X/Thb9qQfhveGZv RdgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmx.net header.s=badeba3b8450 header.b=Y78YX+aZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si6419318eda.412.2019.10.22.02.52.25; Tue, 22 Oct 2019 02:52:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmx.net header.s=badeba3b8450 header.b=Y78YX+aZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731588AbfJVJuS (ORCPT + 99 others); Tue, 22 Oct 2019 05:50:18 -0400 Received: from mout.gmx.net ([212.227.15.19]:52665 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728182AbfJVJuR (ORCPT ); Tue, 22 Oct 2019 05:50:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1571737790; bh=OE/0MVT0jwdzZZXVDP3ALcBpFIqz2P+d6POGuGMFRDY=; h=X-UI-Sender-Class:Date:In-Reply-To:References:Subject:Reply-to:To: CC:From; b=Y78YX+aZjnPYPJGYXgg9E9WDr/o71f9xVzjw4w0Fb5u40zkwc/kJp3Lv/hx28MIqz Gl1C0msgglfINc9wyGEH3FCzmqTNaV4oSPbSHZG551Smpwjb2WuePRHOqgr14VcqVF sr4nU08T94aigvDi2nq1osHmLuTANbcyYscIyTRQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from frank-bq ([185.75.73.113]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2mFi-1hszdC0mD6-01335A; Tue, 22 Oct 2019 11:49:50 +0200 Date: Tue, 22 Oct 2019 11:49:47 +0200 User-Agent: K-9 Mail for Android In-Reply-To: <20190910070446.639-3-frank-w@public-files.de> References: <20190910070446.639-1-frank-w@public-files.de> <20190910070446.639-3-frank-w@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v7 2/7] rtc: mt6397: move some common definitions into rtc.h Reply-to: frank-w@public-files.de To: linux-mediatek@lists.infradead.org CC: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, Alexandre Belloni , Sean Wang , Alessandro Zummo , linux-pm@vger.kernel.org, Josef Friedl , linux-kernel@vger.kernel.org, Tianping Fang , Rob Herring , Sebastian Reichel , Matthias Brugger , Mark Rutland , Eddie Huang , Lee Jones , linux-arm-kernel@lists.infradead.org From: Frank Wunderlich Message-ID: X-Provags-ID: V03:K1:IDQ6Jwwc7LHNhDz0snpL9KvZ48Wwi3GQfUWLY3C+qRfc+xCLK16 VIpVqXjm0vosezYP0lKD6q1a3Ykm8DY1U1sI7Bzgslu6NVi/00Gc8ftSzoSI3DohyGHzk6K YLisBIsWGAhnS+1mr95nVB3M2m7Z/RaHwT6BEaaQjhKAM67qKcylpx6isItv2H5Nnw93gLf TwUjRIpjNUSgdx9+zniTA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:soT82Ffej2w=:7rJfWtDTS3SX+upAw34teJ pdr/VwAVmlNWPBFT+zyNEb940CW5sHe5qMrGextya3JYDZUHekANpzUbAgv8aO+vybIsFeqXR R6MZcr6F+OgckblbB3u7N5ICw8XyRtcY8hlZkRHehl9harQdgQLjrwxZ9B16tH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N7iopaGvFJy5e6nc1fNpc0BDq aHf2osz2ZrW8yuWYogMPdqeQ/2uKCIXXQTDxZV+ucRjLJygJxfp4lG+p3u1I= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Is it ok now? It seems not yet merged to next=2E Other code is based on thi= s=2E Am 10=2E September 2019 09:04:41 MESZ schrieb Frank Wunderlich : >From: Josef Friedl > >move code to separate header-file to reuse definitions later >in poweroff-driver (drivers/power/reset/mt6323-poweroff=2Ec) > >Suggested-by: Frank Wunderlich >Signed-off-by: Josef Friedl >Signed-off-by: Frank Wunderlich >Acked-by: Alexandre Belloni >Acked-for-MFD-by: Lee Jones >--- >changes since v6: updated copyright >changes since v5: none >changes since v4: none >changes since v3: none >changes since v2: add missing commit-message >--- > drivers/rtc/rtc-mt6397=2Ec | 55 +------------------------- > include/linux/mfd/mt6397/rtc=2Eh | 71 ++++++++++++++++++++++++++++++++++ > 2 files changed, 72 insertions(+), 54 deletions(-) > create mode 100644 include/linux/mfd/mt6397/rtc=2Eh > >diff --git a/drivers/rtc/rtc-mt6397=2Ec b/drivers/rtc/rtc-mt6397=2Ec >index b46ed4dc7015=2E=2Ec08ee5edf865 100644 >--- a/drivers/rtc/rtc-mt6397=2Ec >+++ b/drivers/rtc/rtc-mt6397=2Ec >@@ -9,60 +9,7 @@ > #include > #include > #include >-#include >-#include >-#include >-#include >-#include >-#include >- >-#define RTC_BBPU 0x0000 >-#define RTC_BBPU_CBUSY BIT(6) >- >-#define RTC_WRTGR 0x003c >- >-#define RTC_IRQ_STA 0x0002 >-#define RTC_IRQ_STA_AL BIT(0) >-#define RTC_IRQ_STA_LP BIT(3) >- >-#define RTC_IRQ_EN 0x0004 >-#define RTC_IRQ_EN_AL BIT(0) >-#define RTC_IRQ_EN_ONESHOT BIT(2) >-#define RTC_IRQ_EN_LP BIT(3) >-#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL) >- >-#define RTC_AL_MASK 0x0008 >-#define RTC_AL_MASK_DOW BIT(4) >- >-#define RTC_TC_SEC 0x000a >-/* Min, Hour, Dom=2E=2E=2E register offset to RTC_TC_SEC */ >-#define RTC_OFFSET_SEC 0 >-#define RTC_OFFSET_MIN 1 >-#define RTC_OFFSET_HOUR 2 >-#define RTC_OFFSET_DOM 3 >-#define RTC_OFFSET_DOW 4 >-#define RTC_OFFSET_MTH 5 >-#define RTC_OFFSET_YEAR 6 >-#define RTC_OFFSET_COUNT 7 >- >-#define RTC_AL_SEC 0x0018 >- >-#define RTC_PDN2 0x002e >-#define RTC_PDN2_PWRON_ALARM BIT(4) >- >-#define RTC_MIN_YEAR 1968 >-#define RTC_BASE_YEAR 1900 >-#define RTC_NUM_YEARS 128 >-#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR) >- >-struct mt6397_rtc { >- struct device *dev; >- struct rtc_device *rtc_dev; >- struct mutex lock; >- struct regmap *regmap; >- int irq; >- u32 addr_base; >-}; >+#include >=20 > static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc) > { >diff --git a/include/linux/mfd/mt6397/rtc=2Eh >b/include/linux/mfd/mt6397/rtc=2Eh >new file mode 100644 >index 000000000000=2E=2Ef84b9163c0ee >--- /dev/null >+++ b/include/linux/mfd/mt6397/rtc=2Eh >@@ -0,0 +1,71 @@ >+/* SPDX-License-Identifier: GPL-2=2E0 */ >+/* >+ * Copyright (C) 2014-2019 MediaTek Inc=2E >+ * >+ * Author: Tianping=2EFang >+ * Sean Wang >+ */ >+ >+#ifndef _LINUX_MFD_MT6397_RTC_H_ >+#define _LINUX_MFD_MT6397_RTC_H_ >+ >+#include >+#include >+#include >+#include >+ >+#define RTC_BBPU 0x0000 >+#define RTC_BBPU_CBUSY BIT(6) >+#define RTC_BBPU_KEY (0x43 << 8) >+ >+#define RTC_WRTGR 0x003c >+ >+#define RTC_IRQ_STA 0x0002 >+#define RTC_IRQ_STA_AL BIT(0) >+#define RTC_IRQ_STA_LP BIT(3) >+ >+#define RTC_IRQ_EN 0x0004 >+#define RTC_IRQ_EN_AL BIT(0) >+#define RTC_IRQ_EN_ONESHOT BIT(2) >+#define RTC_IRQ_EN_LP BIT(3) >+#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL) >+ >+#define RTC_AL_MASK 0x0008 >+#define RTC_AL_MASK_DOW BIT(4) >+ >+#define RTC_TC_SEC 0x000a >+/* Min, Hour, Dom=2E=2E=2E register offset to RTC_TC_SEC */ >+#define RTC_OFFSET_SEC 0 >+#define RTC_OFFSET_MIN 1 >+#define RTC_OFFSET_HOUR 2 >+#define RTC_OFFSET_DOM 3 >+#define RTC_OFFSET_DOW 4 >+#define RTC_OFFSET_MTH 5 >+#define RTC_OFFSET_YEAR 6 >+#define RTC_OFFSET_COUNT 7 >+ >+#define RTC_AL_SEC 0x0018 >+ >+#define RTC_PDN2 0x002e >+#define RTC_PDN2_PWRON_ALARM BIT(4) >+ >+#define RTC_MIN_YEAR 1968 >+#define RTC_BASE_YEAR 1900 >+#define RTC_NUM_YEARS 128 >+#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR) >+ >+#define MTK_RTC_POLL_DELAY_US 10 >+#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ)) >+ >+struct mt6397_rtc { >+ struct device *dev; >+ struct rtc_device *rtc_dev; >+ >+ /* Protect register access from multiple tasks */ >+ struct mutex lock; >+ struct regmap *regmap; >+ int irq; >+ u32 addr_base; >+}; >+ >+#endif /* _LINUX_MFD_MT6397_RTC_H_ */