aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-mvebu.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2012-11-21 05:38:13 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-11-21 05:38:13 -0500
commit851462444d421c223965b12b836bef63da61b57f (patch)
tree495baa14e638817941496c36e1443aed7dae0ea0 /drivers/gpio/gpio-mvebu.c
parent5a6ea4af0907f995dc06df21a9c9ef764c7cd3bc (diff)
parent6924d99fcdf1a688538a3cdebd1f135c22eec191 (diff)
Merge branch 'for-3.7' of git://git.infradead.org/users/dedekind/l2-mtd
Conflicts: drivers/mtd/nand/nand_base.c
Diffstat (limited to 'drivers/gpio/gpio-mvebu.c')
-rw-r--r--drivers/gpio/gpio-mvebu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 902af437eaf2..cf7afb9eb61a 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -244,6 +244,8 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
244 if (ret) 244 if (ret)
245 return ret; 245 return ret;
246 246
247 mvebu_gpio_set(chip, pin, value);
248
247 spin_lock_irqsave(&mvchip->lock, flags); 249 spin_lock_irqsave(&mvchip->lock, flags);
248 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip)); 250 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));
249 u &= ~(1 << pin); 251 u &= ~(1 << pin);
@@ -381,11 +383,13 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
381 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip)); 383 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
382 u &= ~(1 << pin); 384 u &= ~(1 << pin);
383 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip)); 385 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
386 break;
384 case IRQ_TYPE_EDGE_FALLING: 387 case IRQ_TYPE_EDGE_FALLING:
385 case IRQ_TYPE_LEVEL_LOW: 388 case IRQ_TYPE_LEVEL_LOW:
386 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip)); 389 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
387 u |= 1 << pin; 390 u |= 1 << pin;
388 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip)); 391 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
392 break;
389 case IRQ_TYPE_EDGE_BOTH: { 393 case IRQ_TYPE_EDGE_BOTH: {
390 u32 v; 394 u32 v;
391 395
@@ -401,6 +405,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
401 else 405 else
402 u &= ~(1 << pin); /* rising */ 406 u &= ~(1 << pin); /* rising */
403 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip)); 407 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
408 break;
404 } 409 }
405 } 410 }
406 return 0; 411 return 0;
@@ -641,7 +646,7 @@ static int __devinit mvebu_gpio_probe(struct platform_device *pdev)
641 ct->handler = handle_edge_irq; 646 ct->handler = handle_edge_irq;
642 ct->chip.name = mvchip->chip.label; 647 ct->chip.name = mvchip->chip.label;
643 648
644 irq_setup_generic_chip(gc, IRQ_MSK(ngpios), IRQ_GC_INIT_MASK_CACHE, 649 irq_setup_generic_chip(gc, IRQ_MSK(ngpios), 0,
645 IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE); 650 IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
646 651
647 /* Setup irq domain on top of the generic chip. */ 652 /* Setup irq domain on top of the generic chip. */