diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 21:29:25 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 21:29:25 -0400 |
commit | 1ed31d6db90d51010545921e59d369d2f92b7ac2 (patch) | |
tree | 358a0b346bc8135cd5e53700eb44308b1a7c8c5b /drivers/gpio/pl061.c | |
parent | ceba1abcb00b0ef0b1efcd715285f6e05523edef (diff) | |
parent | 722154e4cacf015161efe60009ae9be23d492296 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'drivers/gpio/pl061.c')
-rw-r--r-- | drivers/gpio/pl061.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c index 5ad8f778ced4..105701a1f05b 100644 --- a/drivers/gpio/pl061.c +++ b/drivers/gpio/pl061.c | |||
@@ -91,6 +91,12 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, | |||
91 | gpiodir = readb(chip->base + GPIODIR); | 91 | gpiodir = readb(chip->base + GPIODIR); |
92 | gpiodir |= 1 << offset; | 92 | gpiodir |= 1 << offset; |
93 | writeb(gpiodir, chip->base + GPIODIR); | 93 | writeb(gpiodir, chip->base + GPIODIR); |
94 | |||
95 | /* | ||
96 | * gpio value is set again, because pl061 doesn't allow to set value of | ||
97 | * a gpio pin before configuring it in OUT mode. | ||
98 | */ | ||
99 | writeb(!!value << offset, chip->base + (1 << (offset + 2))); | ||
94 | spin_unlock_irqrestore(&chip->lock, flags); | 100 | spin_unlock_irqrestore(&chip->lock, flags); |
95 | 101 | ||
96 | return 0; | 102 | return 0; |
@@ -183,7 +189,7 @@ static int pl061_irq_type(unsigned irq, unsigned trigger) | |||
183 | gpioibe &= ~(1 << offset); | 189 | gpioibe &= ~(1 << offset); |
184 | if (trigger & IRQ_TYPE_EDGE_RISING) | 190 | if (trigger & IRQ_TYPE_EDGE_RISING) |
185 | gpioiev |= 1 << offset; | 191 | gpioiev |= 1 << offset; |
186 | else | 192 | else if (trigger & IRQ_TYPE_EDGE_FALLING) |
187 | gpioiev &= ~(1 << offset); | 193 | gpioiev &= ~(1 << offset); |
188 | } | 194 | } |
189 | writeb(gpioibe, chip->base + GPIOIBE); | 195 | writeb(gpioibe, chip->base + GPIOIBE); |
@@ -204,7 +210,7 @@ static struct irq_chip pl061_irqchip = { | |||
204 | 210 | ||
205 | static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) | 211 | static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) |
206 | { | 212 | { |
207 | struct list_head *chip_list = get_irq_chip_data(irq); | 213 | struct list_head *chip_list = get_irq_data(irq); |
208 | struct list_head *ptr; | 214 | struct list_head *ptr; |
209 | struct pl061_gpio *chip; | 215 | struct pl061_gpio *chip; |
210 | 216 | ||
@@ -297,9 +303,9 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) | |||
297 | goto iounmap; | 303 | goto iounmap; |
298 | } | 304 | } |
299 | INIT_LIST_HEAD(chip_list); | 305 | INIT_LIST_HEAD(chip_list); |
300 | set_irq_chip_data(irq, chip_list); | 306 | set_irq_data(irq, chip_list); |
301 | } else | 307 | } else |
302 | chip_list = get_irq_chip_data(irq); | 308 | chip_list = get_irq_data(irq); |
303 | list_add(&chip->list, chip_list); | 309 | list_add(&chip->list, chip_list); |
304 | 310 | ||
305 | for (i = 0; i < PL061_GPIO_NR; i++) { | 311 | for (i = 0; i < PL061_GPIO_NR; i++) { |