Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296194
b: refs/heads/master
c: b134ce8
h: refs/heads/master
v: v3
  • Loading branch information
Nicolas Ferre committed Mar 1, 2012
1 parent dd97aa3 commit 2b89823
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5bc067b71928d3f470d051847aefa55724fd0c95
refs/heads/master: b134ce854ad63421bd5c7d34623a1337d525a435
13 changes: 13 additions & 0 deletions trunk/arch/arm/mach-at91/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/clk.h>
#include <linux/errno.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
Expand Down Expand Up @@ -48,6 +49,7 @@ static int at91_gpiolib_direction_output(struct gpio_chip *chip,
unsigned offset, int val);
static int at91_gpiolib_direction_input(struct gpio_chip *chip,
unsigned offset);
static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset);

#define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \
{ \
Expand All @@ -59,6 +61,7 @@ static int at91_gpiolib_direction_input(struct gpio_chip *chip,
.set = at91_gpiolib_set, \
.dbg_show = at91_gpiolib_dbg_show, \
.base = base_gpio, \
.to_irq = at91_gpiolib_to_irq, \
.ngpio = nr_gpio, \
}, \
}
Expand Down Expand Up @@ -640,6 +643,16 @@ static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
}
}

static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset)
{
struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
int virq = irq_find_mapping(at91_gpio->domain, offset);

dev_dbg(chip->dev, "%s: request IRQ for GPIO %d, return %d\n",
chip->label, offset + chip->base, virq);
return virq;
}

static int __init at91_gpio_setup_clk(int idx)
{
struct at91_gpio_chip *at91_gpio = &gpio_chip[idx];
Expand Down
12 changes: 0 additions & 12 deletions trunk/arch/arm/mach-at91/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ extern int at91_get_gpio_value(unsigned pin);
extern void at91_gpio_suspend(void);
extern void at91_gpio_resume(void);

/*-------------------------------------------------------------------------*/

/* wrappers for "new style" GPIO calls. the old AT91-specific ones should
* eventually be removed (along with this errno.h inclusion), and the
* gpio request/free calls should probably be implemented.
*/

#include <asm/errno.h>

#define gpio_to_irq(gpio) (gpio + NR_AIC_IRQS)
#define irq_to_gpio(irq) (irq - NR_AIC_IRQS)

#endif /* __ASSEMBLY__ */

#endif

0 comments on commit 2b89823

Please sign in to comment.