mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 10:39:04 +00:00
4b0fbf3072
Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 44324
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
--- a/drivers/gpio/gpio-ralink.c
|
|
+++ b/drivers/gpio/gpio-ralink.c
|
|
@@ -148,14 +148,15 @@ static void ralink_gpio_irq_unmask(struc
|
|
{
|
|
struct ralink_gpio_chip *rg;
|
|
unsigned long flags;
|
|
- u32 val;
|
|
+ u32 rise, fall;
|
|
|
|
rg = (struct ralink_gpio_chip *) d->domain->host_data;
|
|
- val = rt_gpio_r32(rg, GPIO_REG_RENA);
|
|
+ rise = rt_gpio_r32(rg, GPIO_REG_RENA);
|
|
+ fall = rt_gpio_r32(rg, GPIO_REG_FENA);
|
|
|
|
spin_lock_irqsave(&rg->lock, flags);
|
|
- rt_gpio_w32(rg, GPIO_REG_RENA, val | (BIT(d->hwirq) & rg->rising));
|
|
- rt_gpio_w32(rg, GPIO_REG_FENA, val | (BIT(d->hwirq) & rg->falling));
|
|
+ rt_gpio_w32(rg, GPIO_REG_RENA, rise | (BIT(d->hwirq) & rg->rising));
|
|
+ rt_gpio_w32(rg, GPIO_REG_FENA, fall | (BIT(d->hwirq) & rg->falling));
|
|
spin_unlock_irqrestore(&rg->lock, flags);
|
|
}
|
|
|
|
@@ -163,14 +164,15 @@ static void ralink_gpio_irq_mask(struct
|
|
{
|
|
struct ralink_gpio_chip *rg;
|
|
unsigned long flags;
|
|
- u32 val;
|
|
+ u32 rise, fall;
|
|
|
|
rg = (struct ralink_gpio_chip *) d->domain->host_data;
|
|
- val = rt_gpio_r32(rg, GPIO_REG_RENA);
|
|
+ rise = rt_gpio_r32(rg, GPIO_REG_RENA);
|
|
+ fall = rt_gpio_r32(rg, GPIO_REG_FENA);
|
|
|
|
spin_lock_irqsave(&rg->lock, flags);
|
|
- rt_gpio_w32(rg, GPIO_REG_FENA, val & ~BIT(d->hwirq));
|
|
- rt_gpio_w32(rg, GPIO_REG_RENA, val & ~BIT(d->hwirq));
|
|
+ rt_gpio_w32(rg, GPIO_REG_FENA, fall & ~BIT(d->hwirq));
|
|
+ rt_gpio_w32(rg, GPIO_REG_RENA, rise & ~BIT(d->hwirq));
|
|
spin_unlock_irqrestore(&rg->lock, flags);
|
|
}
|
|
|