Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336369
b: refs/heads/master
c: c18486e
h: refs/heads/master
i:
  336367: ca37a41
v: v3
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD committed Oct 13, 2012
1 parent d97279b commit 1e6abff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d39e0fd080fbc2287bca3f596741a38281634da
refs/heads/master: c18486e10d5801b832b34708f6d2bd266c704793
12 changes: 12 additions & 0 deletions trunk/arch/arm/mach-at91/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct at91_gpio_chip {

#define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip)

static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset);
static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip);
static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val);
static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset);
Expand All @@ -59,6 +60,7 @@ static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset);
{ \
.chip = { \
.label = name, \
.request = at91_gpiolib_request, \
.direction_input = at91_gpiolib_direction_input, \
.direction_output = at91_gpiolib_direction_output, \
.get = at91_gpiolib_get, \
Expand Down Expand Up @@ -862,6 +864,16 @@ void __init at91_gpio_irq_setup(void)
}

/* gpiolib support */
static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset)
{
struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
void __iomem *pio = at91_gpio->regbase;
unsigned mask = 1 << offset;

__raw_writel(mask, pio + PIO_PER);
return 0;
}

static int at91_gpiolib_direction_input(struct gpio_chip *chip,
unsigned offset)
{
Expand Down

0 comments on commit 1e6abff

Please sign in to comment.