qemu-gpiodev/libgpiod.git
8 years agocore: dynamically allocate memory for GPIO line request data
Bartosz Golaszewski [Mon, 2 Jan 2017 13:51:01 +0000 (14:51 +0100)]
core: dynamically allocate memory for GPIO line request data

For bulk requests, the lines will share the struct gpiohandle_request
object. Instead of it being a part of struct gpiod_line, allocate its
memory dynamically and only store the pointer in the line context
structure.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agocore: rename two fields of struct gpiod_line
Bartosz Golaszewski [Mon, 2 Jan 2017 13:27:35 +0000 (14:27 +0100)]
core: rename two fields of struct gpiod_line

Drop the 'l' prefix - it's clear the fields are part of a GPIO line
structure.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agocore: ioctl() code shrink
Bartosz Golaszewski [Mon, 2 Jan 2017 13:06:03 +0000 (14:06 +0100)]
core: ioctl() code shrink

Wrap GPIO ioctl() calls in a routine setting the libgpiod errno in
case of an error.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agoerror: add internal wrappers for setting libgpiod errno
Bartosz Golaszewski [Mon, 2 Jan 2017 13:01:13 +0000 (14:01 +0100)]
error: add internal wrappers for setting libgpiod errno

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agodocumentation: add Doxyfile
Bartosz Golaszewski [Mon, 2 Jan 2017 11:41:52 +0000 (12:41 +0100)]
documentation: add Doxyfile

Add doxygen configuration and a new target to Makefile.am to generate
documentation. Also: update gitignore.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agolibgpiod: use a per-thread variable for storing errors
Bartosz Golaszewski [Mon, 2 Jan 2017 12:31:58 +0000 (13:31 +0100)]
libgpiod: use a per-thread variable for storing errors

The kernel-like trick with embedding error numbers in pointers can't
be guaranteed to work on all architectures. Use a per-thread variable
instead and add corresponding routines to access it.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agobuild: define _GNU_SOURCE for .c files
Bartosz Golaszewski [Mon, 2 Jan 2017 12:30:58 +0000 (13:30 +0100)]
build: define _GNU_SOURCE for .c files

This is needed for asprintf().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agolibgpiod: add a simple README
Bartosz Golaszewski [Mon, 2 Jan 2017 10:44:35 +0000 (11:44 +0100)]
libgpiod: add a simple README

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agogitignore: ignore files generated by autotools
Bartosz Golaszewski [Mon, 2 Jan 2017 10:25:52 +0000 (11:25 +0100)]
gitignore: ignore files generated by autotools

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agobuild: add autotools configuration
Bartosz Golaszewski [Mon, 2 Jan 2017 10:23:20 +0000 (11:23 +0100)]
build: add autotools configuration

This allows to build the library and programs using autotools.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agolibgpiod: initial commit
Bartosz Golaszewski [Mon, 26 Dec 2016 21:54:01 +0000 (22:54 +0100)]
libgpiod: initial commit

This adds four basic tools and implements core functionalities.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>