Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362964
b: refs/heads/master
c: 39b70ee
h: refs/heads/master
v: v3
  • Loading branch information
Haojian Zhuang authored and Linus Walleij committed Mar 7, 2013
1 parent b6e9b51 commit ae666a7
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 51e13c2475913d45a3ec546dee647538a9341d6a
refs/heads/master: 39b70ee05199f9bea50641df104aee4dbd913d1d
13 changes: 13 additions & 0 deletions trunk/drivers/gpio/gpio-pl061.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/amba/bus.h>
#include <linux/amba/pl061.h>
#include <linux/slab.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm.h>
#include <asm/mach/irq.h>

Expand Down Expand Up @@ -60,6 +61,17 @@ struct pl061_gpio {
#endif
};

static int pl061_gpio_request(struct gpio_chip *chip, unsigned offset)
{
/*
* Map back to global GPIO space and request muxing, the direction
* parameter does not matter for this controller.
*/
int gpio = chip->base + offset;

return pinctrl_request_gpio(gpio);
}

static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
{
struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
Expand Down Expand Up @@ -274,6 +286,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)

spin_lock_init(&chip->lock);

chip->gc.request = pl061_gpio_request;
chip->gc.direction_input = pl061_direction_input;
chip->gc.direction_output = pl061_direction_output;
chip->gc.get = pl061_get_value;
Expand Down

0 comments on commit ae666a7

Please sign in to comment.