2 * @file me1400_ext_irq.h
4 * @brief ME-1400 external interrupt implementation.
5 * @note Copyright (C) 2006 Meilhaus Electronic GmbH (support@meilhaus.de)
6 * @author Guenter Gebhardt
9 #ifndef _ME1400_EXT_IRQ_H_
10 #define _ME1400_EXT_IRQ_H_
12 #include <linux/sched.h>
14 #include "mesubdevice.h"
20 * @brief The ME-1400 external interrupt subdevice class.
22 typedef struct me1400_ext_irq_subdevice
{
24 me_subdevice_t base
; /**< The subdevice base class. */
27 spinlock_t subdevice_lock
; /**< Spin lock to protect the subdevice from concurrent access. */
28 spinlock_t
*clk_src_reg_lock
; /**< Lock protecting the clock control register. */
30 wait_queue_head_t wait_queue
; /**< Queue to put on threads waiting for an interrupt. */
32 uint32_t device_id
; /**< The device id of the device holding the subdevice. */
33 int irq
; /**< The irq number assigned by PCI BIOS. */
34 int rised
; /**< If true an interrupt has occured. */
35 unsigned int n
; /**< The number of interrupt since the driver was loaded. */
37 unsigned long plx_intcs_reg
; /**< The PLX interrupt control and status register. */
38 unsigned long ctrl_reg
; /**< The control register. */
39 #ifdef MEDEBUG_DEBUG_REG
40 unsigned long reg_base
;
42 } me1400_ext_irq_subdevice_t
;
45 * @brief The constructor to generate a ME-1400 external interrupt instance.
47 * @param plx_reg_base The register base address of the PLX chip as returned by the PCI BIOS.
48 * @param me1400_reg_base The register base address of the ME-1400 device as returned by the PCI BIOS.
49 * @param irq The irq assigned by the PCI BIOS.
51 * @return Pointer to new instance on success.\n
54 me1400_ext_irq_subdevice_t
*me1400_ext_irq_constructor(uint32_t device_id
,
55 uint32_t plx_reg_base
,
56 uint32_t me1400_reg_base
,