diff options
author | Andrew Boie <andrew.p.boie@intel.com> | 2016-01-08 00:46:14 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2016-02-05 20:25:17 -0500 |
commit | d9cfbd5a6102cd0be5869b9f98a5a067b7a60e14 (patch) | |
tree | acc1ebea5edc7f321cd5edc5c2ec178a1aa479d1 /drivers/rtc | |
parent | 4a2ce3c0c94b44ea2ccf5d6a76caf28025320f57 (diff) |
interrupts: new static IRQ API
The interrupt API has been redesigned:
- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
It will be used in situations where the new static irq_connect()
won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
exactly the same way as its dynamic counterpart. The old static irq
macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
generated inline with irq_connect()
ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.
Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/Makefile | 1 | ||||
-rw-r--r-- | drivers/rtc/rtc_dw.c | 34 | ||||
-rw-r--r-- | drivers/rtc/rtc_qmsi.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc_static_irq_stubs.S | 38 |
4 files changed, 18 insertions, 61 deletions
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 35115e65f..e1aa56b40 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -1,5 +1,4 @@ ccflags-$(CONFIG_RTC_QMSI) += -I$(CONFIG_QMSI_INSTALL_PATH)/include -obj-$(CONFIG_RTC) += rtc_static_irq_stubs.o obj-$(CONFIG_RTC_DW) += rtc_dw.o obj-$(CONFIG_RTC_QMSI) += rtc_qmsi.o diff --git a/drivers/rtc/rtc_dw.c b/drivers/rtc/rtc_dw.c index e10613716..4de8d21b7 100644 --- a/drivers/rtc/rtc_dw.c +++ b/drivers/rtc/rtc_dw.c @@ -189,23 +189,7 @@ static struct rtc_driver_api funcs = { .set_alarm = rtc_dw_set_alarm, }; -/* IRQ_CONFIG needs the flags variable declared by IRQ_CONNECT_STATIC */ -IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ, - CONFIG_RTC_IRQ_PRI, rtc_dw_isr, 0, 0); - -int rtc_dw_init(struct device *dev) -{ - IRQ_CONFIG(rtc, CONFIG_RTC_IRQ); - irq_enable(CONFIG_RTC_IRQ); - - _rtc_dw_int_unmask(); - - _rtc_dw_clock_config(dev); - - dev->driver_api = &funcs; - - return DEV_OK; -} +int rtc_dw_init(struct device *dev); struct rtc_dw_runtime rtc_runtime; @@ -222,4 +206,18 @@ DECLARE_DEVICE_INIT_CONFIG(rtc, CONFIG_RTC_DRV_NAME, SYS_DEFINE_DEVICE(rtc, &rtc_runtime, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); -struct device *rtc_dw_isr_dev = SYS_GET_DEVICE(rtc); +int rtc_dw_init(struct device *dev) +{ + irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, rtc_dw_isr, + SYS_GET_DEVICE(rtc), 0); + irq_enable(CONFIG_RTC_IRQ); + + _rtc_dw_int_unmask(); + + _rtc_dw_clock_config(dev); + + dev->driver_api = &funcs; + + return DEV_OK; +} + diff --git a/drivers/rtc/rtc_qmsi.c b/drivers/rtc/rtc_qmsi.c index d319a54e7..6b5d0dbb6 100644 --- a/drivers/rtc/rtc_qmsi.c +++ b/drivers/rtc/rtc_qmsi.c @@ -22,9 +22,6 @@ #include "qm_rtc.h" -IRQ_CONNECT_STATIC(rtc, CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0, - 0, IOAPIC_EDGE | IOAPIC_HIGH); - static struct device *rtc_qmsi_dev; static void (*user_callback)(struct device *dev); @@ -82,7 +79,8 @@ static struct rtc_driver_api api = { static int rtc_qmsi_init(struct device *dev) { - IRQ_CONFIG(rtc, CONFIG_RTC_IRQ); + irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, qm_rtc_isr_0, 0, + IOAPIC_EDGE | IOAPIC_HIGH); /* Unmask RTC interrupt */ irq_enable(CONFIG_RTC_IRQ); diff --git a/drivers/rtc/rtc_static_irq_stubs.S b/drivers/rtc/rtc_static_irq_stubs.S deleted file mode 100644 index 516912d11..000000000 --- a/drivers/rtc/rtc_static_irq_stubs.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2015, Intel Corportation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#define _ASMLANGUAGE - -#include <arch/x86/asm.h> -#include <drivers/ioapic.h> - -#if defined(CONFIG_RTC_DW) -#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC) - ioapic_mkstub rtc rtc_dw_isr rtc_dw_isr_dev -#endif -#endif - -#if defined(CONFIG_RTC_QMSI) -#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC) - ioapic_mkstub rtc qm_rtc_isr_0 0 -#endif -#endif /* CONFIG_RTC_QMSI */ - -/* externs (internal APIs) */ - -GTEXT(_IntEnt) -GTEXT(_IntExit) |