Add local gpio control

This driver permits controlling local (on the system) gpios
by using the libgpiod library.

Support for gpiod v1 and v2 is added, and parses the options
via the yaml parser.

This can be tested with the gpio-sim module:
https://docs.kernel.org/admin-guide/gpio/gpio-sim.html

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
Neil Armstrong
2023-10-24 10:36:20 +02:00
parent 55902b7ba9
commit 87fbc38286
13 changed files with 522 additions and 0 deletions

View File

@@ -129,6 +129,13 @@ static void parse_board(struct device_parser *dp)
continue;
}
if (!strcmp(key, "local_gpio")) {
dev->control_options = local_gpio_ops.parse_options(dp);
if (dev->control_options)
set_control_ops(dev, &local_gpio_ops);
continue;
}
device_parser_expect(dp, YAML_SCALAR_EVENT, value, TOKEN_LENGTH);
if (!strcmp(key, "board")) {