Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340117
b: refs/heads/master
c: a19fe2d
h: refs/heads/master
i:
  340115: db2f4ab
v: v3
  • Loading branch information
Tomasz Figa authored and Linus Walleij committed Oct 15, 2012
1 parent d73ab1d commit eed5d87
Show file tree
Hide file tree
Showing 2 changed files with 20 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: 22b9ba033bb4401e4cceb69c9e1af74a4631dd74
refs/heads/master: a19fe2d45cc550ca42a3b0be3e716a8452e4b0c6
19 changes: 19 additions & 0 deletions trunk/drivers/pinctrl/pinctrl-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/irqdomain.h>

#include "core.h"
#include "pinctrl-samsung.h"
Expand Down Expand Up @@ -527,6 +528,23 @@ static int samsung_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
return pinctrl_gpio_direction_output(gc->base + offset);
}

/*
* gpiolib gpio_to_irq callback function. Creates a mapping between a GPIO pin
* and a virtual IRQ, if not already present.
*/
static int samsung_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
{
struct samsung_pin_bank *bank = gc_to_pin_bank(gc);
unsigned int virq;

if (!bank->irq_domain)
return -ENXIO;

virq = irq_create_mapping(bank->irq_domain, offset);

return (virq) ? : -ENXIO;
}

/*
* Parse the pin names listed in the 'samsung,pins' property and convert it
* into a list of gpio numbers are create a pin group from it.
Expand Down Expand Up @@ -755,6 +773,7 @@ static const struct gpio_chip samsung_gpiolib_chip = {
.get = samsung_gpio_get,
.direction_input = samsung_gpio_direction_input,
.direction_output = samsung_gpio_direction_output,
.to_irq = samsung_gpio_to_irq,
.owner = THIS_MODULE,
};

Expand Down

0 comments on commit eed5d87

Please sign in to comment.