Commit graph

23353 commits

Author SHA1 Message Date
Jun Lin
e555f20462 driver: bbram: npcx: fix the way to clear bbram status
Bits in the BBRAM status register (BKUP_STS) are write-1-to-clear bits.
The current driver writes 0 to clear those bits, which is incorrect.
Fix it in this commit.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-06-21 10:07:41 +02:00
Joakim Andersson
901a8f7efb drivers: pinctrl_nrf: : Allow applying pins of disabled peripherals
According to the nrfx peripheral resource sharing example in
samples/boards/nrf/nrfx_prs it should be possible to share a resource
and apply the pins on peripheral that share resource ID.
However the sample only works since it only demonstrates UART and SPIM,
and by enabling both another SPIM driver, and UART is enabled for the
console. It would not be possible to enable a TWIM driver in addition.
Instead allow the PSELs if the configuration for NRFX has been enabled.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-06-20 12:09:24 -04:00
Mark Wang
e2ec54bb9d drivers: udc: mcux: remove CONFIG_DT_HAS_NXP_USBPHY_ENABLED
remove CONFIG_DT_HAS_NXP_USBPHY_ENABLED to make codes more simple

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-06-20 12:07:07 -04:00
Maximilian Deubel
71c4526ab3 drivers: sensor: bmm150: Fix setting of attributes
Some functions in the bmm150 driver were depending on a define
that was never used. Changed it to the one that is actually defined.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-06-20 12:05:23 -04:00
Luis Ubieda
7cda467cc1 sensor: vcnl36825t: Scrub redundant scaling on meas_timeout_us
Confirming the Proximity Integration is an integer, we don't need to
pre-apply the Scaling factor to then be accounted for when the actual
meas_timeout_us is calculated.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-20 12:05:07 -04:00
Luis Ubieda
51ad3d34bd sensor: vcnl36825t: fix: Address CID 347083
Coverity found this legitimate issue: the datasheet specifies PS_IT
being 2-bits long (1, 2, 4, 8) and this driver assumes more steps are
available. Remove extraneous fields so the Proximity integration
setting fits in the expected 16-bit value.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-20 12:05:07 -04:00
Piotr Kosycarz
4d01353640 drivers: serial: fix cfg.baudrate may be used uninitialized
drivers/serial/uart_async_to_irq.c: In function 'get_rx_timeout':
drivers/serial/uart_async_to_irq.c:51:26:
warning: 'cfg.baudrate' may be used uninitialized
   51 |                 baudrate = cfg.baudrate;
      |                 ~~~~~~~~~^~~~~~~~~~~~~~
drivers/serial/uart_async_to_irq.c:45:28: note: 'cfg' declared here
   45 |         struct uart_config cfg;

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-20 12:04:02 -04:00
TOKITA Hiroshi
daa3bb1d55 drivers: interrupt_controller: renesas_ra: Enable GEN_ISR_TABLES explicitly
Renesas RA ICU driver requires to generate ISR tables.
Adding `select GEN_ISR_TABLES` to force enable it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-06-20 12:57:54 +02:00
Hake Huang
ef62bba336 driver: i3c: fixing i3c init error
i3c config need has i2x/i3c baudrate configured first.
so in i3c init we shall set the baudrate first

fixing: #65153

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-06-20 12:48:36 +02:00
Andy Sinclair
7f0f0a4f97 drivers: gpio: shell: Fixed gpio info crash bug
When getting gpio info for a specific device with no line
names, invalid memory was accessed.
The check for the length of the line name array has been
corrected to avoid this.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2024-06-20 08:59:49 +02:00
Seppo Ingalsuo
1198c7ec29 Drivers: DAI: Intel: Move ACE DMIC start reset clear to earlier
The unreset of ACE PDM controllers is moved to beginning of
void dai_dmic_start() and done side-by-side. This change is done
for adhering to recommended hardware initialization flow to
avoid intermittent failures on ARL-S.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-20 08:59:20 +02:00
Seppo Ingalsuo
78920e839e Drivers: DAI: Intel: Reduce traces dai_dmic_start()
This patch removes the traces printed inside spinlock protected
code. The DMIC capture start code is timing critical. Traces
leave an unknown delay into start sequence, so it's better to not
produce them.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-20 08:59:20 +02:00
Seppo Ingalsuo
9db580357b Drivers: DAI: Intel: Remove trace from dai_dmic_update_bits()
The dai_dmic_update_bits() function is used in start trigger
code dai_dmic_start() and in capture runtime to control DMIC
IP in unmute sequence. Especially the start sequence is timing
critical so it's better not produce additional delay in this
function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-20 08:59:20 +02:00
Jerzy Kasenberg
1464209173 drivers: usb_device: smartbond: Fix EP OUT after resume
When device was resumed from sleep OUT endpoints were most
likely not enabled due to condition that checked pending transfer.
Configured OUT endpoints should be enabled (ready for RX)
if they were enabled by interfaces.

Now separate bit field enabled is added and check to
see if OUT endpoint should be ready for reception after
sleep is done.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
a953bdf309 drivers: usb_device: smartbond: Delay message USB_DC_EP_DATA_OUT
Callback with USB_DC_EP_DATA_OUT was called directly from
interrupt handler (handle_ep0_rx()) while rest of the interrupt
conditions were not checked yet.
Some interfaces started next transfer directly from this callback
resulting in case where TX endpoint was still marked as busy
and transfer was eventually abandoned.

Now message is sent from all affected endpoints after every USB
pending interrupt is handled.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
f456852510 drivers: usb_device: smartbond: Fix unnecessary flush
Switching from write to read on EP0 is done when data is
transmitted.
Additionally receiver is enabled when NAK is created in
response to OUT token. This may happen when host sent
ZLP before everything was transmitted.
This case flushed receiver FIFO which could lead to
setup packet corruption.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
18a7603560 drivers: usb_device: smartbond: Add power management
Add support for automatic control of PLL for USB subsystem.

This utilized virtual USB clock present in clock control.
USB driver enables PLL when device is attached or USB
sends resume signaling.

PLL can be turned off (if application does not requested it)
when device is detached (application request)
or USB host sends suspend request.

When VBUS is not present or application did not started USB yet
PD_DOMAIN_SYS is also not acquired that allows for deep
sleep. When USB is active deep sleep will never be activated.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
16c0cecbf6 drivers: usb_device: smartbond: Fix reenable of EP0
When EP0 was disabled EP0 was setup to ignore setup and
out packets.
In usb_dc_ep_enable() function mask was never cleared.
It resulted in USB stop functioning after application
disabled endpoint (usb_disable()) and then tried
to enable usb again.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
0f167af30f drivers: usb_device: smartbond: Fix VBUS interrupt enable
Code was enabling USB_IRQn twice. One of the calls clearly
should be enabling VBUS_IRQn.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Jerzy Kasenberg
207195dfe8 drivers: clock_control: smartbond: Add USB clock
Smartbodn does not have dedicated USB clock.
For USB to work PLL needs to be turned on.
To allow for flexible configuration artificial USB clock
is added that can be operated via clock_control subsystem.
This new clock turns on PLL when USB subsystem is enabled.
PLL can also be request in DT if application requires
more speed.

PLL can be automatically turned off when USB enters suspend
state and application did not requested it.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-06-19 13:44:32 -04:00
Mateusz Karlic
631248449a drivers: intc_gic: Return GICC_IAR without mask
The documentation recommends to read and then write-back the entire
register, when ending interrupts.

Signed-off-by: Mateusz Karlic <mkarlic@antmicro.com>
2024-06-19 13:43:06 -04:00
Jakub Topic
4fe32e1f4a drivers: rtc: rv3028: fix RTC time mask
Correct the RTC time mask to validate all supported fields.

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
2024-06-19 13:22:29 -04:00
Jakub Topic
2feeeefbe7 drivers: rtc: pcf8563: check if the node has an interrupt pin
Verify if the int1_gpios property exists for the specific node.

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
2024-06-19 13:22:29 -04:00
Jakub Topic
fdd7f524b9 drivers: rtc: pcf8563: validate time
Validate the contents of `struct rtc_time` against the provided mask
when setting time or alarm.

Use the same names of function parameters as those in the RTC Interface.

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
2024-06-19 13:22:29 -04:00
Dominik Ermel
97a97c744a drivers/flash: Fix typos and incorrect description
Fixing typos.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-19 09:34:19 +02:00
Dominik Ermel
33f8039d95 drivers/flash: Fix flash_fill write chunk calculation
Fix incorrect last chunk calculation.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-19 09:34:19 +02:00
Swift Tian
5d24b6d37d drivers: fix Kconfig.mspi for issue #74349
Fix the Kconfig.mspi under flash and memc so that it don't litter.

Signed-off-by: Swift Tian <swift-tian@qq.com>
2024-06-18 19:55:35 -04:00
Tom Burdick
694428947a sensors: Fix shell missing channel types
The shell tries to decode all channel types and sequential channel
indexes. Unfortunately when swapping to channel specs we forgot to reset
the channel index for the next channel type to look at.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-18 14:55:27 -04:00
Ioannis Damigos
27c14042bd i2c_smartbond: Introcude TX_FIFO_DEPTH macro
Introcude TX_FIFO_DEPTH macro to avoid "magic"
numbers.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-18 14:36:38 -04:00
Ioannis Damigos
d9ad8c9c99 i2c_smartbond: Fix spin locking
Fix spin locking

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-18 14:36:38 -04:00
Ioannis Damigos
c7da55ef2c spi_smartbond: check that DMA controllers were provided
Check that DMA controllers were provided in
spi_smartbond_dma_deconfig()

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-18 14:36:38 -04:00
Ioannis Damigos
0a0bccabd8 drivers/smartbond: Fix PM device runtime support
Removed PM device runtime support from drivers in PD_SYS domain.

Update the rest device drivers to call pm_device_runtime_get/put()
functions when CONFIG_PM_DEVICE_RUNTIME is enabled.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-18 14:36:38 -04:00
Yong Cong Sin
c9d08fc876 driver: ieee802154: remove deprecated Kconfigs
The following Kconfigs have been deprecated for more than 2
releases, remove them:

- `IEEE802154_CC13XX_CC26XX_SUB_GHZ_RADIO_TX_RETRIES`
- `CONFIG_IEEE802154_2015`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
abbd19c393 drivers: interrupt controller: update GIC Kconfigs
Selection of these GIC Kconfigs have been deprecated
for more than 2 releases, users should use the devicetree
method instead, update the Kconfigs.

The SOCs below have been updated to not select `GIC_V3`, since
their devicetree already have the required compatible:
- fvp_aemv8r
- rzt2m
- rk3658

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
3e4a9b9ec7 drivers: ethernet: stm32: remove deprecated MAC address Kconfigs
The following Kconfigs:

- `CONFIG_ETH_STM32_HAL_RANDOM_MAC`
- `CONFIG_ETH_STM32_HAL_USER_STATIC_MAC`
- `CONFIG_ETH_STM32_HAL_MAC3`
- `CONFIG_ETH_STM32_HAL_MAC4`
- `CONFIG_ETH_STM32_HAL_MAC5`

have been deprecated for more than 2 releases, user should
have switched to the devicetree method now, remove them.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
2585595bca drivers: eeprom: remove CONFIG_EMUL_EEPROM_AT2X
`CONFIG_EMUL_EEPROM_AT2X` has been deprecated for more than 2
releases, remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Yong Cong Sin
88c96f7986 drivers: counter: stm32: remove deprecated clock source Kconfigs
These clock selection Kconfigs should have been deprecated for
more than 2 releases, remove them:

- `CONFIG_COUNTER_RTC_STM32_CLOCK_SRC`
- `CONFIG_COUNTER_RTC_STM32_CLOCK_LSI`
- `CONFIG_COUNTER_RTC_STM32_CLOCK_LSE`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Nazar Palamar
f41cb40a6e drivers: wifi/airoc: update airoc_wifi_host_buffer_get
Update airoc_wifi_host_buffer_get function to set final
buff size based on input “size” param.

Update airoc_mgmt_send to use airoc_wifi_host_buffer_get
instead net_buf_alloc_len.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-06-18 15:55:19 +02:00
Jiafei Pan
f985e75ba1 drivers: eth_nxp_enet: fix MMIO mapping issue
Fixed #74370, the issue is caused by the update to introduce MMIO
mapping, after MMIO mapping, should use data->base for device
base memory address.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-06-18 15:52:21 +02:00
Gerson Fernando Budke
0561d74d31 drivers: counter: sam: Add qdec as tc special mode
The current atmel,sam-tc-qdec sensor implementation shared the timer
counter node. This create issues when users wants define both modes.
The current proposal changes the qdec dedinition to be a child of
tc and refactor all the chain of definitions.

Fixes #71312

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-06-17 17:47:42 -04:00
Pisit Sawangvonganan
ebb75b38dd drivers: ethernet: stm32: replace reverse with intrinsic __RBIT
Replaced the software `reverse` function, used for bit reversal, with
the intrinsic `__RBIT` function.

This utilizes the hardware bit-reversal instruction for improved
efficiency.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-06-17 17:46:29 -04:00
Aksel Skauge Mellbye
4f712fffe0 drivers: pinctrl: gecko: Fix Series 1 I2C SCL route location config
Implementation erroneously used a mask from the ROUTEPEN register
when writing the ROUTELOC register.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-06-17 12:10:11 -04:00
Aksel Skauge Mellbye
35d95f934c drivers: pinctrl: gecko: Fix Series 2 I2C location config
Series 2 uses DBUS for alternate function control, which directly uses
port and pin numbers for location selection. Configure pinout as part
of the I2C_SDA/I2C_SCL case, rather than the separate _LOC case,
as the port and pin are not available at this point.

Configure route register prior to enabling the route, to ensure that
the wrong pin is not temporarily claimed.

Fixes an issue where DBUS was always configured to port A and
pin given by the GECKO_LOC() macro, rather than the correct port/pin
pair.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-06-17 12:10:11 -04:00
Jakub Topic
7efd885bd7 drivers: rtc: update alarm_set_callback to return ENOTSUP
This commit addresses the issue related to the rtc.h API returning ENOSYS
for a driver not implementing alarm_set_callback when the ALARM
functionality is enabled but interrupts, and thus alarm callbacks, are not
supported by the current configuration.

The following drivers have been modified to return correct code:
- rtc_pcf8523
- rtc_pcf8563
- rtc_rv3028

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
2024-06-17 12:09:15 -04:00
Andriy Gelman
d2607f0911 drivers: can: mcp251xfd: Use macro to set TDCO
Use CAN_CALC_TDCO() macro to set TDCO. There is a minor change how the
tdco is calculated. In the macro the SYNC segement is taken into
account while it wasn't used before.

Fixes #73821.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-06-17 12:08:08 -04:00
Chris Friedt
12cc7bbd8a net: sockets: use z_finalize_typed_fd() to identify as sockets
Fill-in the mode field of the fd_entry so that the
implementation can be made aware that the specific file
descriptors created are sockets.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-15 07:47:12 -04:00
Tomasz Moń
e1b95eb6df drivers: udc_dwc2: Initial Buffer DMA support
Implement absolute minimum necessary to get Buffer DMA working. Require
Data Cache to be disabled if DWC2 OTG has DMA enabled because the stack
does not currently guarantee cache line alignment for allocated buffers.

Set EPENA bit before disabling IN endpoints because it seems to be
necessary in Buffer DMA mode (without EPENA the wait for INEPNAKEFF does
time out). Setting EPENA should have no impact on Completer mode
operation (where EPENA is not necessary for INEPNAKEFF to trigger).

Programming Guide recommends programming SUPCnt to 3, but the only
advantage would be to be able to tell how many back-to-back SETUP packets
were received if there was no more than 3 back-to-back SETUPs. This
information doesn't seem to be useful. The disadvantage is that the
buffer needed for receiving SETUP packet must be able to hold SUPCnt
multiple of 8 bytes. Use SUPCnt 1 so the 8 bytes buffer is enough.

Make sure to clear StsPhseRcvd interrupt bit in Buffer DMA mode because
the DMA seems to prevent the SETUP Phase Done interrupt from triggering
if StsPhseRcvd is set. Clearing this bit doesn't seem to be necessary in
Completer mode. This bit is set on control transfers with data stage
from host to device.

Both Buffer DMA and Completer mode operation on nRF54H20DK was verified
using USB2CV Chapter 9 Tests and MSC Tests with Mass Storage sample.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-15 07:43:45 -04:00
Tomasz Moń
59702c7633 drivers: udc_dwc2: Avoid unnecessary register accesses
Do not use sys_clear_bits() followed by sys_set_bits() on DCTL register
to avoid writing to DCTL register twice - first with zeroed out address,
and then with the new address. Change the code to write the address in
one DCTL register write.

Do not use sys_set_bits() to set test mode, but rather prepare the
correct value first.

Set DCFG and GUSBCFG registers in one go. There is no point in reading
back the value or doing multiple subsequent writes to these registers.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-15 07:43:45 -04:00
Tomasz Moń
2c9371ea45 drivers: udc_dwc2: Add DMA register bit defines
Add register bit defines for registers needed for DMA operation.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-15 07:43:45 -04:00
Robert Hancock
680fa154bf drivers: spi_xlnx_axi_quadspi: Reduce IRQ work
This driver could end up doing a great deal of work inside the ISR when
large SPI transfers were in use, which could cause significant IRQ
latency. For the normal, non-async SPI transfer case, use events to
signal the calling thread to complete the work rather than performing
FIFO transfers inside the ISR.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-06-15 05:15:46 -04:00