From patchwork Tue Apr 26 21:44:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 615333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lf0-x23b.google.com (mail-lf0-x23b.google.com [IPv6:2a00:1450:4010:c07::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qvc802sRhz9t6N for ; Wed, 27 Apr 2016 07:45:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=UaWYfrQj; dkim-atps=neutral Received: by mail-lf0-x23b.google.com with SMTP id r18sf15355317lfr.0 for ; Tue, 26 Apr 2016 14:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=zCqYm/kt4yKSXkdsJXL1jKDQ1lpEKvI1pgjT6vW7AI0=; b=UaWYfrQj/ipJs/perWyNFWDs1vWbBV7sEVFRFfW/g87SXPfx4O5+jx5kbCMaKbp+xI JCt4NZUw+jbvGE8PaIxjmbdbiMYMWRTxMhZcbIFZvI7NsWTVNiLl6bTMwMPmLANjvN38 2sqfK3hio4TwxnQAH8OOrF2oVMtxEfhPik2U/huiq0A87BX7jjAf6HnelfNNi63wgitR +kfXnK5YDkOanWdLADUTtko2mkMgOcORUmucrcWCfGLKW4Jj+bOKOe/9vUKsqdp2U+mp CdKfB0NWmwRt1duGT59vc9Ih7CWLti3xRxXrjIpuiXJenzeA8uTYH01S7JHZRuTOGlt8 wLhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=zCqYm/kt4yKSXkdsJXL1jKDQ1lpEKvI1pgjT6vW7AI0=; b=baKBnTDqauAx3drZ0EmcL8Ah5/if7hLvR2n5Afijf9Brd+VteoSlTyeILOZfZYxOOY 2Ac/2dXI9idp0zS80LMECxvz5VYVMFDUZ6p6GXO1NeA9UmLBkVrWx/bo3g5m/8CzEnk+ OA3H1v2bjTS+aUbtn+OXIvvpoBOkwKhO8sbjOs7I2F69mCWd7HnjGMSJaXvNJ6C74NBM 1/dXmMqxRyaLJU9hmdj8Ov3Yv1UOLIhguiZXavLRivdGrdAxa2ycn76+3VCfyDKpk3yS Xj/zoyFa73Bc8ADeN7PvvhPbRNbgiIp+G7rShOM7+HHbJMccvh/QaaZtvue0KIIeDHKd zOgw== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AOPr4FWwCV5U2w+p5ncxgGDCtJnexpvL1uR+DuwhPS8B4K6VbkR9uYxjqd5wD4Wny9eg+Q== X-Received: by 10.25.15.29 with SMTP id e29mr109110lfi.1.1461707101245; Tue, 26 Apr 2016 14:45:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.25.89.18 with SMTP id n18ls640704lfb.30.gmail; Tue, 26 Apr 2016 14:45:00 -0700 (PDT) X-Received: by 10.112.140.138 with SMTP id rg10mr627453lbb.9.1461707100579; Tue, 26 Apr 2016 14:45:00 -0700 (PDT) Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.126.133]) by gmr-mx.google.com with ESMTPS id c7si113438wmf.2.2016.04.26.14.45.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:45:00 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.133; Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0MLC4r-1autff0H7B-000IM9; Tue, 26 Apr 2016 23:44:50 +0200 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Arnd Bergmann , tony.luck@intel.com, geert@linux-m68k.org, jejb@parisc-linux.org, deller@gmx.de, benh@kernel.crashing.org, mpe@ellerman.id.au, dalias@libc.org, dhowells@redhat.com, yasutake.koichi@jp.panasonic.com, rth@twiddle.net, ink@jurassic.park.msu.ru, linux-alpha@vger.kernel.org, x86@kernel.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, rtc-linux@googlegroups.com, linux-arch@vger.kernel.org Subject: [rtc-linux] [PATCH 6/8] char/genrtc: parisc: use asm-generic/rtc.h Date: Tue, 26 Apr 2016 23:44:10 +0200 Message-Id: <1461707052-1337718-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1461707052-1337718-1-git-send-email-arnd@arndb.de> References: <1461707052-1337718-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:sXjnu+yLbJ0+8mwMLqVfNGQCmCTwkOOIw8LW3r5jFUHt+q9Zwid oXdYXjz/tf3JbVRSW+bBjNuhiDwSPW0fApYuaGZER5Ay6JCcTPMjsNKMpBQRc6IRgmpBon7 W+trkalUKHKCJHg13HxbTFiqot/N2Qzw5lQMY7sDR0utS1nEHkN26R/UBxuIDce17pO7wL8 duftyI3heNq10EC8bGQeA== X-UI-Out-Filterresults: notjunk:1; V01:K0:MSF0vB5mxuQ=:Dvs55qd+W/DOWuTjpa0YAT Ur7c33pgU8Pw0Ox0RoXN9kXgBSVZBOAcUQzk3tZ9dsp2CjNe7DNCqxocos9Q0MGCX/Q+EGjgq h1FSyXXjlNQSdqisQyViAofmMX4H6MHTvSjeGCQNoxwf35h8n10Xoae8P53rn4Xj44HoleILN ABtjyKoaM1zNbFyIMAWV1fLMVLQULM8Wgjpnx0tU0P+kQ+qkw0NkYJZ7JsVTLCOH+Rmi2Pix5 YO63i+psYuxn4oA+DSG1e+TqFzr0kUmJvrc0XNMU2LaSyi3LfJWhIsHLunMQ1fZKZQ6KHsnOY GzfgLBAGCkZ03caSj0mPEut9jKf9SIU8d51JnfH6Z9H4IvCJhlq8c/Smx8Ty9/DNoRhwSzLBT ToD/tGlW7ess9SByeTpjSKdWixt6cMXg+okWez+a1NhAeeilpxNVFBKwxkiCOToqmila50z6l nTmogtS2u+8ZW7iOdoClhueDF3prOv1y+LpKpBp319Jh25q9YhqDCL49BySgCA7zru1SPT0iT pFnHv3HfA2OY+Ua26NEDtXtkzE5C7eFMTMaIO9gZNnNIygiOvc0tKdlKpoLTJl3v8PBCfZNMh NRGT9KDx9en742sgH2M0db4P1kDNZnx3O1VxGd8ZMboTXfJRcO2SyUkOUWf4ldi+9Jhfb6QLc REmwYLH0B+DGYQL4klnNUBxBZ1WpzoRMnNf3VlVjwq9ibK3BS5eZMqtnymNUNjxdB5dY= X-Original-Sender: arnd@arndb.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.227.126.133 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mailfrom=arnd@arndb.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The asm-generic/rtc.h header can now be included by architectures that provide their own set_rtc_time/get_rtc_time macros, letting us remove most of the common contents in the powerpc implementation. Signed-off-by: Arnd Bergmann --- arch/parisc/include/asm/rtc.h | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/arch/parisc/include/asm/rtc.h b/arch/parisc/include/asm/rtc.h index 099d641a42c2..d06cc581ecc2 100644 --- a/arch/parisc/include/asm/rtc.h +++ b/arch/parisc/include/asm/rtc.h @@ -12,26 +12,15 @@ #ifdef __KERNEL__ -#include +#define get_rtc_time parisc_get_rtc_time +#define set_rtc_time parisc_set_rtc_time +#include #include #define SECS_PER_HOUR (60 * 60) #define SECS_PER_DAY (SECS_PER_HOUR * 24) - -#define RTC_PIE 0x40 /* periodic interrupt enable */ -#define RTC_AIE 0x20 /* alarm interrupt enable */ -#define RTC_UIE 0x10 /* update-finished interrupt enable */ - -#define RTC_BATT_BAD 0x100 /* battery bad */ - -/* some dummy definitions */ -#define RTC_SQWE 0x08 /* enable square-wave output */ -#define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ -#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ -#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ - # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) @@ -44,7 +33,7 @@ static const unsigned short int __mon_yday[2][13] = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; -static inline unsigned int get_rtc_time(struct rtc_time *wtime) +static inline unsigned int parisc_get_rtc_time(struct rtc_time *wtime) { struct pdc_tod tod_data; long int days, rem, y; @@ -96,7 +85,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *wtime) return RTC_24H; } -static int set_rtc_time(struct rtc_time *wtime) +static int parisc_set_rtc_time(struct rtc_time *wtime) { u_int32_t secs; @@ -110,22 +99,5 @@ static int set_rtc_time(struct rtc_time *wtime) } -static inline unsigned int get_rtc_ss(void) -{ - struct rtc_time h; - - get_rtc_time(&h); - return h.tm_sec; -} - -static inline int get_rtc_pll(struct rtc_pll_info *pll) -{ - return -EINVAL; -} -static inline int set_rtc_pll(struct rtc_pll_info *pll) -{ - return -EINVAL; -} - #endif /* __KERNEL__ */ #endif /* __ASM_RTC_H__ */