linux: use correct gpio bias flags (#5878)

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-11-08 09:56:52 -05:00 committed by GitHub
parent 6485ff800b
commit 5b1a667659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -147,11 +147,11 @@ gpio_in_reset(struct gpio_in g, int8_t pull_up)
memset(&req, 0, sizeof(req));
req.lines = 1;
req.flags = GPIOHANDLE_REQUEST_INPUT;
#if defined(GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP)
#if defined(GPIOHANDLE_REQUEST_BIAS_PULL_UP)
if (pull_up > 0) {
req.flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_UP;
req.flags |= GPIOHANDLE_REQUEST_BIAS_PULL_UP;
} else if (pull_up < 0) {
req.flags |= GPIOD_LINE_REQUEST_FLAG_BIAS_PULL_DOWN;
req.flags |= GPIOHANDLE_REQUEST_BIAS_PULL_DOWN;
}
#endif
req.lineoffsets[0] = g.line->offset;