Commit graph

16846 commits

Author SHA1 Message Date
Gaetan Perrot 82cd7ad9b6 drivers: dac: sam: Add max value check
Add max size check to dac sam and sam0
There is no size check in dac_sam_write_value and dac_sam0_write_value.
Besides, the ret value should also be different.
Fixes #65021

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2023-12-28 12:08:27 +00:00
Andrei Emeltchenko fc8b53bf10 drivers: pcie: Read register before actual usage
Move reading PCIE_CONF_CMDSTAT before actual usage. There are four
return branches before value is used.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-28 12:07:30 +00:00
Andrei Emeltchenko 4a17446636 drivers: pcie: Remove magic number
Use definitions instead of magic numbers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-28 12:07:30 +00:00
Fabio Baltieri 4307882dd1 input: kbd_matrix: add actual key mask runtime control
Add an option to enable a input_kbd_matrix_actual_key_mask_set API to
enable or disable keys dynamically in the mask. This can be useful if
the exact key mask is determined in runtime and the device is using a
single firmware for multiple matrix configurations.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-27 16:50:21 +00:00
Pisit Sawangvonganan 250d50e8b6 drivers: rtc: set 'rtc_driver_api' as 'static const'
This change marks each instance of the 'rtc_driver_api' as 'static const'.
The rationale is that 'rtc_driver_api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static 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>
2023-12-27 16:12:06 +00:00
Jerzy Kasenberg 4e7950e4bd drivers: hwinfo: implemented hardware info support for Smartbond
Only reset cause is supported as there is no common unique id
present on those chips.
Unique ID can be put in OTP but there is no single specification for this.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-12-27 15:56:44 +00:00
Fabio Baltieri 66a06d955a input: use K_KERNEL_STACK_SIZEOF to set the thread stack size
Use K_KERNEL_STACK_SIZEOF instead of the config directly to set the
stack size in k_thread_create() calls.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-23 09:59:28 +00:00
Sylvio Alves f68fbd6984 driver: ble: esp32: implement deinit function
Current ESP32 BLE interface does not allow disabling
BLE. This PR adds proper deinit call.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-12-22 09:54:00 +01:00
Erwan Gouriou 3f61150d0a drivers: clock_control: stm32wba: set regu voltage after clk configuration
Call to set_regu_voltage() is required also after the clock configuration
has been performed.


Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-22 09:53:33 +01:00
Anisetti Avinash Krishna 53b717edd6 drivers: i2c: i2c_dw: update DMA node access in I2C dw
Update DMA node access from paren-node to dmas property in dts instance.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-22 09:52:59 +01:00
Anisetti Avinash Krishna a0ce427848 drivers: dma: intel_lpss: enable reload API for 32bit DMA address
Enable dma_reload API for DMA 32bit address transfer.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-22 09:52:59 +01:00
Anisetti Avinash Krishna 096635b212 drivers: dma: intel_lpss: update LPSS DMA init interface
Update LPSS DMA init interface which is common and
independent of parent-node.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-22 09:52:59 +01:00
TOKITA Hiroshi 32276bc2c1 drivers: clock_control: ra: fix initialization of the clock_hw_cycles
We should set the z_clock_hw_cycles_per_sec as the value of
the system clock frequency.

There was a mistake in referencing the clock source set before
initialization.
I corrected it to reflect the clock value after initialization.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-12-22 09:52:50 +01:00
Najumon B.A c146833fc8 drivers: pcie: fix for mmio size region calculation
I/O or memory decoding should be disabled via the command register
before sizing BAR for calculation MMIO size

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-12-22 09:52:40 +01:00
Henrik Brix Andersen 6d5d06689b drivers: can: native_linux: leave room for null termination of string
Only copy up to IFNAMSIZ - 1 number of characters of the interface name to
leave room for null termination of string.

Fixes: #66777

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-12-22 09:49:39 +01:00
Henrik Brix Andersen c067f4d263 drivers: can: native_linux: add missing return value check
Check return value from linux_socketcan_set_mode_fd() function call.

Fixes: #66798

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-12-22 09:49:39 +01:00
Manuel Aebischer 8cf199fb04 drivers: usb_dc_rpi_pico: previosuly used endpoint may remain locked
When reconfiguring a previously used endpoint, it may still be locked
when a write was taking place when e.g. the host application crashed.
The call to udc_rpi_cancel_endpoint seems to do a proper cleanup of
the endpoint, i.e. the write semaphore will be released.
Fixes #66723.

Signed-off-by: Manuel Aebischer <manuel.aebischer@netmodule.com>
2023-12-21 17:18:49 +00:00
Erwan Gouriou 098df08bbc drivers: bluetooth: stm32wba: Configure flash manager
Configure flash manager at BLE init.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-21 09:19:24 +01:00
Erwan Gouriou f6555aa95e drivers: flash: stm32wba: Use STM32WBA Flash manager for RF coexistence
When Bluetooth is enabled, it is required to arbitrate flash accesses
between RF and write accesses (for user activity).
A dedicated flash manager is provided as part of STM32WBA BLE lib.

Implement a dedicated driver using FM Apis to handle RF activity.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-21 09:19:24 +01:00
Erwan Gouriou 2908458554 soc: stm32wba: hci_if: Implement HW_RNG_EnableClock API
STM32WBA controller uses a PKA driver to perform cyphering operations
on keys. Since PKA hardware block requires RNG clock to be enabled, a
synchronization with zephyr RNG driver is needed.

Use RNG enable status to check if RNG could be switched off or needs to
be switched on.
Similarly in entropy driver, don't cut RNG clock if PKA is enabled.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-21 09:18:53 +01:00
Fabio Baltieri c0e6629b7b input: npcx_kbd: setup the interrupt to falling edge only
The driver works on active low signals only, change the interrupt
configuration to trigger on falling edges only.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-20 18:07:43 +00:00
Anisetti Avinash Krishna a6fda00254 drivers: spi: pw: Fix SPI Receive FIFO set
Fixes SPI Receive FIFO register set operation.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-20 11:58:56 +00:00
Ren Chen 5762d022dc drivers: usb: usb_dc_it82xx2: optimize the basic/extend endpoints control
This commit refactors the basic and extended endpoint control functions to
enhance readability.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen 40fa61213e drivers: usb: usb_dc_it81xx2: refactor transaction complete isr function
This commit refactor transaction complete callback function.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen 5846412167 drivers: usb: usb_dc_it82xx2: correct the extend endpoint control
There are some issues with the extended endpoint settings. The incorrect
setting leads to the chip being unable to respond with NAK when the host
polls the extended endpoint for data transfers. Additionally, the controls
for the extended endpoint's ISO and PID data sequence are also incorrect.
This commit addresses these issues to properly support extended endpoint
transactions.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen d6cc083c2c drivers: usb: usb_dc_it82xx2: usb driver cleanup
Cleans up the it82xx2 usb driver.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen 1c48b77ffa drivers: usb: usb_dc_it82xx2: remove unused code and debug msg
This change remove unused code and debug messages.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen 13788d4649 drivers: usb: usb_dc_it82xx2: correct the FIFO control
There are two registers that control the selection of one FIFO as data
buffer for 15 endpoints (ep1-ep15). Both registers should be configured
before sending and receiving data. Additionally, there was an issue with
the corresponding FIFO index setting in the 'usb_dc_ep_read_continue'
function, which has been addressed in this commit.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Ren Chen e23ae3b678 drivers: usb: usb_dc_it82xx2: refactor usb driver with macros
Refactor the code using macros to enhance readability.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2023-12-20 11:15:38 +01:00
Laurentiu Mihalcea 52deadd420 clock_control: imx_ccm: Add support for i.MX93's SAI clocks
This commit introduces support for querying
i.MX93's SAI clocks.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-12-20 11:15:13 +01:00
Laurentiu Mihalcea fe64d840cc drivers: dai: Add driver for NXP's SAI
This commit introduces a new DAI driver used for NXP'S SAI IP.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-12-20 11:15:13 +01:00
TOKITA Hiroshi 00d1cecedd driver: spi: spi_rpi_pico_pio: Change to use clock controller
Since clock_control has been introduced, use it to obtain the frequency.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi a34210d669 drivers: counter: rpi_pico: Turn on clock and reset device on init
Turning on clock via clock controller and
resetting PIO device via reset controller on initializing.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 8891f734ec drivers: usb: rpi_pico: Turn on clock on initializing
Turning on clock via clock controller on initializing.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 4e36854148 drivers: misc: pio_rpi_pico: Turn on clock and reset device on init
Turning on clock via clock controller and
resetting PIO device via reset controller on initializing.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 90976db5a3 drivers: adc: rpi_pico: Turn on clock and reset device on init
Turning on clock via clock controller and
resetting ADC device via reset controller on initializing.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 6ad894eb99 drivers: pwm: rpi_pico: Reset device on init
Resetting PWM device via reset controller on initializing.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi e905483bd0 driver: pwm: rpi_pico: Change to use clock controller
Since clock_control has been introduced, use it to obtain the frequency.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 57641875c3 drivers: spi: pl022: Reset device on initializing
Reset the device on initializing via reset controller.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Andrei-Edward Popa c448866042 drivers: spi: Changed how to get clock frequency for PL022
Changed how to get clock frequency for PL022

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Andrei-Edward Popa 0f41a2da1c drivers: serial: Removed all function calls from Raspberry Pi Pico SDK
Removed all function calls from Raspberry Pi Pico SDK
Added functions for setting uart baudrate and format

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Andrei-Edward Popa 5f927cfc3b drivers: watchdog: Changed how to get xtal frequency for Raspberry Pi Pico
Changed how to get xtal frequency for Raspberry Pi Pico

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
TOKITA Hiroshi 99a9b995d3 drivers: clock_control: rpi_pico: Configure GPOUT/GPIN pins
Configure GPOUT/GPIN pin for external clock in/out via GPIO.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Andrei-Edward Popa ea1cafbee7 drivers: clock_control: Added clock driver for Raspberry Pi Pico
Added clock driver for Raspberry Pi Pico platform

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-12-20 11:14:24 +01:00
Francois Ramu 6e678e3bae drivers: usb stm32H5 and stm32U5 have an independent power supply
The stm32H5 mcu has an independent USB supply to be enabled
at init with LL_PWR_EnableVDDUSB function like the stm32U5 serie.
Both series have PWR_USBSCR_USB33SV bit in their USBSCR POWER reg.
and other series all have PWR_CR2_USV bit in their CR2 POWER reg.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-12-19 22:53:26 +00:00
Jordan Yates 60a9f33f37 drivers: flash: spi_nor: boot into DPD
Boot into the deep power down state when `SPI_NOR_IDLE_IN_DPD` is not
enabled. DPD is the correct hardware state for the `SUSPENDED` software
state. Without this change, it takes a cycle of
`SUSPENDED->ACTIVE->SUSPENDED` to get to the low power state.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-12-19 16:53:27 +01:00
Manuel Aebischer 5b9a0e5456 drivers: usb_dc_rpi_pico: handling of data toggle after endpoint setup
The previous behaviour led to an issue where we already expected data1
on the first transfer instead of data0. The DesignWare USB DC actually
implements the same behaviour. Also, the next_pid flag has to be reset
on setting up the endpoint.
Fixes #66283.

Signed-off-by: Manuel Aebischer <manuel.aebischer@netmodule.com>
2023-12-19 12:45:52 +01:00
Fabio Baltieri 0442fe3bbf input: npcx_kbd: clear pending interrupts before reenabling detection
The driver right now re-enters polling mode a couple times after the
matrix has been detected as stable as the key interrupt is still pending
and fires again once detection is reenabled.

Clear pending WUI interrupts before reenabling key press detection to
avoid that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-19 10:57:38 +00:00
Andrei Emeltchenko c78bff954e drivers: intc_ioapic: Fix get ioapic_id
Information about IOAPIC can be located not in the first
DMAR Hardware Unit Definition subtable. Iterate them all.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-19 11:04:19 +01:00
Anisetti Avinash Krishna eb2cd31407 drivers: sdhc: intel_emmc_host: Fix return value
Fixes uninitialized variable return by returning zero
at the end of function.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-12-19 08:52:00 +01:00