]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: sh-pfc: fix gpio input read
authorVladimir Barinov <vladimir.barinov@cogentembedded.com>
Mon, 20 Jul 2015 17:49:25 +0000 (20:49 +0300)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Mon, 31 Aug 2015 08:26:03 +0000 (17:26 +0900)
Fix gpio_read: gpio input (INDT) and gpio output (OUTDT) registers
have different offset. gpio_read must be performed from INDT.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/gpio/sh_pfc.c

index 7a5af20a2ad6650b96d4388ea7be32cb47f6203d..a0eac137c20cc858e339b0de94efea942a7af06f 100644 (file)
@@ -75,7 +75,8 @@ static int gpio_read_bit(struct pinmux_data_reg *dr,
        debug("read_bit: addr = %lx, pos = %ld, "
                 "r_width = %ld\n", dr->reg, pos, dr->reg_width);
 
-       return (gpio_read_raw_reg(dr->mapped_reg, dr->reg_width) >> pos) & 1;
+       return
+           (gpio_read_raw_reg(dr->mapped_reg + 0x4, dr->reg_width) >> pos) & 1;
 }
 
 static void gpio_write_bit(struct pinmux_data_reg *dr,