diff options
author | Olof Johansson <olof@lixom.net> | 2012-11-21 13:13:53 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 13:13:53 -0500 |
commit | 4aa7cf79b1f760b5751d1686329351c2e060791b (patch) | |
tree | 1c05a37804a577a01011de8e4c781f2833b3ca9c /drivers/gpio | |
parent | a19e2337790a7a0b8593c7d0b694dab83bfbd489 (diff) | |
parent | 343db4bda61feb3ac177d73f006e3527dcb431da (diff) |
Merge branch 'next/gpio-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/drivers
From Kukjin Kim:
This is for Samsung gpio stuff and got the ack from Linus Walleij.
* 'next/gpio-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
gpio: samsung: use pr_* instead of printk
gpio: samsung: Fix input mode setting function for GPIO int
ARM: SAMSUNG: Insert bitmap_gpio_int member in samsung_gpio_chip
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-samsung.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index a006f0db15af..43c4595b5cf0 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 | |||
51 | int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip, | 45 | int 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 | } |