Fix the build of the gpio driver BD8LB600FS on the
board intel_adl_crb.
Fixes#68219.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Use gpio_is_ready_dt in the driver for the TLE9104 before
actually using the GPIO.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
In some hardware designs it might happen that the reset signal
for the TLE9104 is not used only for this purpose, but instead for
instance to reset other devices at the same time. For such a hardware
design it is then necessary to make the reset GPIO optional. The reset
will have to be triggered earlier on.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
This implements the daisy chain feature of the low side switch
BD8LB600FS. The daisy chaining is in hardware achieved via
connecting the MISO and MOSI lines of multiple instances of the IC
in a row. It is implemented in the driver through a variable number
of GPIOs on one instance. Therefore, one device tree instance of the
IC will handle multiple daisy chained physical instances.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Fix a bug where after a standby, it was impossible to reenable a GPIO
clock.
A counter is incremented each time pm_device_runtime_get is called, and
decremented each time pm_device_runtime_put is called. The
clock is only enabled if this counter equals 1.
When configuring a GPIO (as input or output), the timer is incremented, and
when disconnecting it, it is both incremented and decremented. Thus the
next time we try to configuring it, the clock is not enabled (since the
counter will now be equal to 2).
This causes a problem when using low power standby mode: after wakeup all
clocks are disabled and the GPIO clock can not be reenabled.
This commit fixes this bug by not incrementing the counter when disconnect
is asked (or in other words incrementing it only when configuring either
an input or an output).
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
When set, this GPIO controller has pins associated with the
keyboard controller. In this case the reg_gpcr property is
overloaded and used to write the keyboard GCTRL register
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Remove gpio_clock_names and gpio_mcux_lpc_config->clock_ip_name from
drivers/gpio/gpio_mcux_lpc.c.
The drivers/gpio/gpio_mcux_lpc.c file did not compile with xt-clang
RI-2021.8-win32, as the gpio_clock_names was initialised with a
reference to a static const array. The clock_ip_name member was
initialised from this variable, but it isn't used anywhere else.
Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
Add RGPIO gpio driver. This driver is used for i.MX93 and i.MX8ULP.
GPIO pinctrl, read/write and interrupt is supported. Runtime mmio
configuration is enabled, so no need for region definition in
mimx9/mmu_region.c
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
Ignore communication faults of the TLE9104 which are reported
before the communication watchdog is configured.
Fixes#67370
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Driver is using the RISC-V PLIC interrupt controller without including
the necessary headers.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Employ a code spell checking tool to scan and correct spelling errors
in all files within the drivers/gpio directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Set suspended as initial power state, only when the
CONFIG_PM_DEVICE_RUNTIME config is enabled.
The initial state was incorrect, when CONFIG_PM_DEVICE=y and
CONFIG_PM_DEVICE_RUNTIME=n. In that case, the power state was SUSPENDED,
but the device was actually enabled.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Updated API version enables multi-instance GPIOTE driver.
Additionally obsolete symbol that was used to specify
API version in the past was removed.
Affected drivers have been adjusted and appropriate changes
in affected files have been made.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Check the return values from the I2C API functions called in init() and
fail driver initialization if unsuccessful.
Fixes: #66827
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Implement level based gpio interrupts, by using a worker queue to
repeatedly call the gpio callbacks until the gpio is no longer active.
Update unit test for new interrupts.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Use #if instead of IS_ENABLED for
CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN, otherwise DTS files
are required to provide gpiok and gpiol even if they are not used.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Similar to other ITE drivers, wrap register accesses in ECREG. This will
allow mocking out the registers in tests.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Generic Connector for the apollo4p_evb
Ran tests/drivers/gpio/gpio_basic_api
Ambiq does not support DUAL Edged Interrupts.
Added Connector Usages as defined by the Ambiq BSP.
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
The gpio_pca953x gpio driver doesn't have
the input latch and interrupt mask
configuration which causes a lack of accessing
and using those features on an gpio expander
device. Fix it by adding input latch and
interrupt mask configurations in this driver.
Signed-off-by: Vudang Thaihai <vudang.thaihai@brillpower.com>
Added a spinlock to accesses of registers and struct gpio_ite_data,
except for gpio_ite_isr() function.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
For the Ambiq Apollo4x soc, every 32 pins share the same IRQ
number. irq_disable() should not be called for the pin interrupt
disablement, otherwise the interrupt of pins in the same GPIO
group will be disabled as well.
Signed-off-by: Aaron Ye <aye@ambiq.com>
Use the "ambiq,gpio" binding to combine the "ambiq,gpio-bank"
child nodes for Apollo4 Plus soc.
Also update the GPIO driver accordingly.
Signed-off-by: Aaron Ye <aye@ambiq.com>
The wake-up control input is IT8XXX2_IRQ_WU66.
Testing the wake-up functionality on GPF6 is normal.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Renesas Gen4 SoCs GPIO IPs are using one more
register comparing to Gen3 SoCs.
The new "INEN" register is used to enable general input.
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Use gpio toggle api instead of manually toggling.
Remove redundant text.
Print error and break from blinking if it occurs.
Only print 'how to exit' text if first toggle is successful.
Saves roughly 40 bytes.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
Usage:
gpio info [device]
The new command prints gpio controller information
for a specific device if specified or if no device is specified
it prints out all controller information ordered by line name.
Also added Kconfig option so this command can be removed if
resources need to be conserved.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
This commit implements this enhancement:
https://github.com/zephyrproject-rtos/zephyr/issues/63018
The forms of the gpio commands are now:
gpio conf device pin ol0
gpio set device pin 1
gpio get device pin
gpio blink device pin
Device name and pin subcommands now are
suggested/completed when tab is used.
Pin names are suggested with numbers and line names if
available from the gpio controller’s Devicetree node.
GPIO pin command is now limited to pins that are not assigned
as reserved.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
Add Renesas rzt2m gpio driver with basic functionality.
It supports pin mode configuration and writing/reading to/from gpio ports.
Includes dts changes to build blinky sample.
Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
Add pinctrl to the Davinci GPIO driver to allow muxing pins dirctly
in this driver.
Also aligned the macro backslashes as line continuation character at
the end of each line with each at the same position and removed the
GPIO_DAVINCI_DEVICE_INIT macro which seems to be not used.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
If the gpio had pull previous enabled, but new config
request wants the pull disabled, the code was failing
to clear the previous pull setting.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add initial support for Renesas RA GPIO.
To avoid complicating the initial code for supporting the SoC,
I have implemented only the bare minimum for now.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
The multi-level encoding of the interrupt number currently
happens in the `gen_defines.py`, which is called in the
`dts.cmake` module after `kconfig.cmake`. However, the number
of bits used by each level is defined in Kconfig and this means
that `gen_defines.py` will not be able to get that information
during build.
To fix this, do the multi-level encoding in C devicetree macro
magic instead of the python script. This ticks one of a
long-standing TODO item from the `gen_defines.py`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Relocate multi-level interrupts APIs out of `irq.h` into
a new file named `irq_multilevel.h` to provide cleaner
separation between typical irq & multilevel ones.
Added preprocessor versions of `irq_to_level_x` as `IRQ_TO_Lx`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>