spin_lock_irqsave(&port->lock, flags);
if (value)
- writew(1 << offset, ®s->data_set);
+ writew(BIT(offset), ®s->data_set);
else
- writew(1 << offset, ®s->data_clear);
+ writew(BIT(offset), ®s->data_clear);
spin_unlock_irqrestore(&port->lock, flags);
}
struct gpio_port_t *regs = port->regs;
unsigned long flags;
- adi_gpio_set_value(chip, offset, value);
-
spin_lock_irqsave(&port->lock, flags);
- writew(readw(®s->inen) & ~(1 << offset), ®s->inen);
- writew(1 << offset, ®s->dir_set);
+ writew(readw(®s->inen) & ~BIT(offset), ®s->inen);
+ if (value)
+ writew(BIT(offset), ®s->data_set);
+ else
+ writew(BIT(offset), ®s->data_clear);
+ writew(BIT(offset), ®s->dir_set);
spin_unlock_irqrestore(&port->lock, flags);