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: 102450 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1848245qge; Tue, 26 Apr 2016 14:45:51 -0700 (PDT) X-Received: by 10.98.11.78 with SMTP id t75mr6874010pfi.72.1461707151638; Tue, 26 Apr 2016 14:45:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bw8si986035pad.127.2016.04.26.14.45.51; Tue, 26 Apr 2016 14:45:51 -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; 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 S1753220AbcDZVpr (ORCPT + 29 others); Tue, 26 Apr 2016 17:45:47 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:50003 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbcDZVpk (ORCPT ); Tue, 26 Apr 2016 17:45:40 -0400 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: [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= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.0 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__ */