mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-12 16:16:40 +07:00
MIPS: ath79: simplify ath79_gpio_function_* routines
Make ath79_gpio_function_{en,dis}able to be wrappers around ath79_gpio_function_setup. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4871/ Signed-off-by: John Crispin <blogic@openwrt.org>
This commit is contained in:
parent
8838becdf5
commit
f160a289e0
@ -154,34 +154,6 @@ static void __iomem *ath79_gpio_get_function_reg(void)
|
||||
return ath79_gpio_base + reg;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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) & ~mask, reg);
|
||||
/* flush write */
|
||||
__raw_readl(reg);
|
||||
|
||||
spin_unlock_irqrestore(&ath79_gpio_lock, flags);
|
||||
}
|
||||
|
||||
void ath79_gpio_function_setup(u32 set, u32 clear)
|
||||
{
|
||||
void __iomem *reg = ath79_gpio_get_function_reg();
|
||||
@ -196,6 +168,16 @@ void ath79_gpio_function_setup(u32 set, u32 clear)
|
||||
spin_unlock_irqrestore(&ath79_gpio_lock, flags);
|
||||
}
|
||||
|
||||
void ath79_gpio_function_enable(u32 mask)
|
||||
{
|
||||
ath79_gpio_function_setup(mask, 0);
|
||||
}
|
||||
|
||||
void ath79_gpio_function_disable(u32 mask)
|
||||
{
|
||||
ath79_gpio_function_setup(0, mask);
|
||||
}
|
||||
|
||||
void __init ath79_gpio_init(void)
|
||||
{
|
||||
int err;
|
||||
|
Loading…
Reference in New Issue
Block a user