From patchwork Tue Apr 26 21:44:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8946111 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE20B9F1D3 for ; Tue, 26 Apr 2016 21:47:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E32A02011B for ; Tue, 26 Apr 2016 21:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 072D8201EF for ; Tue, 26 Apr 2016 21:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333AbcDZVr3 (ORCPT ); Tue, 26 Apr 2016 17:47:29 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:51966 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbcDZVpo (ORCPT ); Tue, 26 Apr 2016 17:45:44 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0LhzeA-1bY4JP1Rsw-00n7Mk; Tue, 26 Apr 2016 23:44:49 +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 5/8] char/genrtc: powerpc: use asm-generic/rtc.h Date: Tue, 26 Apr 2016 23:44:09 +0200 Message-Id: <1461707052-1337718-6-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:n6EnnEqhTcyhUez+lE/8RFP0cwH+yHqEoK3+G7YpPf1MQ0qAb/h rrdRZ/m8fxh4Wo/C1ROrTVcz17U0HTicwoH05lXz5WgxjyMxSNNJy82PG1Ye4l5w393wnr2 Ryxjj6++VLbVG3o4vRmA0ZSxJHjK2TwGYaxzWgZ+Wy+KJeC9iuEbbwwqPbikUr9EEJq4wQe 7IVII3PqLbm+IF3fkJoiQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:xJZ/ob6cTmE=:yJ+b9/YSpzNPRm9v9dg29n VcUy+P+UtwGxw7Ow77Mfxiu3PoNrGf/Hy26F/L8r6VVlkXDyMoZH85QFGbbPSsk9khieiiU8H H5HGK5B9c6+uEp/IzVHal9yE1eobxfbiczTPW19emVM2xnaqmtpXq6PV85XhUxLk/bg4e7j9E s2etQrZcUb4nKXV/AEi7nYiKxSYUHG8fi/hBUiIV1UiZ2vOTsVdNTBYrG4H30O4hrYlPtfMAB hVpLTxTv+NF/P3OX20QUgqgg7itFHugQF4A+XrcVR5EFOxI/8BpeTY+RvP3Hz7xvJXiwYgU2J gDKgWIzEuVUZrlnLIJhLsm3kOP/bIV3R6JYRBytT6Yywqy1Hb9bkx527bs1YeVIZkXfHrOtkp FSsTNS61UB3WDzkG1bw96CKj0mN2C8KJmbMGtX0T0QQIvVa09a4n8Q7XCzKGFhKyb+Fr5aoOB wnhGB1rwd++uEaHA9oVuu0CZREe/mOtnWt9I+2tlRRUbT2pS+qUG1kg843K2Mac+gBLo/3Ptm W+dKyYdc7u69XZl80/+0bvcbp6QPbmdoB2o40wMHpfNDVw0te5xQ+cUILQF+UryOfofqEs1sb +EhI22m0AIFYTe3lfRYkxCE28C210+RSyKl7h+4bpz2Hz+9EI4W6I8h7XVAklazxjPh1g6a3D jDAt5ApsLKdvK8gI4VkKJDsm2DJsoleW2pxgcrEtKNN8XLuh+ay/dS/SGedKcJCuxEog= Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/powerpc/include/asm/rtc.h | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/include/asm/rtc.h b/arch/powerpc/include/asm/rtc.h index f5802926b6c0..c6659582bd1e 100644 --- a/arch/powerpc/include/asm/rtc.h +++ b/arch/powerpc/include/asm/rtc.h @@ -26,23 +26,14 @@ #ifdef __KERNEL__ -#include +#define get_rtc_time powerpc_get_rtc_time +#define set_rtc_time powerpc_set_rtc_time +#include #include #include -#define RTC_PIE 0x40 /* periodic interrupt enable */ -#define RTC_AIE 0x20 /* alarm interrupt enable */ -#define RTC_UIE 0x10 /* update-finished interrupt enable */ - -/* some dummy definitions */ -#define RTC_BATT_BAD 0x100 /* battery bad */ -#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 */ - -static inline unsigned int get_rtc_time(struct rtc_time *time) +static inline unsigned int powerpc_get_rtc_time(struct rtc_time *time) { if (ppc_md.get_rtc_time) ppc_md.get_rtc_time(time); @@ -50,29 +41,12 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) } /* Set the current date and time in the real time clock. */ -static inline int set_rtc_time(struct rtc_time *time) +static inline int powerpc_set_rtc_time(struct rtc_time *time) { if (ppc_md.set_rtc_time) return ppc_md.set_rtc_time(time); return -EINVAL; } -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_POWERPC_RTC_H__ */