| 396e1f07 | 18-Jun-2025 |
Patrick Delaunay <patrick.delaunay@foss.st.com> |
drivers: gpio: add new ops configure to initialize gpio
Add the new ops configure to initialize the GPIO resource based on dt_flags. This new ops is require to support the modification of dt_flag do
drivers: gpio: add new ops configure to initialize gpio
Add the new ops configure to initialize the GPIO resource based on dt_flags. This new ops is require to support the modification of dt_flag done by caller after gpio_dt_init_by_index() and before call of gpio_configure().
It is done by example in driver of regulator fixed and gpio.
The new ops is called only in gpio_dt_cfg_by_index() or in gpio_configure() so usage of one of this API is manadatory after this patch.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 39d1e320 | 06-May-2025 |
Patrick Delaunay <patrick.delaunay@foss.st.com> |
drivers: gpio: add configure functions
Align the OP-TEE GPIO driver with GPIO lib (devm_gpiod_get_index with enum gpiod_flags) and add a way to select the GPIO configuration directly during request
drivers: gpio: add configure functions
Align the OP-TEE GPIO driver with GPIO lib (devm_gpiod_get_index with enum gpiod_flags) and add a way to select the GPIO configuration directly during request with the new function, gpio_dt_cfg_by_index().
This patch remove assumption on GPIO direction (gpio input was assumed in GPIO driver) or output level when the GPIO is requested by consumer. with this patch it must be requested explicitly with: - GPIO_IN: configure the input GPIO - GPIO_ASIS: direction is managed by caller later with gpio_set_value() call. - GPIO_OUT_LOW / GPIO_OUT_HIGH: output GPIO at expected level, the sequence for GPIO have the correct order to avoid glitch by using the gpio function at the correct order.
This patch is a preliminary step for the introduction of ops configure. The API gpio_dt_get_by_index() is keep for backward compatibility but should be used with gpio_configure() or replaced by gpio_dt_cfg_by_index().
Now gpio_configure() is only used in the 2 drivers, regulator_fixed and regulator_gpio, because in these drivers the flags gpio->dt_flags are modified after call of gpio_dt_get_by_index().
For get_voltage_level_gpio(), GPIO_OUT_HIGH is used by default as it is done in Linux function of_get_gpio_regulator_config().
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|