generic: ar8216: add support for the AR8327 chip
[openwrt.git] / target / linux / omap24xx / patches-3.1 / 252-cbus-retu-tahvo-ack-fix.patch
1 --- a/drivers/cbus/retu.c
2 +++ b/drivers/cbus/retu.c
3 @@ -53,9 +53,6 @@ struct retu {
4
5 int irq;
6
7 - int ack;
8 - bool ack_pending;
9 -
10 int mask;
11 bool mask_pending;
12
13 @@ -191,9 +188,10 @@ static irqreturn_t retu_irq_handler(int
14 mutex_lock(&retu->mutex);
15 idr = __retu_read_reg(retu, RETU_REG_IDR);
16 imr = __retu_read_reg(retu, RETU_REG_IMR);
17 + idr &= ~imr;
18 + __retu_write_reg(retu, RETU_REG_IDR, idr);
19 mutex_unlock(&retu->mutex);
20
21 - idr &= ~imr;
22 if (!idr) {
23 dev_vdbg(retu->dev, "No IRQ, spurious?\n");
24 return IRQ_NONE;
25 @@ -232,15 +230,6 @@ static void retu_irq_unmask(struct irq_d
26
27 }
28
29 -static void retu_irq_ack(struct irq_data *data)
30 -{
31 - struct retu *retu = irq_data_get_irq_chip_data(data);
32 - int irq = data->irq;
33 -
34 - retu->ack |= (1 << (irq - retu->irq_base));
35 - retu->ack_pending = true;
36 -}
37 -
38 static void retu_bus_lock(struct irq_data *data)
39 {
40 struct retu *retu = irq_data_get_irq_chip_data(data);
41 @@ -257,11 +246,6 @@ static void retu_bus_sync_unlock(struct
42 retu->mask_pending = false;
43 }
44
45 - if (retu->ack_pending) {
46 - __retu_write_reg(retu, RETU_REG_IDR, retu->ack);
47 - retu->ack_pending = false;
48 - }
49 -
50 mutex_unlock(&retu->mutex);
51 }
52
53 @@ -271,7 +255,6 @@ static struct irq_chip retu_irq_chip = {
54 .irq_bus_sync_unlock = retu_bus_sync_unlock,
55 .irq_mask = retu_irq_mask,
56 .irq_unmask = retu_irq_unmask,
57 - .irq_ack = retu_irq_ack,
58 };
59
60 static inline void retu_irq_setup(int irq)
61 @@ -291,8 +274,7 @@ static void retu_irq_init(struct retu *r
62
63 for (irq = base; irq < end; irq++) {
64 irq_set_chip_data(irq, retu);
65 - irq_set_chip_and_handler(irq, &retu_irq_chip,
66 - handle_simple_irq);
67 + irq_set_chip(irq, &retu_irq_chip);
68 irq_set_nested_thread(irq, 1);
69 retu_irq_setup(irq);
70 }
71 --- a/drivers/cbus/tahvo.c
72 +++ b/drivers/cbus/tahvo.c
73 @@ -48,11 +48,9 @@ struct tahvo {
74 int irq_end;
75 int irq;
76
77 - int ack;
78 int mask;
79
80 unsigned int mask_pending:1;
81 - unsigned int ack_pending:1;
82 unsigned int is_betty:1;
83 };
84
85 @@ -138,9 +136,12 @@ static irqreturn_t tahvo_irq_handler(int
86 u16 id;
87 u16 im;
88
89 + mutex_lock(&tahvo->mutex);
90 id = __tahvo_read_reg(tahvo, TAHVO_REG_IDR);
91 im = __tahvo_read_reg(tahvo, TAHVO_REG_IMR);
92 id &= ~im;
93 + __tahvo_write_reg(tahvo, TAHVO_REG_IDR, id);
94 + mutex_unlock(&tahvo->mutex);
95
96 if (!id) {
97 dev_vdbg(tahvo->dev, "No IRQ, spurious ?\n");
98 @@ -177,11 +178,6 @@ static void tahvo_irq_bus_sync_unlock(st
99 tahvo->mask_pending = false;
100 }
101
102 - if (tahvo->ack_pending) {
103 - __tahvo_write_reg(tahvo, TAHVO_REG_IDR, tahvo->ack);
104 - tahvo->ack_pending = false;
105 - }
106 -
107 mutex_unlock(&tahvo->mutex);
108 }
109
110 @@ -203,22 +199,12 @@ static void tahvo_irq_unmask(struct irq_
111 tahvo->mask_pending = true;
112 }
113
114 -static void tahvo_irq_ack(struct irq_data *data)
115 -{
116 - struct tahvo *tahvo = irq_data_get_irq_chip_data(data);
117 - int irq = data->irq;
118 -
119 - tahvo->ack |= (1 << (irq - tahvo->irq_base));
120 - tahvo->ack_pending = true;
121 -}
122 -
123 static struct irq_chip tahvo_irq_chip = {
124 .name = "tahvo",
125 .irq_bus_lock = tahvo_irq_bus_lock,
126 .irq_bus_sync_unlock = tahvo_irq_bus_sync_unlock,
127 .irq_mask = tahvo_irq_mask,
128 .irq_unmask = tahvo_irq_unmask,
129 - .irq_ack = tahvo_irq_ack,
130 };
131
132 static inline void tahvo_irq_setup(int irq)
133 @@ -238,8 +224,7 @@ static void tahvo_irq_init(struct tahvo
134
135 for (irq = base; irq < end; irq++) {
136 irq_set_chip_data(irq, tahvo);
137 - irq_set_chip_and_handler(irq, &tahvo_irq_chip,
138 - handle_simple_irq);
139 + irq_set_chip(irq, &tahvo_irq_chip);
140 irq_set_nested_thread(irq, 1);
141 tahvo_irq_setup(irq);
142 }
This page took 0.04971 seconds and 5 git commands to generate.