From patchwork Wed Apr 27 22:34:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 615893 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qwFJX6v2Dz9sCY for ; Thu, 28 Apr 2016 08:39:40 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qwFJX5y6LzDqgP for ; Thu, 28 Apr 2016 08:39:40 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qwFD22BgGzDqB4 for ; Thu, 28 Apr 2016 08:35:45 +1000 (AEST) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0M4rAD-1btwjG25vB-00yz9Z; Thu, 28 Apr 2016 00:34:51 +0200 From: Arnd Bergmann To: Alexandre Belloni Subject: [PATCH v3 08/16] char/genrtc: remove parisc support Date: Thu, 28 Apr 2016 00:34:22 +0200 Message-Id: <1461796470-1291527-9-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:hDlGA05dpdNMTEDjZR01lDPZsqpJtKQ5Fyet8yo2+a4sHfJ6dsd Cgn0o4JuI5z3elDVFaofzGczl2tOhUc5iNk61m/ah/K3utrf6kT9qrdiik5xjzDTONK8smR oG2dl6F7oeHqcNKWf2QQp/PrgYfPsX4+kuiGpOLd34zw97dPnEGZI86+I80J2HA+w5IgXmi K6mMdDLRfhids66T07Thw== X-UI-Out-Filterresults: notjunk:1; V01:K0:gDZghHuRU6A=:EiUrb1TMgWRtZdmOa5h+uD oi08FH2EvZ2qsrrsc6CZbEzHqZmP6d6Euq6hHwbKsBTmKPsXywU49B/0Wv4gwVRbS9EKJ9QuJ kQi6woqB4tukr8XPHNqGzCAAoeZ/M4eVDUKJcST4c5qEn7ePsD1jS/FSo2txE2gx9wq0nEerK jYzH/KZit8RahVIZ7mmacPTiVP3mI/E+xs9whvSjR7SzQy+9vrNT8EyRACAKhltfrQK7z98sf hWg3F/nRIt3qSfPJMMk7aR2+8S20S2BN90vZGdNKdYaGEsJN4zrc3ld0uE3OHweTQKbp1Usgl LbMTbMPM6jctXnMIxC92B954+RE6FZhEC/izWPv0YqHUUVIAaXf4XGvOrphef9qztn42E5FN0 xwP3Nd1bAFhRmnqTr0zwJgp+Iq8p3BX7qLqOA+W/lbHMnTqOH+b7oSTWqT7tJQ7r+44XbaG2t JQmkbLOAV1gsUhmDLyfDKis8P2cCyqZgW1etWXqa4C3oZlTm4Ak0E837SNLFjxg+57+ZmMU8H 8z5UcYVzGILhRC/eb+NwSmp0MqXoPuV1r8TmTuXGs36al6dOTOt6GjIEUGm3hgN3mN5dO6oxv c7CcD0zEdxh++OpjsvUQHfmNhUZxPOEJdys022j4cLf5yh+I2a5EngL6+26rZO233dHdkdpwA UAb7sXmDGNoJMsgGNSw8uL73n/I+7bg9GDkg58F6HDdYDhcB+iVsI8nwmeq7JPQC0LOk= X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, a.zummo@towertech.it, dalias@libc.org, linux-parisc@vger.kernel.org, Arnd Bergmann , linux-sh@vger.kernel.org, deller@gmx.de, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-m68k@lists.linux-m68k.org, geert@linux-m68k.org, rtc-linux@googlegroups.com, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This architecture selects RTC_CLASS unconditionally, so the GEN_RTC has not worked here for a long time. Now we can remove both the asm/rtc.h header and the Kconfig dependency for CONFIG_GEN_RTC. Signed-off-by: Arnd Bergmann --- arch/parisc/include/asm/rtc.h | 131 ------------------------------------------ drivers/char/Kconfig | 2 +- 2 files changed, 1 insertion(+), 132 deletions(-) delete mode 100644 arch/parisc/include/asm/rtc.h diff --git a/arch/parisc/include/asm/rtc.h b/arch/parisc/include/asm/rtc.h deleted file mode 100644 index 099d641a42c2..000000000000 --- a/arch/parisc/include/asm/rtc.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * include/asm-parisc/rtc.h - * - * Copyright 2002 Randolph CHung - * - * Based on: include/asm-ppc/rtc.h and the genrtc driver in the - * 2.4 parisc linux tree - */ - -#ifndef __ASM_RTC_H__ -#define __ASM_RTC_H__ - -#ifdef __KERNEL__ - -#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)) - -/* How many days come before each month (0-12). */ -static const unsigned short int __mon_yday[2][13] = -{ - /* Normal years. */ - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, - /* Leap years. */ - { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } -}; - -static inline unsigned int get_rtc_time(struct rtc_time *wtime) -{ - struct pdc_tod tod_data; - long int days, rem, y; - const unsigned short int *ip; - - memset(wtime, 0, sizeof(*wtime)); - if (pdc_tod_read(&tod_data) < 0) - return RTC_24H | RTC_BATT_BAD; - - // most of the remainder of this function is: -// Copyright (C) 1991, 1993, 1997, 1998 Free Software Foundation, Inc. -// This was originally a part of the GNU C Library. -// It is distributed under the GPL, and was swiped from offtime.c - - - days = tod_data.tod_sec / SECS_PER_DAY; - rem = tod_data.tod_sec % SECS_PER_DAY; - - wtime->tm_hour = rem / SECS_PER_HOUR; - rem %= SECS_PER_HOUR; - wtime->tm_min = rem / 60; - wtime->tm_sec = rem % 60; - - y = 1970; - -#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0)) -#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400)) - - while (days < 0 || days >= (__isleap (y) ? 366 : 365)) - { - /* Guess a corrected year, assuming 365 days per year. */ - long int yg = y + days / 365 - (days % 365 < 0); - - /* Adjust DAYS and Y to match the guessed year. */ - days -= ((yg - y) * 365 - + LEAPS_THRU_END_OF (yg - 1) - - LEAPS_THRU_END_OF (y - 1)); - y = yg; - } - wtime->tm_year = y - 1900; - - ip = __mon_yday[__isleap(y)]; - for (y = 11; days < (long int) ip[y]; --y) - continue; - days -= ip[y]; - wtime->tm_mon = y; - wtime->tm_mday = days + 1; - - return RTC_24H; -} - -static int set_rtc_time(struct rtc_time *wtime) -{ - u_int32_t secs; - - secs = mktime(wtime->tm_year + 1900, wtime->tm_mon + 1, wtime->tm_mday, - wtime->tm_hour, wtime->tm_min, wtime->tm_sec); - - if(pdc_tod_set(secs, 0) < 0) - return -1; - else - return 0; - -} - -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__ */ diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index d17ed90ebc82..abab6e565c60 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -328,7 +328,7 @@ config JS_RTC config GEN_RTC tristate "Generic /dev/rtc emulation" depends on RTC!=y - depends on M68K || PARISC || PPC + depends on M68K || PPC ---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