Skip to content

Commit

Permalink
Merge branch 'kevin' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Walleij committed Jul 9, 2012
2 parents 626f991 + 7b86cef commit 46bada6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,22 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank)
if (bank->dbck_enable_mask && !bank->dbck_enabled) {
clk_enable(bank->dbck);
bank->dbck_enabled = true;

__raw_writel(bank->dbck_enable_mask,
bank->base + bank->regs->debounce_en);
}
}

static inline void _gpio_dbck_disable(struct gpio_bank *bank)
{
if (bank->dbck_enable_mask && bank->dbck_enabled) {
/*
* Disable debounce before cutting it's clock. If debounce is
* enabled but the clock is not, GPIO module seems to be unable
* to detect events and generate interrupts at least on OMAP3.
*/
__raw_writel(0, bank->base + bank->regs->debounce_en);

clk_disable(bank->dbck);
bank->dbck_enabled = false;
}
Expand Down Expand Up @@ -1081,7 +1091,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
bank->is_mpuio = pdata->is_mpuio;
bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
bank->loses_context = pdata->loses_context;
bank->get_context_loss_count = pdata->get_context_loss_count;
bank->regs = pdata->regs;
#ifdef CONFIG_OF_GPIO
bank->chip.of_node = of_node_get(node);
Expand Down Expand Up @@ -1135,6 +1144,9 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
omap_gpio_chip_init(bank);
omap_gpio_show_rev(bank);

if (bank->loses_context)
bank->get_context_loss_count = pdata->get_context_loss_count;

pm_runtime_put(bank->dev);

list_add_tail(&bank->node, &omap_gpio_list);
Expand Down

0 comments on commit 46bada6

Please sign in to comment.