Commit graph

23353 commits

Author SHA1 Message Date
Joakim Andersson
04e56f72c7 drivers: flash: Fix stm32 ospi and xpsi reset gpios handling
Fix compilation error when reset-gpios is enabled.
Undefined reference to dev_cfg variable.
Reset gpio duration needs to be defined, but is not in binding file.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-06-12 12:51:06 -04:00
Nazar Palamar
c0be06be02 soc: psoc6: fix build error when CONFIG_UART_INTERRUPT_DRIVEN
Fix build error when CONFIG_UART_INTERRUPT_DRIVEN is enabled
see details: issues/74004

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-12 12:50:28 -04:00
Martí Bolívar
48a14dc17e gpio: add support for node label based lookup in the shell
Use some new kernel features to make the experience of finding and
dealing with GPIO devices much more ergonomic by allowing the use of
devicetree node labels to identify GPIO devices by default.

Users who wish to avoid the associated footprint penalty can set
CONFIG_DEVICE_DT_METADATA=n by hand, but I think the convenience is
worth the price as a default. If we're running a shell, then we've
already paid a heavy footprint penalty.

Example output for qemu_cortex_m3:

    uart:~$ gpio devices
    Device           Other names
    gpio@40004000    gpio0
    gpio@40005000    gpio1
    gpio@40006000    gpio2
    gpio@40007000    gpio3
    gpio@40024000    gpio4
    gpio@40025000    gpio5
    gpio@40026000    gpio6

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2024-06-12 18:49:54 +02:00
Tomasz Moń
fb27c36ad5 drivers: udc_dwc2: Fix control OUT buffer leak
Release buffer allocated in dwc2_ctrl_feed_dout() on endpoint deactivate
to prevent the buffer from leaking on USB stack disable.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-12 12:48:45 -04:00
Pisit Sawangvonganan
9a0283d5e2 drivers: gnss: make gnss_xxx_config and gnss_driver_api as const
This change marks each instance of the `gnss_xxx_config` and
`gnss_driver_api` as `const`.

By using `const`, we ensure immutability, leading to usage of only
`.rodata` and a reduction in the `.data` area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-12 12:47:34 -04:00
Francois Ramu
29afef1e7d drivers: i2c: stm32 for V2 driver get_config with timings
Change the get_config API for the stm32 I2C V2 driver.
It will also return the value of the content of TIMING register
for the I2C V2 bus.
This is hold by a i2c_config_timing structure of the device data

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-12 14:35:48 +03:00
Francois Ramu
e5048c0c6d drivers: i2c: stm32 I2C v2 driver fix compliance with a Macro
Define Macro to fix the compliance check warning :
"DEEP_INDENTATION: Too many leading tabs - consider code refactoring
in the i2c_compute_scll_sclh() function
in the i2c_compute_presc_scldel_sdadel() function

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-12 14:35:48 +03:00
Francois Ramu
3aea45053c drivers: i2c: stm32 driver V2 new timing calculation
This PR is implementing a new formula to calculate the I2C timing
value from the I2C clock source and the bit rate.
This is done under flag CONFIG_I2C_STM32_V2_TIMING.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-12 14:35:48 +03:00
Ren Chen
1264a9a163 usb: it82xx2: return the available data length in the ep read function
According to the Zephyr documentation, the number of bytes available
for read should be returned if the input data and length parameters are
NULL and zero, respectively. This commit corrects this behavior.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-06-12 14:29:42 +03:00
Ren Chen
d9099efc02 usb: it82xx2: lock irq when accessing fifo ctrl register and ready bit
Since the fifo control register and ready bit are checked in ISR
function, this commit locks IRQ when accessing these registers to
prevent racing conditions.

Tested with: Google spikyrock project

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-06-12 14:29:42 +03:00
Ren Chen
4fa5cb8dfc usb: it82xx2: fix some issues related to extended endpoint enablement
This commit addresses some issues during the extended endpoint(ep
number is larger than 4) access. There are enable and ready bits for
each endpoint on the IT82xx2 chip. The transaction completion should be
determined by the ready and enable bits of the corresponding endpoint.
Additioinally, for non-control endpoint, the FIFO control register is
selected before writing data and cleared when the IN transaction is
completed. When an IN token interrupts, the FIFO control register
should be checked if it's selected to prevent fake tokens.

Tested with: Google spikyrock project

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-06-12 14:29:42 +03:00
Ren Chen
21c4c169ab usb: it82xx2: remove the unnecessary explicit conversion
This change cleans up the unnecessary explicit conversion.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-06-12 14:29:42 +03:00
Abderrahmane Jarmouni
533ade504d drivers: spi: stm32: minor fixes
Minor fixes & code improvements.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-12 14:28:35 +03:00
Adam Berlinger
a427f42772 drivers: clock_control: clock_stm32_ll_u5 add get_status API callback
Adds get_status API for clock_stm32_ll_u5 driver

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-06-12 14:22:13 +03:00
Tomasz Moń
fa0a6e2274 drivers: udc_dwc2: Allocate at least 8 bytes for control OUT
Make sure to feed control OUT endpoint with at least 8 bytes buffer to
make it possible to always receive SETUP data. This solves the assertion
failure in net_buf_add() called inside dwc2_handle_evt_setup() when a
host decides to start new control transfer immediately after it has
issued control transfer with Data Stage from host to device with wLength
less than 8.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-12 14:21:37 +03:00
Nazar Palamar
cc4e12e09b drivers: serial: Update Infineon CAT1 UART driver
Set RTS/CTS flow control pins as NC in cyhal
UART object so cyhal will skip to try initialize
those pins.

Initialization of RTS/CTS is done via
PINCNTRL driver.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-12 14:21:01 +03:00
Lauren Murphy
f9db6ed414 drivers: sensor: update bme280 to new async api
Updates BME280 driver to new async API.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-06-11 20:28:24 -05:00
Marek Matej
1b77d0f596 drivers: clock: esp32: fix ROM baudrate
Allow to update ROM Uart baudrate each time the
clocks are reconfigured.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-06-11 20:27:58 -05:00
Juliane Schulze
3c1590cbad drivers: tmag5273: fix documentation of tmag5273_check_device_status
Typos and invalid doxygen documentation.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-06-11 19:47:02 -04:00
Juliane Schulze
7ddbdb23df drivers: tmag5273: remove unneccessary check
If an immediate return on error is used, an additional result check in
sample_fetch can be neglected. Since they are now treated as errors,
also changed logging type.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-06-11 19:47:02 -04:00
Daniel DeGrasse
7277c85462 drivers: display: st7796s: remove unused gpio pins
Remove unused includes and gpio pins from st7796s driver, which were
leftover from before this driver used the MIPI DBI API class.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-11 19:46:21 -04:00
Jose Alberto Meza
f854b8b799 drivers: samples: espi: Adjust terms per eSPI specification 1.5
Replace CONFIG_ESPI_SLAVE by CONFIG_ESPI_TARGET
Replace CONFIG_ESPI_SAF by CONFIG_ESPI_TAF
Replace ESPI_BUS_SAF_NOTIFICATION with ESPI_TAF_BUS_NOTIFICATION in API

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2024-06-11 19:46:08 -04:00
Pisit Sawangvonganan
748367d118 drivers: gpio: stm32: clean up unnecessary code
Removed the unnecessary initialization of the `ret` variable in
`gpio_stm32_clock_request` where its value is guaranteed to be
overwritten by subsequent operations, then simply returned `ret`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-11 19:44:19 -04:00
Pisit Sawangvonganan
944305dc3a drivers: gpio: stm32: improve device instantiation macro
Introduced `GPIO_DEVICE_INIT_STM32_IF_OKAY` which utilizes `COND_CODE_1`
to reduce the chain of #if DT_NODE_HAS_STATUS(...) #endif

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-11 19:44:19 -04:00
Glenn Andrews
d5b653a805 Driver: Sensor: HTS221: Remove log message when trigger disabled
My students are using a disco_l475_iot1 board with HTS221 sensor.
When logging is enabled, the following log message is always emitted:
"HTS221: Cannot enable trigger without drdy-gpios"

This message is confusing to my students as they are not using the
HTS221 sensor in their projects. However since HTS221 is enabled in
the devicetree it gets initialized on boot and the log message
appears.

It doesn't seem necessary to tell people that they haven't enabled
CONFIG_HTS221_TRIGGER at log level INF. I'd be amenable to changing
this to LOG_DBG, but I don't think it needs to exist at all.

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-06-11 19:43:36 -04:00
Nick Ward
2576458dce drivers: led: shell: print color as string
Human readable.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2024-06-11 19:43:15 -04:00
Johan Hedberg
3ecd7dbd4c Bluetooth: drivers: Convert Silabs HCI driver to new API
Convert the slz_hci.c HCI driver to use the new HCI driver API. This also
fixes the HCI bus type to correctly indicate VIRTUAL instead of UART.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
fcddefd7f0 Bluetooth: drivers: Convert NXP HCI driver to new API
Convert the hci_nxp.c HCI driver to use the new HCI driver API. Also move
the driver binding under dts/bindings/bluetooth, like all other HCI driver
bindings.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
f33aab9889 Bluetooth: drivers: Convert DA1469X HCI driver to new API
Convert the Renesas DA1469X HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
501e7158a8 Bluetooth: drivers: Convert STM32 IPM driver to new API
Convert the ipm_stm32wb.c HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
b7b606bdaf Bluetooth: drivers: Convert ST STM32WBA driver to new API
Convert the hci_stm32wba.c driver to the new HCI API. Unlike in most cases,
the devicetree node is already enabled on the SoC level (rather than board
level). This is in order to mirror how the Kconfig option was originally
enabled, i.e. on the SoC level.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
5a09c17746 Bluetooth: drivers: Convert SPI drivers to use new HCI API
Convert the spi.c and hci_spi_st.c drivers to use the new HCI driver API.
Both drivers are converted in one go since one derives from the other's
devicetree binding.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
8953b4eb63 Bluetooth: drivers: Convert ESP32 HCI driver to new API
Convert the hci_esp32.c HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
e7637413b6 Bluetooth: drivers: Convert psoc6_bless driver to new API
Convert the hci_psoc6_bless.c HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
6e584a4773 Bluetooth: drivers: Convert IPC driver to new API
Convert the ipc.c HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
589b92baaf Bluetooth: Kconfig: Remove BT_NO_DRIVER
There are no actual users in the main tree anymore, so just remove this
option.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
130ae9e120 Bluetooth: drivers: Convert Ambiq Apollo driver to new API
Convert the Ambiq Apollo HCI driver to the new HCI API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
66b53866a7 Bluetooth: drivers: userchan: don't fail everything if driver init fails
With the new HCI driver model it's not always critical if a single
instance fails to initialize. This is especially true for many test
applications which provide their own HCI drivers. Instead of causing a
complete failure, simply fail to initialize the driver instance.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
bb91aa0b7f Bluetooth: drivers: Convert userchan driver to new API
Convert the HCI User Channel driver to use the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
97c3a1e4be Bluetooth: drivers: hci: Get rid of Kconfig choice
The drivers should be independent after the move to the new HCI driver
API. Having them as a choice also has unexpected consequences with some
drivers being unexpectedly enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
00d66339fc Bluetooth: drivers: h5: Convert to new HCI driver API
Convert the H:5 HCI driver to use the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
44e0f5fee3 Bluetooth: controller: Update to new HCI driver API
Update the native controller to the new HCI driver API. The devicetree
node is placed under existing `radio` nodes, which seemed like the most
intuitive option.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg
3482a3be53 Bluetooth: drivers: Convert H4 (UART) HCI driver to new API
Convert the H4 driver to the new HCI driver API. This includes updating
also any boards that use the driver, i.e. adding the appropriate
devicetree node and chosen property to them.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Thomas Stranger
34cac05775 drivers: sensor: sensirion: shtcx: remove chip property
Removes the dts "chip" property, the compatible should be used instead.

Any existing dts should be converted from something like:

test_i2c_shtc3: shtc3@70 {
	compatible = "sensirion,shtcx";
	reg = <0x70>;
	chip = "shtc3";
	measure-mode = "normal";
	clock-stretching;
};

to something like:

test_i2c_shtc3: shtc3@70 {
	compatible = "sensirion,shtc3", "sensirion,shtcx";
	reg = <0x70>;
	measure-mode = "normal";
	clock-stretching;
};

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-06-11 20:12:15 +03:00
Nick Ward
49d09ecb28 sensor: current_amp: fix fractional value
It needs to be x1000

Also correct the units used in the log

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2024-06-11 20:11:53 +03:00
Declan Snyder
45d3eb27b8 drivers: nxp_enet: Add fuse map address
Add functionality to use fused mac address

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-11 20:05:50 +03:00
Declan Snyder
f203a8b193 drivers: nxp_enet: Fix nxp,unique-mac
nxp,unique-mac actually is not meant to be universally
unique, the LAA bit should therefore be set, and fix the
description of the property in the binding to clarify
the intended usage of this property.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-11 20:05:50 +03:00
Ruben Völl
2c82681bec driver: uart: emul: Add support for async UART API
As it is up to a driver implementation if a partial filled buffer is
released, this behavior can be configured during runtime to allow testing
for this edge case.

Signed-off-by: Ruben Völl <ruben.voell@grandcentrix.net>
2024-06-11 20:05:24 +03:00
Ruben Völl
e5dd2376b3 drivers: uart: emul: Remove uart_emul_work struct
This structure is bad style and not needed. Instead get the surrounding
`struct uart_emul_data` with `CONTAINER_OF()` directly.

Signed-off-by: Ruben Völl <ruben.voell@grandcentrix.net>
2024-06-11 20:05:24 +03:00
Niek Ilmer
3bb95104e8 drivers: adc device: smartbond: Add power management
Add support for power management to the sdadc.

Signed-off-by: Niek Ilmer <niek.ilmer.aj@renesas.com>
2024-06-11 20:04:02 +03:00