Zephyr GPIO drivers require the pin mask `struct gpio_driver_data` to be
the first element of the driver config. Reordering fixes failures in ASSERT
statements of the GPIO driver due to the base address being interpreted as
supported pin mask.
Signed-off-by: Mika Braunschweig <mika.braunschweig@siemens.com>
- It seems that the mask variants of GPIO functions are not present in
the latest sdk, so replace those with direct register access.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
As the RP2350B has more than 32 GPIO pins,
we changed the configuration so that it is split into two ports.
To do this, we created a `raspberrypi,pico-gpio-port` node and
moved the previous `raspberrypi,pico-gpio-port` functions to it.
This became a child node of `raspberrypi,pico-gpio-port`, and
`raspberrypi,pico-gpio-port` will remain a gpio mapper.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Update the NEORV32 SoC, peripheral drivers, and board to support NEORV32
v1.11.1. Notable changes include:
- Optional RISC-V ISA Kconfigs are now selected on the board level.
- Peripheral registers are now automatically reset in hardware, no need for
software initialization code.
- The NEORV32 GPIO controller now supports 32 pins, not 64. Interrupt
support will be submitted in a separate PR.
- Default board configuration has 64k RAM and is clocked at 18 MHz.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The ADP5585_GPO_OUT_MODE_A is used when configuring initial output
during pin configuration, causing pins configured HIGH is incorrectly
configured as open-drain. Replacing the reg with ADP5585_GPO_DATA_OUT
fixes the issue.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Streamline code in multiple places as follows:
- Remove redundant initialization of `ret` to `0`,
as it is immediately assigned a value.
- Add `len` to store the result of `strlen(argv[ARGV_CONF])` to avoid
multiple calls to `strlen` within the `for-loop` in `cmd_gpio_conf`.
- Merge separate `shell_print` calls by including a newline `\n`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Use the first nodelabel rather than the node name when available for
shell completion as well as "gpio info". This label is always set gpio
nodes as that's what's used for references by device nodes, there may be
some case where a node has multiple labels for some reason but for a
human I reckon it still makes more sense to suggest a label rather than
the address.
This means that the commands would use, for example "gpioa" rather than
"gpio@58020000".
Fall back to the normal node name if there's no label set or if dt
metadata is not enabled.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The MAX14915 has eight high-side switches specified to deliver up to
700mA continuous current with simlar register map and diagnostics
parameters to MAX14916.
Documentation:
https://www.analog.com/en/products/max14915.html
Signed-off-by: Robert Budai <robert.budai@analog.com>
Add a check for interrupt configuration: if the interrupt line for the
pin is already enabled but for the same port that the user asked, it
should not return EBUSY.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Don't try to dereference line_names if the index is beyond
line_names_len, this can happen if there's less line names than the
total amount of supported gpios specified.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Move SHELL_DYNAMIC_CMD_CREATE after the function, then the forward
declaration is unnecessary.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add driver support for Versal Gen 2 PS/PMC GPIO controller by updating
the logic of bank index calculation.
This logic depends on "register" DT property to identify bank index
instead of depending on node instance ID as Versal Gen 2 GPIO banks
are not in sequential order as Zynqmp.
- Versal Gen 2 PS GPIO: Banks(0,3,4)
- Zynqmp PS GPIO: Banks(0,1,2,3,4,5)
Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
This driver includes pin-muxing functions and requires to have
CONFIG_PINCTRL enabled. Automatically set this config when this
driver is enabled.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
The current implementation requires SoCs/Boards to manualy instantiate
the preripherals and initilize them.
The change lets Zephyr rely on the device tree setup to instantiate &
initialize the relevant gpio peripheral.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Implement the `gpio_get_config`
N.b. adding this API results in a new test failure in
`test_gpio_config_trigger`. This suggests that there is some kind of
dependency between this and the now-enabled `pin_get_config` test cases.
Note that this adds a read-only API, it is unlikely to be the cause of
the failure.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Reorder gpio_rpi_configure to disable input buffers when not in use.
gpio_rpi_get_config can then determine whether a pin is configured as an
input without requiring additional state variables, as well as reducing
input leakage current.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
Out of reset the pads are input enabled, output disabled. Disconnect the
pad's input and output buffers, as well as any pullups. This can reduce
input leakage current.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
In the current implementation, when `gpio_ra_pin_interrupt_configure`
is executed, the existing settings made by `gpio_ra_pin_configure`
are erased.
A read-modify-write method will be used to preserve the settings.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The driver already read the speed flags (cfr. ospeed) and called
LL_GPIO_SetPinSpeed, but these flags could not be set yet.
Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
Added a build assert to limit num_pins to a maximum allowable value to
prevent potential out-of-bounds access or infinite loops.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
The PCA6416A is a 16-bit general purpose I/O expander that provides
remote I/O expansion for most microcontroller families via the I2C-bus
interface.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
If GPIO_DISCONNECTED is requested with gpio_pin_configure,
it will return -ENOTSUP since rpi_pico does not support it.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Fixes a multitude of Kconfigs that wrongly appear on devices
where support is literally impossible
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
properly check return code from i2c_reg_write_byte_dt effectively
making it possible for gpio_npm2100_port_set_masked_raw to error out since:
if (ret != 0U) {
return ret;
}
was dead code before this fix.
Fixes CID-444376
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Get build error when using a gpio port that has port_irq_names
property isn't defined. This commit aim to fix this bug.
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Initial commit for a STM32L152 based GPIO expansion chip.
The mfxstm32l152 driver offers GPIO controller fonctions.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>