Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 370611
b: refs/heads/master
c: 203f31c
h: refs/heads/master
i:
  370609: dbd0407
  370607: 42c49fc
v: v3
  • Loading branch information
Joseph Lo authored and Stephen Warren committed Apr 3, 2013
1 parent 0aa181d commit 7e1571b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0337c3e0c3cbbb3a4f411c292f52fcc314abae67
refs/heads/master: 203f31cb86eb6aa4c49711e7ca25a7660efc39b8
21 changes: 19 additions & 2 deletions trunk/drivers/gpio/gpio-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct tegra_gpio_bank {
u32 oe[4];
u32 int_enb[4];
u32 int_lvl[4];
u32 wake_enb[4];
#endif
};

Expand Down Expand Up @@ -333,15 +334,31 @@ static int tegra_gpio_suspend(struct device *dev)
bank->oe[p] = tegra_gpio_readl(GPIO_OE(gpio));
bank->int_enb[p] = tegra_gpio_readl(GPIO_INT_ENB(gpio));
bank->int_lvl[p] = tegra_gpio_readl(GPIO_INT_LVL(gpio));

/* Enable gpio irq for wake up source */
tegra_gpio_writel(bank->wake_enb[p],
GPIO_INT_ENB(gpio));
}
}
local_irq_restore(flags);
return 0;
}

static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable)
static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
{
struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
int gpio = d->hwirq;
u32 port, bit, mask;

port = GPIO_PORT(gpio);
bit = GPIO_BIT(gpio);
mask = BIT(bit);

if (enable)
bank->wake_enb[port] |= mask;
else
bank->wake_enb[port] &= ~mask;

return irq_set_irq_wake(bank->irq, enable);
}
#endif
Expand All @@ -353,7 +370,7 @@ static struct irq_chip tegra_gpio_irq_chip = {
.irq_unmask = tegra_gpio_irq_unmask,
.irq_set_type = tegra_gpio_irq_set_type,
#ifdef CONFIG_PM_SLEEP
.irq_set_wake = tegra_gpio_wake_enable,
.irq_set_wake = tegra_gpio_irq_set_wake,
#endif
};

Expand Down

0 comments on commit 7e1571b

Please sign in to comment.