Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350531
b: refs/heads/master
c: a0d7209
h: refs/heads/master
i:
  350529: 01fbf9e
  350527: 233c067
v: v3
  • Loading branch information
Maxime Ripard authored and Linus Walleij committed Feb 5, 2013
1 parent 738c61e commit ca11ffa
Show file tree
Hide file tree
Showing 2 changed files with 21 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: 581981be24f9866b37af535f947da2e7b65aaa53
refs/heads/master: a0d72094f0abad3cbeeed618d24fd0ce1968d1a8
20 changes: 20 additions & 0 deletions trunk/drivers/pinctrl/pinctrl-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,24 @@ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
writel((value & DATA_PINS_MASK) << index, pctl->membase + reg);
}

static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
const struct of_phandle_args *gpiospec,
u32 *flags)
{
int pin, base;

base = PINS_PER_BANK * gpiospec->args[0];
pin = base + gpiospec->args[1];

if (pin > (gc->base + gc->ngpio))
return -EINVAL;

if (flags)
*flags = gpiospec->args[2];

return pin;
}

static struct gpio_chip sunxi_pinctrl_gpio_chip = {
.owner = THIS_MODULE,
.request = sunxi_pinctrl_gpio_request,
Expand All @@ -1269,6 +1287,8 @@ static struct gpio_chip sunxi_pinctrl_gpio_chip = {
.direction_output = sunxi_pinctrl_gpio_direction_output,
.get = sunxi_pinctrl_gpio_get,
.set = sunxi_pinctrl_gpio_set,
.of_xlate = sunxi_pinctrl_gpio_of_xlate,
.of_gpio_n_cells = 3,
.can_sleep = 0,
};

Expand Down

0 comments on commit ca11ffa

Please sign in to comment.