aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRojhalat Ibrahim <imr@rtschenk.de>2015-03-05 08:36:36 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-03-09 12:38:49 -0400
commitde3b696542d3e0fb897149680821dae480c314af (patch)
tree1bca3670194877706216ab47667a14ebdeb04f7c
parent39521090e93671c01fbc50d47b6422c2b0aa63b1 (diff)
extend documentation for gpiod_set_array() functions
Extend the documentation for the gpiod_set_array() functions and elaborate a bit on possible use cases. Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--Documentation/gpio/consumer.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt
index d29a9725c9e5..c21c1313f09e 100644
--- a/Documentation/gpio/consumer.txt
+++ b/Documentation/gpio/consumer.txt
@@ -259,6 +259,26 @@ GPIOs belonging to the same bank or chip simultaneously if supported by the
259corresponding chip driver. In that case a significantly improved performance 259corresponding chip driver. In that case a significantly improved performance
260can be expected. If simultaneous setting is not possible the GPIOs will be set 260can be expected. If simultaneous setting is not possible the GPIOs will be set
261sequentially. 261sequentially.
262
263The gpiod_set_array() functions take three arguments:
264 * array_size - the number of array elements
265 * desc_array - an array of GPIO descriptors
266 * value_array - an array of values to assign to the GPIOs
267
268The descriptor array can be obtained using the gpiod_get_array() function
269or one of its variants. If the group of descriptors returned by that function
270matches the desired group of GPIOs, those GPIOs can be set by simply using
271the struct gpio_descs returned by gpiod_get_array():
272
273 struct gpio_descs *my_gpio_descs = gpiod_get_array(...);
274 gpiod_set_array(my_gpio_descs->ndescs, my_gpio_descs->desc,
275 my_gpio_values);
276
277It is also possible to set a completely arbitrary array of descriptors. The
278descriptors may be obtained using any combination of gpiod_get() and
279gpiod_get_array(). Afterwards the array of descriptors has to be setup
280manually before it can be used with gpiod_set_array().
281
262Note that for optimal performance GPIOs belonging to the same chip should be 282Note that for optimal performance GPIOs belonging to the same chip should be
263contiguous within the array of descriptors. 283contiguous within the array of descriptors.
264 284