gpio: Introduce mraa_gpio_init_by_name API
This commit introduces mraa_gpio_init_by_name API for initializing a GPIO by its line name provided by the kernel. This feature depends on the GPIO chardev support and also the line names present in devicetree or board files. Accessing GPIO using its line name, removes the dependency from MRAA specific pin mapping and provides a cleaner way to access GPIOs. This will solve the issue created by an external gpiochip probing before the SoC's internal gpio controller and thereby making the MRAA pin mapping wrong. Currently, this API only supports initializing a single GPIO at a time. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
committed by
Manivannan Sadhasivam
parent
111e6be8f7
commit
0a12c5a017
@@ -64,6 +64,7 @@ mraa_boolean_t mraa_is_gpio_line_open_drain(mraa_gpiod_line_info *linfo);
|
||||
mraa_boolean_t mraa_is_gpio_line_open_source(mraa_gpiod_line_info *linfo);
|
||||
|
||||
int mraa_get_number_of_gpio_chips();
|
||||
int mraa_get_chip_infos(mraa_gpiod_chip_info*** cinfos);
|
||||
|
||||
/* Multiple gpio support. */
|
||||
typedef struct _gpio_group* mraa_gpiod_group_t;
|
||||
|
||||
Reference in New Issue
Block a user