gpio: add helper GPIOD_FLAGS_OUTPUT
Add a macro to provide the GPIO output value according the dir flags content. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Tom Rini
parent
4292fb16bf
commit
9360bb06f1
@@ -129,6 +129,12 @@ struct gpio_desc {
|
||||
*/
|
||||
};
|
||||
|
||||
/* helper to compute the value of the gpio output */
|
||||
#define GPIOD_FLAGS_OUTPUT_MASK (GPIOD_ACTIVE_LOW | GPIOD_IS_OUT_ACTIVE)
|
||||
#define GPIOD_FLAGS_OUTPUT(flags) \
|
||||
(((((flags) & GPIOD_FLAGS_OUTPUT_MASK) == GPIOD_IS_OUT_ACTIVE) || \
|
||||
(((flags) & GPIOD_FLAGS_OUTPUT_MASK) == GPIOD_ACTIVE_LOW)))
|
||||
|
||||
/**
|
||||
* dm_gpio_is_valid() - Check if a GPIO is valid
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user