Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286911
b: refs/heads/master
c: c23bb60
h: refs/heads/master
i:
  286909: 2131246
  286907: 3dec0db
  286903: 50291bc
  286895: 1cf0ece
  286879: b5ea6f5
  286847: db1b22e
v: v3
  • Loading branch information
Russell King committed Jan 21, 2012
1 parent 38344ae commit 00e6baa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: 2e95e51e184bd107380881502ea0f483c4500706
refs/heads/master: c23bb602af24a635d0894aa7091e184385bf8a9f
18 changes: 12 additions & 6 deletions trunk/drivers/mfd/ucb1x00-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,22 @@ static int ucb1x00_gpio_direction_output(struct gpio_chip *chip, unsigned offset
{
struct ucb1x00 *ucb = container_of(chip, struct ucb1x00, gpio);
unsigned long flags;
unsigned old, mask = 1 << offset;

spin_lock_irqsave(&ucb->io_lock, flags);
ucb->io_dir |= (1 << offset);
ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir);

old = ucb->io_out;
if (value)
ucb->io_out |= 1 << offset;
ucb->io_out |= mask;
else
ucb->io_out &= ~(1 << offset);
ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out);
ucb->io_out &= ~mask;

if (old != ucb->io_out)
ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out);

if (!(ucb->io_dir & mask)) {
ucb->io_dir |= mask;
ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir);
}
spin_unlock_irqrestore(&ucb->io_lock, flags);

return 0;
Expand Down

0 comments on commit 00e6baa

Please sign in to comment.