gpio: make gpiod_direction_output take a logical value
The documentation was not clear about whether gpio_direction_output should take a logical value or the physical level on the output line, i.e. whether the ACTIVE_LOW status would be taken into account. This converts gpiod_direction_output to use the logical level and adds a new gpiod_direction_output_raw for the raw value. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
25b35da7f4
commit
ef70bbe1aa
4 changed files with 57 additions and 20 deletions
|
@ -69,7 +69,7 @@ static inline int gpio_direction_input(unsigned gpio)
|
|||
}
|
||||
static inline int gpio_direction_output(unsigned gpio, int value)
|
||||
{
|
||||
return gpiod_direction_output(gpio_to_desc(gpio), value);
|
||||
return gpiod_direction_output_raw(gpio_to_desc(gpio), value);
|
||||
}
|
||||
|
||||
static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue