Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223541
b: refs/heads/master
c: 0018516
h: refs/heads/master
i:
  223539: c5a08ee
v: v3
  • Loading branch information
Andres Salomon authored and Linus Torvalds committed Dec 23, 2010
1 parent 9d302ec commit 732a84d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: e819eb8687767cefca7b6abf5ac6d5efcf581eeb
refs/heads/master: 001851659354cce436b749a793f3512a53394d80
15 changes: 11 additions & 4 deletions trunk/drivers/gpio/cs5535-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ static struct cs5535_gpio_chip {
* registers, see include/linux/cs5535.h.
*/

static void errata_outl(u32 val, unsigned long addr)
static void errata_outl(struct cs5535_gpio_chip *chip, u32 val,
unsigned int reg)
{
unsigned long addr = chip->base + 0x80 + reg;

/*
* According to the CS5536 errata (#36), after suspend
* a write to the high bank GPIO register will clear all
* non-selected bits; the recommended workaround is a
* read-modify-write operation.
*
* Don't apply this errata to the edge status GPIOs, as writing
* to their lower bits will clear them.
*/
val |= inl(addr);
if (reg != GPIO_POSITIVE_EDGE_STS && reg != GPIO_NEGATIVE_EDGE_STS)
val |= inl(addr);
outl(val, addr);
}

Expand All @@ -76,7 +83,7 @@ static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset,
outl(1 << offset, chip->base + reg);
else
/* high bank register */
errata_outl(1 << (offset - 16), chip->base + 0x80 + reg);
errata_outl(chip, 1 << (offset - 16), reg);
}

void cs5535_gpio_set(unsigned offset, unsigned int reg)
Expand All @@ -98,7 +105,7 @@ static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset,
outl(1 << (offset + 16), chip->base + reg);
else
/* high bank register */
errata_outl(1 << offset, chip->base + 0x80 + reg);
errata_outl(chip, 1 << offset, reg);
}

void cs5535_gpio_clear(unsigned offset, unsigned int reg)
Expand Down

0 comments on commit 732a84d

Please sign in to comment.