Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176055
b: refs/heads/master
c: dc0fb25
h: refs/heads/master
i:
  176053: 0782d11
  176051: 5036532
  176047: 2516269
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Dec 13, 2009
1 parent 6befa6a commit cb212f2
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: ecba96e6966174ccee47255c98b2091a739e1e45
refs/heads/master: dc0fb25c14e37f2ab843c2901743222f2be7f447
13 changes: 13 additions & 0 deletions trunk/drivers/gpio/wm831x-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/mfd/wm831x/core.h>
#include <linux/mfd/wm831x/pdata.h>
#include <linux/mfd/wm831x/gpio.h>
#include <linux/mfd/wm831x/irq.h>

struct wm831x_gpio {
struct wm831x *wm831x;
Expand Down Expand Up @@ -78,6 +79,17 @@ static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
value << offset);
}

static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip);
struct wm831x *wm831x = wm831x_gpio->wm831x;

if (!wm831x->irq_base)
return -EINVAL;

return wm831x->irq_base + WM831X_IRQ_GPIO_1 + offset;
}

#ifdef CONFIG_DEBUG_FS
static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{
Expand Down Expand Up @@ -173,6 +185,7 @@ static struct gpio_chip template_chip = {
.get = wm831x_gpio_get,
.direction_output = wm831x_gpio_direction_out,
.set = wm831x_gpio_set,
.to_irq = wm831x_gpio_to_irq,
.dbg_show = wm831x_gpio_dbg_show,
.can_sleep = 1,
};
Expand Down

0 comments on commit cb212f2

Please sign in to comment.