Add libgpiod v2 compatible bitbang master
The API was completely re-invented with libgpiod 2.0. Hence we add a
new driver as we would otherwise only share boilerplate with the old
driver. The new API makes it easier to re-configure GPIO pins on-the-
fly. Which we will use to implement dual- and quad-i/o modes in the
future.
One downside of the new API is that there is no function to open a
chip by number anymore. So we have to emulate that behavior now for
backwards compatibility.
Change-Id: If6a02d98f15def51b61fe0c3f09092cf286a37eb
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/83
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/Makefile b/Makefile
index e51fa25..1a9fb47 100644
--- a/Makefile
+++ b/Makefile
@@ -766,7 +766,11 @@
ifeq ($(CONFIG_LINUX_GPIO_SPI), yes)
FEATURE_FLAGS += -D'CONFIG_LINUX_GPIO_SPI=1'
+ifneq ($(filter 1.%,$(CONFIG_LIBGPIOD_VERSION)), )
PROGRAMMER_OBJS += linux_gpio_spi.o
+else
+PROGRAMMER_OBJS += linux_gpio2_spi.o
+endif
endif
ifeq ($(CONFIG_MSTARDDC_SPI), yes)