package/openocd: fix build with libgpiod2

openocd is not compatible with libgpiod2 resulting in the following
build failure since the addition of libgpiod2 in commit
57391fad2e:

src/jtag/drivers/linuxgpiod.c: In function 'helper_get_line':
src/jtag/drivers/linuxgpiod.c:283:19: error: 'GPIOD_LINE_REQUEST_DIRECTION_INPUT' undeclared (first use in this function); did you mean 'GPIOD_LINE_DIRECTION_INPUT'?
  283 |         int dir = GPIOD_LINE_REQUEST_DIRECTION_INPUT, flags = 0, val = 0, retval;
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   GPIOD_LINE_DIRECTION_INPUT

Fixes: 57391fad2e
 - http://autobuild.buildroot.org/results/7195e8b76350f26ab3b963702d88b254512e6928

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit be3252fe01)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Fabrice Fontaine 2024-05-06 22:52:49 +02:00 committed by Peter Korsgaard
parent 41ef581ac5
commit 7246f19516

View File

@ -56,8 +56,14 @@ OPENOCD_DEPENDENCIES = \
$(if $(BR2_PACKAGE_LIBUSB),libusb) \
$(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \
$(if $(BR2_PACKAGE_LIBHID),libhid) \
$(if $(BR2_PACKAGE_HIDAPI),hidapi) \
$(if $(BR2_PACKAGE_LIBGPIOD),libgpiod)
$(if $(BR2_PACKAGE_HIDAPI),hidapi)
ifeq ($(BR2_PACKAGE_LIBGPIOD),y)
OPENOCD_DEPENDENCIES += libgpiod
OPENOCD_CONF_OPTS += --enable-linuxgpiod
else
OPENOCD_CONF_OPTS += --disable-linuxgpiod
endif
# Adapters
OPENOCD_CONF_OPTS += \