aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 13:59:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 13:59:11 -0500
commit698d601224824bc1a5bf17f3d86be902e2aabff0 (patch)
tree10262bd1f83fd26f874cbd898818e5925844a2ef /drivers/gpio
parenta11da7df6543b5f71a150b47c0d08ecf0799a0f3 (diff)
parent4aa7cf79b1f760b5751d1686329351c2e060791b (diff)
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver specific changes from Olof Johansson: "A collection of mostly SoC-specific driver updates: - a handful of pincontrol and setup changes - new drivers for hwmon and reset controller for vexpress - timing support updates for OMAP (gpmc and other interfaces) - plus a collection of smaller cleanups" * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits) ARM: ux500: fix pin warning ARM: OMAP2+: tusb6010: generic timing calculation ARM: OMAP2+: smc91x: generic timing calculation ARM: OMAP2+: onenand: generic timing calculation ARM: OMAP2+: gpmc: generic timing calculation ARM: OMAP2+: gpmc: handle additional timings ARM: OMAP2+: nand: remove redundant rounding gpio: samsung: use pr_* instead of printk ARM: ux500: fixup magnetometer pins ARM: ux500: add STM pin configuration ARM: ux500: 8500: add pinctrl support for uart1 and uart2 ARM: ux500: cosmetic fixups for uart0 gpio: samsung: Fix input mode setting function for GPIO int ARM: SAMSUNG: Insert bitmap_gpio_int member in samsung_gpio_chip ARM: ux500: 8500: define SDI sleep states ARM: vexpress: Reset driver ARM: ux500: 8500: update SKE keypad pinctrl table hwmon: Versatile Express hwmon driver ARM: ux500: delete duplicate macro ARM: ux500: 8500: add IDLE pin configuration for SPI ...
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-samsung.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index 88f41e51565b..01f7fe955590 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -42,12 +42,6 @@
42#include <plat/gpio-fns.h> 42#include <plat/gpio-fns.h>
43#include <plat/pm.h> 43#include <plat/pm.h>
44 44
45#ifndef DEBUG_GPIO
46#define gpio_dbg(x...) do { } while (0)
47#else
48#define gpio_dbg(x...) printk(KERN_DEBUG x)
49#endif
50
51int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip, 45int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
52 unsigned int off, samsung_gpio_pull_t pull) 46 unsigned int off, samsung_gpio_pull_t pull)
53{ 47{
@@ -596,10 +590,13 @@ static int samsung_gpiolib_4bit_input(struct gpio_chip *chip,
596 unsigned long con; 590 unsigned long con;
597 591
598 con = __raw_readl(base + GPIOCON_OFF); 592 con = __raw_readl(base + GPIOCON_OFF);
599 con &= ~(0xf << con_4bit_shift(offset)); 593 if (ourchip->bitmap_gpio_int & BIT(offset))
594 con |= 0xf << con_4bit_shift(offset);
595 else
596 con &= ~(0xf << con_4bit_shift(offset));
600 __raw_writel(con, base + GPIOCON_OFF); 597 __raw_writel(con, base + GPIOCON_OFF);
601 598
602 gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con); 599 pr_debug("%s: %p: CON now %08lx\n", __func__, base, con);
603 600
604 return 0; 601 return 0;
605} 602}
@@ -627,7 +624,7 @@ static int samsung_gpiolib_4bit_output(struct gpio_chip *chip,
627 __raw_writel(con, base + GPIOCON_OFF); 624 __raw_writel(con, base + GPIOCON_OFF);
628 __raw_writel(dat, base + GPIODAT_OFF); 625 __raw_writel(dat, base + GPIODAT_OFF);
629 626
630 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat); 627 pr_debug("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
631 628
632 return 0; 629 return 0;
633} 630}
@@ -671,7 +668,7 @@ static int samsung_gpiolib_4bit2_input(struct gpio_chip *chip,
671 con &= ~(0xf << con_4bit_shift(offset)); 668 con &= ~(0xf << con_4bit_shift(offset));
672 __raw_writel(con, regcon); 669 __raw_writel(con, regcon);
673 670
674 gpio_dbg("%s: %p: CON %08lx\n", __func__, base, con); 671 pr_debug("%s: %p: CON %08lx\n", __func__, base, con);
675 672
676 return 0; 673 return 0;
677} 674}
@@ -706,7 +703,7 @@ static int samsung_gpiolib_4bit2_output(struct gpio_chip *chip,
706 __raw_writel(con, regcon); 703 __raw_writel(con, regcon);
707 __raw_writel(dat, base + GPIODAT_OFF); 704 __raw_writel(dat, base + GPIODAT_OFF);
708 705
709 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat); 706 pr_debug("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
710 707
711 return 0; 708 return 0;
712} 709}
@@ -926,10 +923,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
926#ifdef CONFIG_PM 923#ifdef CONFIG_PM
927 if (chip->pm != NULL) { 924 if (chip->pm != NULL) {
928 if (!chip->pm->save || !chip->pm->resume) 925 if (!chip->pm->save || !chip->pm->resume)
929 printk(KERN_ERR "gpio: %s has missing PM functions\n", 926 pr_err("gpio: %s has missing PM functions\n",
930 gc->label); 927 gc->label);
931 } else 928 } else
932 printk(KERN_ERR "gpio: %s has no PM function\n", gc->label); 929 pr_err("gpio: %s has no PM function\n", gc->label);
933#endif 930#endif
934 931
935 /* gpiochip_add() prints own failure message on error. */ 932 /* gpiochip_add() prints own failure message on error. */
@@ -1081,6 +1078,8 @@ static void __init samsung_gpiolib_add_4bit_chips(struct samsung_gpio_chip *chip
1081 if ((base != NULL) && (chip->base == NULL)) 1078 if ((base != NULL) && (chip->base == NULL))
1082 chip->base = base + ((i) * 0x20); 1079 chip->base = base + ((i) * 0x20);
1083 1080
1081 chip->bitmap_gpio_int = 0;
1082
1084 samsung_gpiolib_add(chip); 1083 samsung_gpiolib_add(chip);
1085 } 1084 }
1086} 1085}