summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-rcar.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 11:39:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 11:39:44 -0700
commit60b5adffb4f3e4b4c1978959f24e8e531b2ef3cb (patch)
tree998e8d9a01b8367097de46dce9d102593b97cc9a /drivers/gpio/gpio-rcar.c
parenta9f4a7005fb1a0f6142cbb689e734621c61574d5 (diff)
parent038f0babc98a16211959010d7cd48b4a14f108cc (diff)
Merge tag 'gpio-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij: "Here is a batch of GPIO changes for v3.11. I have agreed with Grant to take care of the pull requests for this development cycle. No special things are happening in the GPIO tree this time (nice with some calm) and I have been extra careful to do regression builds and it's well boiled in -next. GPIO changes for the v3.11 development cycle: - Incremental development for the Langwell (Atom SoC), Xilinx, ICH and RCAR drivers. - Cleanups from Jingoo Han, Axel Lin, Wei Jongjun, Wolfram Sang, Tushar Behera, Sachin Kamat and Yijing Wang" * tag 'gpio-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (35 commits) Gpio/trivial: replace numeric with standard PM state macros gpiolib: remove warnning of allocations with IRQs disabled gpio: grgpio: Staticize local symbols gpio-langwell: remove Withney point support gpio: ich: add GPO_BLINK support gpio-sta2x11: Convert to use devm_ioremap_resource gpio_msm: Convert to use devm_ioremap_resource gpio-rcar: Use OUTDT when reading GPIOs configured as output gpio-sta2x11: Fix potential NULL pointer dereference gpio/omap: omap_gpio_init_context stub must be inline gpio: msm-v1: Remove errant __devinit to fix compile gpio: devres: make comments proper GPIO: xilinx: Enable driver for Xilinx zynq DT: Add documentation for gpio-xilinx GPIO: xilinx: Use BIT macro GPIO: xilinx: Use __raw_readl/__raw_writel IO functions GPIO: xilinx: Add support for dual channel GPIO: xilinx: Simplify driver probe function gpio: sx150x: convert to use devm_* functions MAINTAINERS: add linux-gpio mailing list ...
Diffstat (limited to 'drivers/gpio/gpio-rcar.c')
-rw-r--r--drivers/gpio/gpio-rcar.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 6ec82f76f019..e8198dd68615 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -232,7 +232,14 @@ static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset)
static int gpio_rcar_get(struct gpio_chip *chip, unsigned offset)
{
- return (int)(gpio_rcar_read(gpio_to_priv(chip), INDT) & BIT(offset));
+ u32 bit = BIT(offset);
+
+ /* testing on r8a7790 shows that INDT does not show correct pin state
+ * when configured as output, so use OUTDT in case of output pins */
+ if (gpio_rcar_read(gpio_to_priv(chip), INOUTSEL) & bit)
+ return (int)(gpio_rcar_read(gpio_to_priv(chip), OUTDT) & bit);
+ else
+ return (int)(gpio_rcar_read(gpio_to_priv(chip), INDT) & bit);
}
static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)