We try to drop potentially set output flags from line config if edge
detection is enabled but we use the library enum instead of the one from
the uAPI. In any case, we should actually loudly complain if user tries
to use the output mode with edge-detection (like we do currently) so just
remove offending lines entirely.
Reported-by: Anne Bezemer <j.a.bezemer@opensourcepartners.nl>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Anne Bezemer <j.a.bezemer@opensourcepartners.nl>
case GPIOD_LINE_EDGE_FALLING:
flags |= (GPIO_V2_LINE_FLAG_EDGE_FALLING |
GPIO_V2_LINE_FLAG_INPUT);
- flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
break;
case GPIOD_LINE_EDGE_RISING:
flags |= (GPIO_V2_LINE_FLAG_EDGE_RISING |
GPIO_V2_LINE_FLAG_INPUT);
- flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
break;
case GPIOD_LINE_EDGE_BOTH:
flags |= (GPIO_V2_LINE_FLAG_EDGE_FALLING |
GPIO_V2_LINE_FLAG_EDGE_RISING |
GPIO_V2_LINE_FLAG_INPUT);
- flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
break;
default:
break;