at end of the body of function gpiod_configure_flags:
/* Process flags */
if (dflags & GPIOD_FLAGS_BIT_DIR_OUT)
ret = gpiod_direction_output(desc,
!!(dflags & GPIOD_FLAGS_BIT_DIR_VAL));
else
ret = gpiod_direction_input(desc);
return ret;
}
if miss config,
the default value is 0, it will be GPIOD_ASIS,
then in gpiod_configure_flags ,
it will call gpiod_direction_input .
struct acpi_gpio_info {
struct acpi_device *adev;
enum gpiod_flags flags;
bool gpioint;
int pin_config;
int polarity;
int triggering;
unsigned int quirks;
};
enum gpiod_flags { BIT_DIR_ SET, BIT_DIR_ SET | GPIOD_FLAGS_ BIT_DIR_ OUT, BIT_DIR_ SET | GPIOD_FLAGS_ BIT_DIR_ OUT | FLAGS_BIT_ DIR_VAL, OUT_LOW_ OPEN_DRAIN = GPIOD_OUT_LOW | GPIOD_FLAGS_ BIT_OPEN_ DRAIN, OUT_HIGH_ OPEN_DRAIN = GPIOD_OUT_HIGH | GPIOD_FLAGS_ BIT_OPEN_ DRAIN,
GPIOD_ASIS = 0,
GPIOD_IN = GPIOD_FLAGS_
GPIOD_OUT_LOW = GPIOD_FLAGS_
GPIOD_OUT_HIGH = GPIOD_FLAGS_
GPIOD_
GPIOD_
GPIOD_
};
#define GPIOD_FLAGS_ BIT_DIR_ SET BIT(0) BIT_DIR_ OUT BIT(1) BIT_DIR_ VAL BIT(2) BIT_OPEN_ DRAIN BIT(3) BIT_NONEXCLUSIV E BIT(4)
#define GPIOD_FLAGS_
#define GPIOD_FLAGS_
#define GPIOD_FLAGS_
#define GPIOD_FLAGS_
at end of the body of function gpiod_configure _flags:
/* Process flags */ BIT_DIR_ OUT) _output( desc, BIT_DIR_ VAL)); _input( desc);
if (dflags & GPIOD_FLAGS_
ret = gpiod_direction
!!(dflags & GPIOD_FLAGS_
else
ret = gpiod_direction
return ret;
}
if miss config, _flags , _input .
the default value is 0, it will be GPIOD_ASIS,
then in gpiod_configure
it will call gpiod_direction
are all the above right ?