Commit 496069b8 authored by Biju Das's avatar Biju Das Committed by Linus Walleij

gpio: rcar: Add GPIO hole support

GPIO hole is present in RZ/G1C SoC. Valid GPIO pins on bank3 are in the
range GP3_0 to GP3_16 and GP3_27 to GP3_29. The GPIO pins between GP3_17
to GP3_26 are unused. Add support for handling unused GPIO's.
Signed-off-by: default avatarBiju Das <biju.das@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent a419a3d9
...@@ -321,6 +321,9 @@ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask, ...@@ -321,6 +321,9 @@ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
u32 val, bankmask; u32 val, bankmask;
bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0); bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
if (chip->valid_mask)
bankmask &= chip->valid_mask[0];
if (!bankmask) if (!bankmask)
return; return;
...@@ -558,6 +561,9 @@ static int gpio_rcar_resume(struct device *dev) ...@@ -558,6 +561,9 @@ static int gpio_rcar_resume(struct device *dev)
u32 mask; u32 mask;
for (offset = 0; offset < p->gpio_chip.ngpio; offset++) { for (offset = 0; offset < p->gpio_chip.ngpio; offset++) {
if (!gpiochip_line_is_valid(&p->gpio_chip, offset))
continue;
mask = BIT(offset); mask = BIT(offset);
/* I/O pin */ /* I/O pin */
if (!(p->bank_info.iointsel & mask)) { if (!(p->bank_info.iointsel & mask)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment