added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / drivers / staging / meilhaus / me1400_ext_irq.h
blob9b72a04701c0b202c6b8c09c3a39ed246eed63f9
1 /**
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
7 */
9 #ifndef _ME1400_EXT_IRQ_H_
10 #define _ME1400_EXT_IRQ_H_
12 #include <linux/sched.h>
14 #include "mesubdevice.h"
15 #include "meslock.h"
17 #ifdef __KERNEL__
19 /**
20 * @brief The ME-1400 external interrupt subdevice class.
22 typedef struct me1400_ext_irq_subdevice {
23 /* Inheritance */
24 me_subdevice_t base; /**< The subdevice base class. */
26 /* Attributes */
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;
41 #endif
42 } me1400_ext_irq_subdevice_t;
44 /**
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
52 * NULL on error.
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,
57 spinlock_t *
58 clk_src_reg_lock,
59 int irq);
61 #endif
62 #endif