2 * Intel Merrifield legacy RTC initialization file
4 * (C) Copyright 2017 Intel Corporation
6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; version 2
14 #include <linux/init.h>
16 #include <asm/hw_irq.h>
17 #include <asm/intel-mid.h>
18 #include <asm/io_apic.h>
20 #include <asm/x86_init.h>
22 static int __init mrfld_legacy_rtc_alloc_irq(void)
24 struct irq_alloc_info info;
27 if (!x86_platform.legacy.rtc)
30 ioapic_set_alloc_attr(&info, NUMA_NO_NODE, 1, 0);
31 ret = mp_map_gsi_to_irq(RTC_IRQ, IOAPIC_MAP_ALLOC, &info);
33 pr_info("Failed to allocate RTC interrupt. Disabling RTC\n");
34 x86_platform.legacy.rtc = 0;
41 static int __init mrfld_legacy_rtc_init(void)
43 if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
46 return mrfld_legacy_rtc_alloc_irq();
48 arch_initcall(mrfld_legacy_rtc_init);