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: 102447 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1848876qge; Tue, 26 Apr 2016 14:47:33 -0700 (PDT) X-Received: by 10.66.159.232 with SMTP id xf8mr6893108pab.71.1461707253304; Tue, 26 Apr 2016 14:47:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si6280080pfd.242.2016.04.26.14.47.33; Tue, 26 Apr 2016 14:47:33 -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 S1753432AbcDZVrb (ORCPT + 29 others); Tue, 26 Apr 2016 17:47:31 -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-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/powerpc/include/asm/rtc.h | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) -- 2.7.0 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__ */