Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson64: Remove dead RTC code

RTC is now enabled by devicetree. So platform code is
no longer needed.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Jiaxun Yang and committed by
Thomas Bogendoerfer
a746f50d 7a6659a5

+1 -87
-36
arch/mips/include/asm/mach-loongson64/mc146818rtc.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 1998, 2001, 03, 07 by Ralf Baechle (ralf@linux-mips.org) 7 - * 8 - * RTC routines for PC style attached Dallas chip. 9 - */ 10 - #ifndef __ASM_MACH_LOONGSON64_MC146818RTC_H 11 - #define __ASM_MACH_LOONGSON64_MC146818RTC_H 12 - 13 - #include <linux/io.h> 14 - 15 - #define RTC_PORT(x) (0x70 + (x)) 16 - #define RTC_IRQ 8 17 - 18 - static inline unsigned char CMOS_READ(unsigned long addr) 19 - { 20 - outb_p(addr, RTC_PORT(0)); 21 - return inb_p(RTC_PORT(1)); 22 - } 23 - 24 - static inline void CMOS_WRITE(unsigned char data, unsigned long addr) 25 - { 26 - outb_p(addr, RTC_PORT(0)); 27 - outb_p(data, RTC_PORT(1)); 28 - } 29 - 30 - #define RTC_ALWAYS_BCD 0 31 - 32 - #ifndef mc146818_decode_year 33 - #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) 34 - #endif 35 - 36 - #endif /* __ASM_MACH_LOONGSON64_MC146818RTC_H */
-4
arch/mips/loongson64/Kconfig
··· 14 14 If unsure, say Yes. 15 15 16 16 17 - config LOONGSON_MC146818 18 - bool 19 - default n 20 - 21 17 endif # MACH_LOONGSON64
-1
arch/mips/loongson64/Makefile
··· 9 9 obj-$(CONFIG_NUMA) += numa.o 10 10 obj-$(CONFIG_RS780_HPET) += hpet.o 11 11 obj-$(CONFIG_PCI) += pci.o 12 - obj-$(CONFIG_LOONGSON_MC146818) += rtc.o 13 12 obj-$(CONFIG_SUSPEND) += pm.o
-39
arch/mips/loongson64/rtc.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Lemote Fuloong platform support 4 - * 5 - * Copyright(c) 2010 Arnaud Patard <apatard@mandriva.com> 6 - */ 7 - 8 - #include <linux/init.h> 9 - #include <linux/kernel.h> 10 - #include <linux/platform_device.h> 11 - #include <linux/mc146818rtc.h> 12 - 13 - static struct resource loongson_rtc_resources[] = { 14 - { 15 - .start = RTC_PORT(0), 16 - .end = RTC_PORT(1), 17 - .flags = IORESOURCE_IO, 18 - }, { 19 - .start = RTC_IRQ, 20 - .end = RTC_IRQ, 21 - .flags = IORESOURCE_IRQ, 22 - } 23 - }; 24 - 25 - static struct platform_device loongson_rtc_device = { 26 - .name = "rtc_cmos", 27 - .id = -1, 28 - .resource = loongson_rtc_resources, 29 - .num_resources = ARRAY_SIZE(loongson_rtc_resources), 30 - }; 31 - 32 - 33 - static int __init loongson_rtc_platform_init(void) 34 - { 35 - platform_device_register(&loongson_rtc_device); 36 - return 0; 37 - } 38 - 39 - device_initcall(loongson_rtc_platform_init);
+1 -7
arch/mips/loongson64/time.c
··· 6 6 * Copyright (C) 2009 Lemote Inc. 7 7 * Author: Wu Zhangjin, wuzhangjin@gmail.com 8 8 */ 9 - #include <asm/mc146818-time.h> 9 + 10 10 #include <asm/time.h> 11 11 #include <asm/hpet.h> 12 12 ··· 20 20 #ifdef CONFIG_RS780_HPET 21 21 setup_hpet_timer(); 22 22 #endif 23 - } 24 - 25 - void read_persistent_clock64(struct timespec64 *ts) 26 - { 27 - ts->tv_sec = mc146818_get_cmos_time(); 28 - ts->tv_nsec = 0; 29 23 }