18 #include <linux/types.h>
38 #define TXx9_IRCER_ICE 0x00000001
41 #define TXx9_IRCR_LOW 0x00000000
42 #define TXx9_IRCR_HIGH 0x00000001
43 #define TXx9_IRCR_DOWN 0x00000002
44 #define TXx9_IRCR_UP 0x00000003
45 #define TXx9_IRCR_EDGE(cr) ((cr) & 0x00000002)
48 #define TXx9_IRSCR_EIClrE 0x00000100
49 #define TXx9_IRSCR_EIClr_MASK 0x0000000f
52 #define TXx9_IRCSR_IF 0x00010000
53 #define TXx9_IRCSR_ILV_MASK 0x00000700
54 #define TXx9_IRCSR_IVL_MASK 0x0000001f
66 static void txx9_irq_unmask(
struct irq_data *
d)
69 u32 __iomem *ilrp = &txx9_ircptr->ilr[(irq_nr % 16 ) / 2];
70 int ofs = irq_nr / 16 * 16 + (irq_nr & 1) * 8;
73 | (txx9irq[irq_nr].
level << ofs),
75 #ifdef CONFIG_CPU_TX39XX
82 static inline void txx9_irq_mask(
struct irq_data *
d)
85 u32 __iomem *ilrp = &txx9_ircptr->ilr[(irq_nr % 16) / 2];
86 int ofs = irq_nr / 16 * 16 + (irq_nr & 1) * 8;
91 #ifdef CONFIG_CPU_TX39XX
102 static void txx9_irq_mask_ack(
struct irq_data *d)
112 static int txx9_irq_set_type(
struct irq_data *d,
unsigned int flow_type)
130 crp = &txx9_ircptr->cr[(
unsigned int)irq_nr / 8];
132 ofs = (irq_nr & (8 - 1)) * 2;
134 cr |= (mode & 0x3) << ofs;
136 txx9irq[irq_nr].mode =
mode;
140 static struct irq_chip txx9_irq_chip = {
142 .irq_ack = txx9_irq_mask_ack,
143 .irq_mask = txx9_irq_mask,
144 .irq_mask_ack = txx9_irq_mask_ack,
145 .irq_unmask = txx9_irq_unmask,
146 .irq_set_type = txx9_irq_set_type,
155 txx9irq[
i].level = 4;
163 for (i = 0; i < 8; i++)
166 for (i = 0; i < 2; i++)
179 old_pri = txx9irq[irc_irq].level;
180 txx9irq[irc_irq].level = new_pri;