Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198708
b: refs/heads/master
c: 8156fae
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Linus Torvalds committed May 27, 2010
1 parent 9e85833 commit d7cad29
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 75 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: 48feb337475aaf8f8603b0db8e88c6fe3e194ab6
refs/heads/master: 8156fae26aec0285840ffa6faff6cae017abe81b
74 changes: 0 additions & 74 deletions trunk/arch/arm/plat-omap/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,80 +677,6 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
__raw_writel(val, reg);
}

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;

if (cpu_is_omap44xx())
reg += OMAP4_GPIO_DEBOUNCENABLE;
else
reg += OMAP24XX_GPIO_DEBOUNCE_EN;

if (!(bank->mod_usage & l)) {
printk(KERN_ERR "GPIO %d not requested\n", gpio);
return;
}

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

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

if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
bank->dbck_enable_mask = val;
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);

void omap_set_gpio_debounce_time(int gpio, int enc_time)
{
struct gpio_bank *bank;
void __iomem *reg;

if (cpu_class_is_omap1())
return;

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

if (!bank->mod_usage) {
printk(KERN_ERR "GPIO not requested\n");
return;
}

enc_time &= 0xff;

if (cpu_is_omap44xx())
reg += OMAP4_GPIO_DEBOUNCINGTIME;
else
reg += OMAP24XX_GPIO_DEBOUNCE_VAL;

__raw_writel(enc_time, reg);
}
EXPORT_SYMBOL(omap_set_gpio_debounce_time);

#ifdef CONFIG_ARCH_OMAP2PLUS
static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
int trigger)
Expand Down

0 comments on commit d7cad29

Please sign in to comment.