summaryrefslogtreecommitdiff
path: root/include/sbi_utils/gpio
AgeCommit message (Collapse)Author
2024-11-28lib: utils/gpio: Use fdt_driver for initializationSamuel Holland
FDT gpio drivers have an extra .xlate operation, so they need to embed the `struct fdt_driver` inside the subsystem-specific type. The gpio subsystem always initializes the driver for a specific DT node. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-11-05lib: utils/gpio: Use FDT node offset as GPIO chip IDSamuel Holland
Since the FDT is not modified during driver initialization, node offsets are just as suitable as phandles for use as identifiers: they are stable and unique. With this change, it is no longer necessary to pass the phandle to the driver init functions, so these init functions now use the same prototype as other kinds of drivers. This matches what is already done for I2C adapters. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-24lib: utils/gpio: Constify FDT pointers in parsing functionsSamuel Holland
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-05-13lib: utils/gpio: Generate FDT gpio driver list at compile-timeAnup Patel
Instead of having FDT gpio driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2021-11-03lib: utils/gpio: use list for driversNikita Shubin
Convert static array to sbi_list. This removes size limitation, makes add/remove more efficient and saves space. Signed-off-by: Nikita Shubin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-07-17lib: utils/gpio: Add simple FDT based GPIO frameworkAnup Patel
We add a simple FDT based GPIO framework which is built on top of generic GPIO library. The phandle of FDT GPIO chip DT node is treated as unique GPIO chip ID required by the generic GPIO library. The FDT based GPIO chip drivers will be probed on-demand from fdt_gpio_pin_get() called by the GPIO client drivers. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2021-07-17lib: utils/gpio: Add generic GPIO configuration libraryAnup Patel
We add generic GPIO configuration library which is independent of hardware description format (FDT or ACPI). The OpenSBI platform support or GPIO drivers can register GPIO chip instances which can be discovered and used by different GPIO clients. Each GPIO chip instance has a unique ID which can be used by GPIO clients to lookup GPIO chip instance. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>