Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360059
b: refs/heads/master
c: f160a28
h: refs/heads/master
i:
  360057: 6794da2
  360055: 86bbb4c
v: v3
  • Loading branch information
Gabor Juhos authored and John Crispin committed Feb 17, 2013
1 parent 67e6187 commit c7f7c16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 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: 8838becdf5f7261d7f5dfbbe957fe9b9ed188aec
refs/heads/master: f160a289e0e8848391f5ec48ff1a014b9c04b162
30 changes: 6 additions & 24 deletions trunk/arch/mips/ath79/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,46 +154,28 @@ static void __iomem *ath79_gpio_get_function_reg(void)
return ath79_gpio_base + reg;
}

void ath79_gpio_function_enable(u32 mask)
void ath79_gpio_function_setup(u32 set, u32 clear)
{
void __iomem *reg = ath79_gpio_get_function_reg();
unsigned long flags;

spin_lock_irqsave(&ath79_gpio_lock, flags);

__raw_writel(__raw_readl(reg) | mask, reg);
__raw_writel((__raw_readl(reg) & ~clear) | set, reg);
/* flush write */
__raw_readl(reg);

spin_unlock_irqrestore(&ath79_gpio_lock, flags);
}

void ath79_gpio_function_disable(u32 mask)
void ath79_gpio_function_enable(u32 mask)
{
void __iomem *reg = ath79_gpio_get_function_reg();
unsigned long flags;

spin_lock_irqsave(&ath79_gpio_lock, flags);

__raw_writel(__raw_readl(reg) & ~mask, reg);
/* flush write */
__raw_readl(reg);

spin_unlock_irqrestore(&ath79_gpio_lock, flags);
ath79_gpio_function_setup(mask, 0);
}

void ath79_gpio_function_setup(u32 set, u32 clear)
void ath79_gpio_function_disable(u32 mask)
{
void __iomem *reg = ath79_gpio_get_function_reg();
unsigned long flags;

spin_lock_irqsave(&ath79_gpio_lock, flags);

__raw_writel((__raw_readl(reg) & ~clear) | set, reg);
/* flush write */
__raw_readl(reg);

spin_unlock_irqrestore(&ath79_gpio_lock, flags);
ath79_gpio_function_setup(0, mask);
}

void __init ath79_gpio_init(void)
Expand Down

0 comments on commit c7f7c16

Please sign in to comment.