From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6770C3A589 for ; Tue, 20 Aug 2019 19:48:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB68422DA7 for ; Tue, 20 Aug 2019 19:48:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ROraKv75" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB68422DA7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MK+Otg2050lRA0mcfoRlmRXxCCTACic04Dl1umYyxI8=; b=ROraKv75Yt4zCX 2GUZAXACzvlBGSnApE+fWZ9YBAqj9ISosc1EDJtNMpAS6FtPmmQplwhN5X6a+W86fQJC9HyuSfX0X zln59Sb7FJ5n4jmNEtqTRMziPC5Fhbon13IvjcfR0pM5FibyWEehqa4Y3jdLYibvlZ4ymN4f1EoWQ P6yF1wG6GAPtBDFzbkFbBDRpaWoZlvO6CoR1k/KYV+LRJ+2yFmpDWOQ40l+5HJndE5XO+UGafkhXl A5/dxN8+cyCoL0aWyPhBAegSoy6U19KYw5c59WmgQhKwwT1NoOjSKSUG/Hqva93KlMVEr8M8CZJRv Z6WUaKna+LuzZ9dhvhfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0A7B-0004LX-HG; Tue, 20 Aug 2019 19:48:21 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0A77-0004Kx-GJ; Tue, 20 Aug 2019 19:48:19 +0000 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id DE91D60004; Tue, 20 Aug 2019 19:48:03 +0000 (UTC) Date: Tue, 20 Aug 2019 21:48:03 +0200 From: Alexandre Belloni To: Frank Wunderlich Subject: Re: [PATCH v6 05/13] rtc: mt6397: move some common definitions into rtc.h Message-ID: <20190820194803.GW3545@piout.net> References: <20190818135611.7776-1-frank-w@public-files.de> <20190818135611.7776-6-frank-w@public-files.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190818135611.7776-6-frank-w@public-files.de> User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_124817_845329_220FFD51 X-CRM114-Status: GOOD ( 16.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, Josef Friedl , Sean Wang , "linux-arm-kernel @ lists . infradead . org Alessandro Zummo" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , Tianping Fang , Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Mark Rutland , Eddie Huang , Lee Jones , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/08/2019 15:56:03+0200, Frank Wunderlich wrote: > From: Josef Friedl > > move code to separate header-file to reuse definitions later > in poweroff-driver (drivers/power/reset/mt6323-poweroff.c) > > Suggested-by: Frank Wunderlich > Signed-off-by: Josef Friedl > Signed-off-by: Frank Wunderlich Acked-by: Alexandre Belloni > --- > changes since v5: none > changes since v4: none > changes since v3: none > changes since v2: add missing commit-message > --- > drivers/rtc/rtc-mt6397.c | 55 +------------------------- > include/linux/mfd/mt6397/rtc.h | 71 ++++++++++++++++++++++++++++++++++ > 2 files changed, 72 insertions(+), 54 deletions(-) > create mode 100644 include/linux/mfd/mt6397/rtc.h > > diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c > index b46ed4dc7015..c08ee5edf865 100644 > --- a/drivers/rtc/rtc-mt6397.c > +++ b/drivers/rtc/rtc-mt6397.c > @@ -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... 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 > > static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc) > { > diff --git a/include/linux/mfd/mt6397/rtc.h b/include/linux/mfd/mt6397/rtc.h > new file mode 100644 > index 000000000000..b702c29e8c74 > --- /dev/null > +++ b/include/linux/mfd/mt6397/rtc.h > @@ -0,0 +1,71 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (C) 2014-2018 MediaTek Inc. > + * > + * Author: Tianping.Fang > + * 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... 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_ */ > -- > 2.17.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel