On Mon, Jun 17, 2019 at 5:14 PM Harish Jenny K N <harish_kandiga@xxxxxxxxxx> wrote: > +static int gpio_inverter_get(struct gpio_chip *chip, > + unsigned int offset) > +{ > + struct gpio_inverter *inv = gpiochip_get_data(chip); > + > + return gpiod_get_value(inv->gpios[offset]); > +} > + > +static void gpio_inverter_set(struct gpio_chip *chip, > + unsigned int offset, int value) > +{ > + struct gpio_inverter *inv = gpiochip_get_data(chip); > + > + return gpiod_set_value(inv->gpios[offset], value); > +} The only reason this works is because you added GPIO_ACTIVE_LOW to all the lines in the device tree. But those are consumer flags, not producer flags. These should be removed, use GPIO_ACTIVE_HIGH and rewrite the code so that it actually does the inversion here: return !gpiod_get_value(inv->gpios[offset]); and return gpiod_set_value(inv->gpios[offset], !value); respectively (notice ! inversions) Yours, Linus Walleij