Merge tag 'configfs-for-5.2' of git://git.infradead.org/users/hch/configfs
[linux-2.6-microblaze.git] / drivers / gpio / gpio-mmio.c
index f172b43..6f904c8 100644 (file)
@@ -134,17 +134,6 @@ static int bgpio_get_set(struct gpio_chip *gc, unsigned int gpio)
        unsigned long pinmask = bgpio_line2mask(gc, gpio);
        bool dir = !!(gc->bgpio_dir & pinmask);
 
-       /*
-        * If the direction is OUT we read the value from the SET
-        * register, and if the direction is IN we read the value
-        * from the DAT register.
-        *
-        * If the direction bits are inverted, naturally this gets
-        * inverted too.
-        */
-       if (gc->bgpio_dir_inverted)
-               dir = !dir;
-
        if (dir)
                return !!(gc->read_reg(gc->reg_set) & pinmask);
        else
@@ -164,14 +153,8 @@ static int bgpio_get_set_multiple(struct gpio_chip *gc, unsigned long *mask,
        /* Make sure we first clear any bits that are zero when we read the register */
        *bits &= ~*mask;
 
-       /* Exploit the fact that we know which directions are set */
-       if (gc->bgpio_dir_inverted) {
-               set_mask = *mask & ~gc->bgpio_dir;
-               get_mask = *mask & gc->bgpio_dir;
-       } else {
-               set_mask = *mask & gc->bgpio_dir;
-               get_mask = *mask & ~gc->bgpio_dir;
-       }
+       set_mask = *mask & gc->bgpio_dir;
+       get_mask = *mask & ~gc->bgpio_dir;
 
        if (set_mask)
                *bits |= gc->read_reg(gc->reg_set) & set_mask;
@@ -550,13 +533,6 @@ static int bgpio_setup_direction(struct gpio_chip *gc,
                gc->direction_output = bgpio_dir_out;
                gc->direction_input = bgpio_dir_in;
                gc->get_direction = bgpio_get_dir;
-               /*
-                * If only dirin is available, this means we need
-                * inverted semantics when handling get/set registers
-                * so detect this here.
-                */
-               if (dirin && !dirout)
-                       gc->bgpio_dir_inverted = true;
        } else {
                if (flags & BGPIOF_NO_OUTPUT)
                        gc->direction_output = bgpio_dir_out_err;