aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/adp5588-gpio.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-01-12 20:00:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:13 -0500
commit12401eeddd21a59357c9a34c39761a7d32ddd4cd (patch)
tree4d2100859584377867256c04302e114979f9478d /drivers/gpio/adp5588-gpio.c
parentcf8e9086de5daf14dbf0be9efef7d2793f256693 (diff)
gpio: adp5588-gpio: irq_data conversion
Converts irq_chips and flow handlers over to the new struct irq_data based irq_chip functions. Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Acked-by: "Hennerich, Michael" <Michael.Hennerich@analog.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpio/adp5588-gpio.c')
-rw-r--r--drivers/gpio/adp5588-gpio.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/gpio/adp5588-gpio.c b/drivers/gpio/adp5588-gpio.c
index 0871f78af593..33fc685cb385 100644
--- a/drivers/gpio/adp5588-gpio.c
+++ b/drivers/gpio/adp5588-gpio.c
@@ -146,9 +146,10 @@ static int adp5588_gpio_to_irq(struct gpio_chip *chip, unsigned off)
146 return dev->irq_base + off; 146 return dev->irq_base + off;
147} 147}
148 148
149static void adp5588_irq_bus_lock(unsigned int irq) 149static void adp5588_irq_bus_lock(struct irq_data *d)
150{ 150{
151 struct adp5588_gpio *dev = get_irq_chip_data(irq); 151 struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
152
152 mutex_lock(&dev->irq_lock); 153 mutex_lock(&dev->irq_lock);
153} 154}
154 155
@@ -160,9 +161,9 @@ static void adp5588_irq_bus_lock(unsigned int irq)
160 * and unlocks the bus. 161 * and unlocks the bus.
161 */ 162 */
162 163
163static void adp5588_irq_bus_sync_unlock(unsigned int irq) 164static void adp5588_irq_bus_sync_unlock(struct irq_data *d)
164{ 165{
165 struct adp5588_gpio *dev = get_irq_chip_data(irq); 166 struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
166 int i; 167 int i;
167 168
168 for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) 169 for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++)
@@ -175,31 +176,31 @@ static void adp5588_irq_bus_sync_unlock(unsigned int irq)
175 mutex_unlock(&dev->irq_lock); 176 mutex_unlock(&dev->irq_lock);
176} 177}
177 178
178static void adp5588_irq_mask(unsigned int irq) 179static void adp5588_irq_mask(struct irq_data *d)
179{ 180{
180 struct adp5588_gpio *dev = get_irq_chip_data(irq); 181 struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
181 unsigned gpio = irq - dev->irq_base; 182 unsigned gpio = d->irq - dev->irq_base;
182 183
183 dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio); 184 dev->irq_mask[ADP5588_BANK(gpio)] &= ~ADP5588_BIT(gpio);
184} 185}
185 186
186static void adp5588_irq_unmask(unsigned int irq) 187static void adp5588_irq_unmask(struct irq_data *d)
187{ 188{
188 struct adp5588_gpio *dev = get_irq_chip_data(irq); 189 struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
189 unsigned gpio = irq - dev->irq_base; 190 unsigned gpio = d->irq - dev->irq_base;
190 191
191 dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio); 192 dev->irq_mask[ADP5588_BANK(gpio)] |= ADP5588_BIT(gpio);
192} 193}
193 194
194static int adp5588_irq_set_type(unsigned int irq, unsigned int type) 195static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)
195{ 196{
196 struct adp5588_gpio *dev = get_irq_chip_data(irq); 197 struct adp5588_gpio *dev = irq_data_get_irq_chip_data(d);
197 uint16_t gpio = irq - dev->irq_base; 198 uint16_t gpio = d->irq - dev->irq_base;
198 unsigned bank, bit; 199 unsigned bank, bit;
199 200
200 if ((type & IRQ_TYPE_EDGE_BOTH)) { 201 if ((type & IRQ_TYPE_EDGE_BOTH)) {
201 dev_err(&dev->client->dev, "irq %d: unsupported type %d\n", 202 dev_err(&dev->client->dev, "irq %d: unsupported type %d\n",
202 irq, type); 203 d->irq, type);
203 return -EINVAL; 204 return -EINVAL;
204 } 205 }
205 206
@@ -222,11 +223,11 @@ static int adp5588_irq_set_type(unsigned int irq, unsigned int type)
222 223
223static struct irq_chip adp5588_irq_chip = { 224static struct irq_chip adp5588_irq_chip = {
224 .name = "adp5588", 225 .name = "adp5588",
225 .mask = adp5588_irq_mask, 226 .irq_mask = adp5588_irq_mask,
226 .unmask = adp5588_irq_unmask, 227 .irq_unmask = adp5588_irq_unmask,
227 .bus_lock = adp5588_irq_bus_lock, 228 .irq_bus_lock = adp5588_irq_bus_lock,
228 .bus_sync_unlock = adp5588_irq_bus_sync_unlock, 229 .irq_bus_sync_unlock = adp5588_irq_bus_sync_unlock,
229 .set_type = adp5588_irq_set_type, 230 .irq_set_type = adp5588_irq_set_type,
230}; 231};
231 232
232static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf) 233static int adp5588_gpio_read_intstat(struct i2c_client *client, u8 *buf)