|
@@ -105,7 +105,11 @@ static int mrfld_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|
static void mrfld_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
|
static void mrfld_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
|
int value)
|
|
int value)
|
|
{
|
|
{
|
|
|
|
+ struct mrfld_gpio *priv = gpiochip_get_data(chip);
|
|
void __iomem *gpsr, *gpcr;
|
|
void __iomem *gpsr, *gpcr;
|
|
|
|
+ unsigned long flags;
|
|
|
|
+
|
|
|
|
+ raw_spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
|
|
if (value) {
|
|
if (value) {
|
|
gpsr = gpio_reg(chip, offset, GPSR);
|
|
gpsr = gpio_reg(chip, offset, GPSR);
|
|
@@ -114,6 +118,8 @@ static void mrfld_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
|
gpcr = gpio_reg(chip, offset, GPCR);
|
|
gpcr = gpio_reg(chip, offset, GPCR);
|
|
writel(BIT(offset % 32), gpcr);
|
|
writel(BIT(offset % 32), gpcr);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ raw_spin_unlock_irqrestore(&priv->lock, flags);
|
|
}
|
|
}
|
|
|
|
|
|
static int mrfld_gpio_direction_input(struct gpio_chip *chip,
|
|
static int mrfld_gpio_direction_input(struct gpio_chip *chip,
|
|
@@ -160,8 +166,13 @@ static void mrfld_irq_ack(struct irq_data *d)
|
|
struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
|
|
struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
|
|
u32 gpio = irqd_to_hwirq(d);
|
|
u32 gpio = irqd_to_hwirq(d);
|
|
void __iomem *gisr = gpio_reg(&priv->chip, gpio, GISR);
|
|
void __iomem *gisr = gpio_reg(&priv->chip, gpio, GISR);
|
|
|
|
+ unsigned long flags;
|
|
|
|
+
|
|
|
|
+ raw_spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
|
|
writel(BIT(gpio % 32), gisr);
|
|
writel(BIT(gpio % 32), gisr);
|
|
|
|
+
|
|
|
|
+ raw_spin_unlock_irqrestore(&priv->lock, flags);
|
|
}
|
|
}
|
|
|
|
|
|
static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask)
|
|
static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask)
|