Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123730
b: refs/heads/master
c: e031ab2
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Tony Lindgren committed Dec 11, 2008
1 parent cbe3641 commit dd92d2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 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: 3ff164e15574191c69e8406794b0578c8d2a4e23
refs/heads/master: e031ab23deb5a5d9ac5744e69a0627823e81b074
20 changes: 15 additions & 5 deletions trunk/arch/arm/plat-omap/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ static inline struct gpio_bank *get_gpio_bank(int gpio)
return &gpio_bank[gpio >> 5];
if (cpu_is_omap34xx())
return &gpio_bank[gpio >> 5];
BUG();
return NULL;
}

static inline int get_gpio_index(int gpio)
Expand Down Expand Up @@ -448,28 +450,36 @@ void omap_set_gpio_debounce(int gpio, int enable)
{
struct gpio_bank *bank;
void __iomem *reg;
unsigned long flags;
u32 val, l = 1 << get_gpio_index(gpio);

if (cpu_class_is_omap1())
return;

bank = get_gpio_bank(gpio);
reg = bank->base;

reg += OMAP24XX_GPIO_DEBOUNCE_EN;

spin_lock_irqsave(&bank->lock, flags);
val = __raw_readl(reg);

if (enable && !(val & l))
val |= l;
else if (!enable && val & l)
else if (!enable && (val & l))
val &= ~l;
else
return;
goto done;

if (cpu_is_omap34xx())
enable ? clk_enable(bank->dbck) : clk_disable(bank->dbck);
if (cpu_is_omap34xx()) {
if (enable)
clk_enable(bank->dbck);
else
clk_disable(bank->dbck);
}

__raw_writel(val, reg);
done:
spin_unlock_irqrestore(&bank->lock, flags);
}
EXPORT_SYMBOL(omap_set_gpio_debounce);

Expand Down

0 comments on commit dd92d2c

Please sign in to comment.