From patchwork Wed Apr 27 22:34:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8963671 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6A0DBF29F for ; Wed, 27 Apr 2016 22:41:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A6D0201F5 for ; Wed, 27 Apr 2016 22:41:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 759552022A for ; Wed, 27 Apr 2016 22:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753996AbcD0Wky (ORCPT ); Wed, 27 Apr 2016 18:40:54 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56811 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753788AbcD0Wkr (ORCPT ); Wed, 27 Apr 2016 18:40:47 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M1GfI-1bok3q13eK-00tEWm; Thu, 28 Apr 2016 00:34:54 +0200 From: Arnd Bergmann To: Alexandre Belloni Cc: Arnd Bergmann , geert@linux-m68k.org, deller@gmx.de, benh@kernel.crashing.org, mpe@ellerman.id.au, dalias@libc.org, dhowells@redhat.com, linux-alpha@vger.kernel.org, a.zummo@towertech.it, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, linux-m68k@lists.linux-m68k.org, rtc-linux@googlegroups.com, linux-arch@vger.kernel.org Subject: [PATCH v3 13/16] char/genrtc: remove powerpc support Date: Thu, 28 Apr 2016 00:34:27 +0200 Message-Id: <1461796470-1291527-14-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1461796470-1291527-1-git-send-email-arnd@arndb.de> References: <1461796470-1291527-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:YQ3v41WlZtCeAq48sh2EFTEdNw1MGsniNLoGu5hW5enKqULxD8P iDlYBvhJDuO6rGbWV62plNhxH8pvU5kLGDtE4ZZxXgLnD7+sv9O4B0DW8ZLD4rAXFzGet8P wOk1MIhHeiSeuhkcw6JcUMdls5piF50R2hO7mO0+xvN8Tmr8NYM7uSZrGYsu8t9sz21cRrG uYFWTBMG3D7e5uXCFcgcA== X-UI-Out-Filterresults: notjunk:1; V01:K0:LwmzO8iYIGE=:gwsQE21N5pENYjwOFh8Mzv Lzh/cFCHVkuC0k4Dasj31ZLxzZ+Pyl3sckxOWDItj4VSVMUirV1Wj+RLcT2SQCxTx3jHuK06T 6BXplcqy86r2TeV+BaDtVYxBvRDBrjc2w1jAbURoOOeM2XFHuEHXalPxszZtBDCBjg7wahjSr NExB7ZW+UTasBGNWPiC/fvYEV3VVlGJFgavWUh8bTCjwIpwVqRikxGFcmGHtX4zgiRsarpOE4 93mwydei1VyxA8bJOwjNagt7gGFjiWOgSIYNQgAPDUOJ6m+QiRraZMkG0vqUhTJceqNX43wz0 ooh+hezyIGsVoo0dF56oymO4KWKsK5U1CFHftjGSksNlcEashvSJEn8aoqROPl0jJnGem31jz sONCh3Esw+6cIa/LpVOn24Lg1V8TAKi1PnzIRBhRHwKtOACtjKn9C5B5XTdNG3EG/civMWkPA bWpG8rUWJ2ESo+X2Nz/7l2soRGEf59Y0geBmCxJ/DvH3zEbNJW2KVIwebfY2/hdL5/CTEtacz Axa/piYGpENCLoq0c5ujiLm84QGQ9sHzkcMtLkw6s/KIzCRqSW69wzBqe7yOnUDVRVZBGWMoE bppVn+mYe/8yaCvkDuR07gp+k0LA4BfmOrMSL7MCJFBUH1uJIYqtLK+M//a71ZJhC/5pko4/6 ESKMadhI7UVJ1dn8TQu41aYorxVpM8v5FjRwev1v8GaC2xROshraaY1mgn+31vEUxYSc= Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, TVD_SUBJ_WIPE_DEBT, 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 PowerPC is the last architecture using the GEN_RTC driver on some machines, but we can migrate them all to using the RTC_DRV_GENERIC driver instead now. This moves over the CONFIG_GEN_RTC option from drivers/char into arch/powerpc/platforms/Kconfig and makes it just select the replacement driver instead, for the only reason of not breaking existing defconfig and .config files that users may have. Signed-off-by: Arnd Bergmann --- arch/powerpc/include/asm/rtc.h | 78 --------------------------------------- arch/powerpc/platforms/Kconfig | 11 ++++++ arch/powerpc/platforms/ps3/time.c | 2 +- drivers/char/Kconfig | 4 +- drivers/char/Makefile | 2 +- 5 files changed, 15 insertions(+), 82 deletions(-) delete mode 100644 arch/powerpc/include/asm/rtc.h diff --git a/arch/powerpc/include/asm/rtc.h b/arch/powerpc/include/asm/rtc.h deleted file mode 100644 index f5802926b6c0..000000000000 --- a/arch/powerpc/include/asm/rtc.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Real-time clock definitions and interfaces - * - * Author: Tom Rini - * - * 2002 (c) MontaVista, Software, Inc. This file is licensed under - * the terms of the GNU General Public License version 2. This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. - * - * Based on: - * include/asm-m68k/rtc.h - * - * Copyright Richard Zidlicky - * implementation details for genrtc/q40rtc driver - * - * And the old drivers/macintosh/rtc.c which was heavily based on: - * Linux/SPARC Real Time Clock Driver - * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) - * - * With additional work by Paul Mackerras and Franz Sirl. - */ - -#ifndef __ASM_POWERPC_RTC_H__ -#define __ASM_POWERPC_RTC_H__ - -#ifdef __KERNEL__ - -#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) -{ - if (ppc_md.get_rtc_time) - ppc_md.get_rtc_time(time); - return RTC_24H; -} - -/* Set the current date and time in the real time clock. */ -static inline int 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__ */ diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 46a3533d3acb..657243ffb525 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -321,6 +321,17 @@ config OF_RTC Uses information from the OF or flattened device tree to instantiate platform devices for direct mapped RTC chips like the DS1742 or DS1743. +config GEN_RTC + bool "Use the platform RTC operations from user space" + select RTC_CLASS + select RTC_DRV_GENERIC + help + This option provides backwards compatibility with the old gen_rtc.ko + module that was traditionally used for old PowerPC machines. + Platforms should migrate to enabling the RTC_DRV_GENERIC by hand + replacing changing their get_rtc_time/set_rtc_time callbacks with + a proper RTC device driver. + config SIMPLE_GPIO bool "Support for simple, memory-mapped GPIO controllers" depends on PPC diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c index 791c6142c4a7..11b45b58c81b 100644 --- a/arch/powerpc/platforms/ps3/time.c +++ b/arch/powerpc/platforms/ps3/time.c @@ -20,9 +20,9 @@ #include #include +#include #include -#include #include #include diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 26089feae9b0..a81f0eb9f71e 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -325,10 +325,10 @@ config JS_RTC To compile this driver as a module, choose M here: the module will be called js-rtc. -config GEN_RTC +config OLD_GEN_RTC tristate "Generic /dev/rtc emulation" depends on RTC!=y - depends on PPC + depends on BROKEN ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you diff --git a/drivers/char/Makefile b/drivers/char/Makefile index d8a7579300d2..fc0905aa7373 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -25,7 +25,7 @@ obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_HPET) += hpet.o -obj-$(CONFIG_GEN_RTC) += genrtc.o +obj-$(CONFIG_OLD_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_DS1302) += ds1302.o obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap/