Skip to content

Commit

Permalink
Merge tag 'gpio-fixes-v3.9' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Two GPIO fixes for the v3.9 series:
   - Fix erroneous return value in the ICH driver
   - Make the STMPE driver proper properly on device tree boots"

* tag 'gpio-fixes-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: stmpe: pass DT node to irqdomain
  gpio-ich: Fix value returned by ichx_gpio_request
  • Loading branch information
Linus Torvalds committed Apr 4, 2013
2 parents 66ade47 + 9afd9b7 commit 8d44827
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-ich.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int ichx_gpio_request(struct gpio_chip *chip, unsigned nr)
* If it can't be trusted, assume that the pin can be used as a GPIO.
*/
if (ichx_priv.desc->use_sel_ignore[nr / 32] & (1 << (nr & 0x1f)))
return 1;
return 0;

return ichx_read_bit(GPIO_USE_SEL, nr) ? 0 : -ENODEV;
}
Expand Down
15 changes: 11 additions & 4 deletions drivers/gpio/gpio-stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,15 @@ static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = {
.xlate = irq_domain_xlate_twocell,
};

static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio)
static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio,
struct device_node *np)
{
int base = stmpe_gpio->irq_base;
int base = 0;

stmpe_gpio->domain = irq_domain_add_simple(NULL,
if (!np)
base = stmpe_gpio->irq_base;

stmpe_gpio->domain = irq_domain_add_simple(np,
stmpe_gpio->chip.ngpio, base,
&stmpe_gpio_irq_simple_ops, stmpe_gpio);
if (!stmpe_gpio->domain) {
Expand Down Expand Up @@ -346,6 +350,9 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
stmpe_gpio->chip = template_chip;
stmpe_gpio->chip.ngpio = stmpe->num_gpios;
stmpe_gpio->chip.dev = &pdev->dev;
#ifdef CONFIG_OF
stmpe_gpio->chip.of_node = np;
#endif
stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;

if (pdata)
Expand All @@ -366,7 +373,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
goto out_free;

if (irq >= 0) {
ret = stmpe_gpio_irq_init(stmpe_gpio);
ret = stmpe_gpio_irq_init(stmpe_gpio, np);
if (ret)
goto out_disable;

Expand Down

0 comments on commit 8d44827

Please sign in to comment.