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: 102416 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2446420qge; Wed, 27 Apr 2016 15:41:13 -0700 (PDT) X-Received: by 10.98.86.24 with SMTP id k24mr15627594pfb.87.1461796873048; Wed, 27 Apr 2016 15:41:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si7578507paw.114.2016.04.27.15.41.12; Wed, 27 Apr 2016 15:41:13 -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 S1754039AbcD0Wk5 (ORCPT + 29 others); Wed, 27 Apr 2016 18:40:57 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.7.0 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/