linux_gpio2_spi: Implement multi i/o
Implement the optional bitbang_spi calls for multi-i/o. With the new
libgpiod API, this is straight forward.
By default, we enable dual-i/o mode. We add the optional `io2' and `io3'
parameters, which can be used to specify additional GPIO numbers for
quad-i/o.
Change-Id: I6113a8327c08a3d55fbc0c8ffba2d1a47925de34
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/84
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/flashprog.8.tmpl b/flashprog.8.tmpl
index ec6c044..0f1ca90 100644
--- a/flashprog.8.tmpl
+++ b/flashprog.8.tmpl
@@ -1159,10 +1159,17 @@
.B gpiochip=0
selects the GPIO chip 0, accessible through Linux device node /dev/gpiochip0, and the
.B cs, sck, mosi, miso
-arguments select the GPIO numbers used as SPI lines connected to the flash ROM chip. In this example
-the GPIO numbers of the hardware SPI lines of of a Raspberry Pi single board computer are specified.
-All programmer arguments are mandatory.
-Note that this is a bitbanged driver, and if your device has a hardware SPI controller, use the
+arguments select the GPIO numbers used as SPI lines connected to the flash ROM chip.
+If libgpiod 2.0 or later is available, dual-i/o is enabled by default with bidirectional
+MOSI and MISO lines, and if a quad-i/o capable chip is connect with four lines, the
+additional GPIOs can be specified via
+.BR io2 " and " io3
+parameters.
+
+In the example above, the GPIO numbers of the hardware SPI lines of a Raspberry Pi
+single board computer are specified. The first four GPIO parameters are mandatory.
+Note that this is a bitbanged driver, and if your device has a hardware SPI
+controller, use the
.B linux_spi
programmer driver instead for better performance.
.sp