History log of /optee_os/core/include/drivers/gpio.h (Results 1 – 10 of 10)
Revision Date Author Comments
# 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 ...


# a37f67ed 06-May-2025 Patrick Delaunay <patrick.delaunay@foss.st.com>

drivers: gpio: support gpio suffix in device tree

Align the OP-TEE GPIO driver on the Linux GPIO lib behavior for the gpio
properties in device tree: search "gpios" or "gpio" when gpio_name is
omit

drivers: gpio: support gpio suffix in device tree

Align the OP-TEE GPIO driver on the Linux GPIO lib behavior for the gpio
properties in device tree: search "gpios" or "gpio" when gpio_name is
omitted and "foo-gpios" or "foo-gpio" when and if the gpio_name="foo".

This patch allows use of the function gpio_dt_get_by_index()
by GPIO consumers for all supported bindings.

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 ...


# d50fee03 16-Oct-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: prefix header file guard names with __

Improves header files guard names consistency by using a __ prefix
where missing.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by:

core: prefix header file guard names with __

Improves header files guard names consistency by using a __ prefix
where missing.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# b357d34f 06-Jun-2023 Etienne Carriere <etienne.carriere@foss.st.com>

core: dt_driver: swap TEE_result and retrieved device reference

Changes dt_driver callback function to return a TEE_Result value
and pass retrieved device reference by a output argument rather
than

core: dt_driver: swap TEE_result and retrieved device reference

Changes dt_driver callback function to return a TEE_Result value
and pass retrieved device reference by a output argument rather
than the opposite.

This change updates dt_driver.c, dt_driver.h and all drivers
implementing related dt_driver callback function.

As a consequence, this change removes all type definition related
to device specific callback handler function types which are useless
as all these now comply with type dt_driver_probe_func defined in
dt_driver.h.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>

show more ...


# 8fd620f7 22-May-2023 Etienne Carriere <etienne.carriere@linaro.org>

core: rename dt_driver_phandle_args to dt_pargs

Renames struct dt_driver_phandle_args to struct dt_pargs to
shorten the label and prevent ugly line breaks in function
signatures.

Acked-by: Jens Wik

core: rename dt_driver_phandle_args to dt_pargs

Renames struct dt_driver_phandle_args to struct dt_pargs to
shorten the label and prevent ugly line breaks in function
signatures.

Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 24b364c8 26-May-2023 Etienne Carriere <etienne.carriere@linaro.org>

drivers: gpio: add operation inline description

Adds few inline description comment to GPIO operators.

Acked-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Etienne Carriere <etienne.c

drivers: gpio: add operation inline description

Adds few inline description comment to GPIO operators.

Acked-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 83f24981 26-May-2023 Etienne Carriere <etienne.carriere@linaro.org>

drivers: gpio: add put operation handle

Adds a put operation handler for a GPIO consumer driver to be able
to release the GPIO resources it has allocated when getting its
GPIO. This is needed for ex

drivers: gpio: add put operation handle

Adds a put operation handler for a GPIO consumer driver to be able
to release the GPIO resources it has allocated when getting its
GPIO. This is needed for example, when such a consumer driver must defer
its probe sequence and will get again its GPIO making gpio_dt_alloc_pin()
to be called again.

Acked-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 4fc179b6 11-May-2023 Thomas Perrot <thomas.perrot@bootlin.com>

drivers: gpio: add device-tree based gpio controller framework

Build a small gpio framework based on the device-tree infrastructure and
on top of the existing gpio.h content. This framework allows t

drivers: gpio: add device-tree based gpio controller framework

Build a small gpio framework based on the device-tree infrastructure and
on top of the existing gpio.h content. This framework allows to register
gpio controllers and to retrieve gpio struct based on a "<name>-gpios"
properties.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...


# 6dcd18c8 05-Jan-2023 Clément Léger <clement.leger@bootlin.com>

drivers: move gpio.h include to drivers/

GPIOs are typically handled by drivers and this will be modified to add
device-tree support.

Also rename "ena_dis" with "enable_disable" because more explic

drivers: move gpio.h include to drivers/

GPIOs are typically handled by drivers and this will be modified to add
device-tree support.

Also rename "ena_dis" with "enable_disable" because more explicit.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

show more ...