| #
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 ...
|
| #
dc374be0 |
| 06-May-2025 |
Patrick Delaunay <patrick.delaunay@foss.st.com> |
drivers: regulator: simplify device tree parsing
Use gpio_dt_get_by_index() to get the properties in device tree with all the possible variant name: "gpio" and "gpios".
Signed-off-by: Patrick Delau
drivers: regulator: simplify device tree parsing
Use gpio_dt_get_by_index() to get the properties in device tree with all the possible variant name: "gpio" and "gpios".
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 ...
|
| #
d615a7e6 |
| 23-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: regulator: list voltages controlled by a GPIO
Implement .supported_voltages() operation in regulator_gpio.c driver to report voltage levels a level array that is required by scp-firmware vo
drivers: regulator: list voltages controlled by a GPIO
Implement .supported_voltages() operation in regulator_gpio.c driver to report voltage levels a level array that is required by scp-firmware voltage domain module when a regulator-gpio is exposed through an SCMI voltage domain. This change requires filed voltage_levels_uv[] array of struct regulator_gpio to be sorted in increasing level value.
Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
950549e4 |
| 24-Nov-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: regulator: fix getting GPIO for level control
Swap the 2 calls to find gpio property in "regulator-gpio" compatible node. The call that expects to get a TEE_ERROR_ITEM_NOT_FOUND return valu
drivers: regulator: fix getting GPIO for level control
Swap the 2 calls to find gpio property in "regulator-gpio" compatible node. The call that expects to get a TEE_ERROR_ITEM_NOT_FOUND return value (as described in the inline comment) for an unsupported 2nd level control GPIO can fail with TEE_ERROR_DEFER_DRIVER_INIT return value when the 1st GPIO phandle listed in the 'gpios' DT node property relates to a GPIO driver that is not yet probed. Fix that by first getting the required GPIO control level and then testing presence of other GPIO phandle in the 'gpios' DT property.
Fixes: f164f0f83420 ("drivers: regulator: GPIO controlled regulator") Reviewed-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
f164f0f8 |
| 11-Sep-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
drivers: regulator: GPIO controlled regulator
Implements a GPIO controlled regulators driver compliant with DT nodes compatible with regulator-gpio. These regulators use GPIO pins to select the volt
drivers: regulator: GPIO controlled regulator
Implements a GPIO controlled regulators driver compliant with DT nodes compatible with regulator-gpio. These regulators use GPIO pins to select the voltage level. The implementation supports only dual voltage level selection using a single pin. The DT bindings allows more pins to select between more voltages but no known platform currently requires that so we preferred the simplified case.
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|