Commit graph

113142 commits

Author SHA1 Message Date
Jordan Yates
8f53407fa6 serial: cmsdk_apb: fix irq_is_pending
Implement `irq_is_pending` in terms of the `irq_rx_ready` and
`irq_tx_ready` function calls.

Using `intstatus` directly results in an implementation that does not
conform to the interrupt driven UART API. Since `intstatus` bits are
only only set when a buffer transitions from full to empty, any calls to
`irq_is_pending` before any bytes have been sent will return 0. This is
problematic since the documented implementation for the API IRQ handler
is:
```
while (uart_irq_update(dev) && uart_irq_is_pending(dev)) {
    if (uart_irq_rx_ready(dev)) {
        ...
    }
    if (uart_irq_tx_ready(dev)) {
        uart_fifo_fill(dev, ...);
    }
}
```
If `uart_irq_is_pending` does not return 1 until the first byte is sent,
we never end up pushing data to be transmitted into the `uart_fifo_full`
function.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-03 08:43:37 +02:00
Khaoula Bidani
ba1ad38f99 drivers: usb: udc: simplify code of maximum-speed
Add defines to avoid magic values in the dtsi.
Replace usb_dc_stm32_get_maximum_speed() with device tree property.
- Use DT_INST_STRING_UPPER_TOKEN(0, maximum_speed) to set the USB speed.
- Remove PCD_SPEED_FULL initialization.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-04-03 08:43:29 +02:00
Khaoula Bidani
01ddccdf62 drivers: usb: device: simplify code of maximum-speed
Add defines to avoid magic values in the dtsi.
Replace usb_dc_stm32_get_maximum_speed() with device tree property.
- Use DT_INST_STRING_UPPER_TOKEN(0, maximum_speed) to set the USB speed.
- Remove PCD_SPEED_FULL initialization.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-04-03 08:43:29 +02:00
Khaoula Bidani
e359cc6695 dts: arm: st: add property maximum-speed
On STM32 USB, there are currently four types
of maximum-speed: "super-speed", "high-speed",
"full-speed" and "low-speed" (if present).
To simplify the driver, add maximum-speed if
not present as a dts property.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-04-03 08:43:29 +02:00
Peter Wang
43b6db143f boards: frdm_mcxa166, frdm_mcxa276: add frdm_mcxa166 and frdm_mcxa276 board
enable board support for frdm_mcxa166 and frdm_mcxa276

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-04-03 08:43:16 +02:00
Peter Wang
5309c93944 drivers: flash: update flash_mcux to support all mcxa family device
update flash_mcux driver to support all mcxa family device

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-04-03 08:43:16 +02:00
Peter Wang
aa5781873e dts: mcxa166,mcxa276: add dts for MCXA166 and MCXA276
add dts for device MCXA166 and MCXA276

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-04-03 08:43:16 +02:00
Peter Wang
9580bc5627 soc: mcxa166,mcxa276: add SOC support for MCXA166 and MCXA276
add soc MCXA166 and MCXA276 for board frdm_mcxa166 and frdm_mcxa276

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-04-03 08:43:16 +02:00
Peter Wang
a10dd1d830 manifest: update HAL NXP manifest for MCXA166,MCXA276 pinctrl
update hal_nxp to include device MCXA166 and MCXA276 pinctrl

Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
2025-04-03 08:43:16 +02:00
Khanh Nguyen
ceb19935b3 boards: renesas: Add power management support for RA8 boards
Updated DTS files to enable ULPT nodes for:
- `ek_ra8d1`
- `ek_ra8m1`
- `mck_ra8t1`

Updated board documentation in `index.rst` for each board.

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
2025-04-03 08:41:08 +02:00
Khanh Nguyen
fb572d59a2 soc: renesas: Add power management support for Renesas RA8
Updated `CMakeLists.txt` and `Kconfig` to integrate power management
for RA8D1, RA8M1, and RA8T1.

Modified `Kconfig.defconfig` to configure ULPT timer as the system timer
when power management is enabled:
- Adjusted `SYS_CLOCK_HW_CYCLES_PER_SEC` and `SYS_CLOCK_TICKS_PER_SEC`
for ULPT timer.
- Disabled `CORTEX_M_SYSTICK` when ULPT timer is used as the system timer.

Implemented power management logic in the new `power.c` file for:
- RA8D1 (`soc/renesas/ra/ra8d1/power.c`)
- RA8M1 (`soc/renesas/ra/ra8m1/power.c`)
- RA8T1 (`soc/renesas/ra/ra8t1/power.c`)

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
2025-04-03 08:41:08 +02:00
Khanh Nguyen
528153e245 dts: arm: renesas: Add ULPT and power state nodes for Renesas RA8
ULPT nodes:
- Added `ulpt0` at 0x40220000 (channel 0).
- Added `ulpt1` at 0x40220100 (channel 1).
- Included timer sub-nodes with `renesas,ra-ulpt-timer` compatibility.

Power state nodes:
- `stop0`: Runtime idle state mapped to LPM sleep mode.
- `stop1`: Standby state mapped to LPM software standby mode.

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
2025-04-03 08:41:08 +02:00
Khanh Nguyen
7ae800a0c9 drivers: timer: Add ULPT timer for power management on Renesas RA MCUs
drivers:
- Added ULPT timer driver in `renesas_ra_ulpt_timer.c`.
- Updated `clock_control_renesas_ra_cgc.c` for ULPT clock settings.
- Updated `uart_renesas_ra8_sci_b.c` for power management support.
- Updated `CMakeLists.txt` and `Kconfig` to integrate ULPT timer.
- Added `Kconfig.renesas_ra_ulpt` for ULPT-specific configurations.

dts bindings:
- Added `renesas,ra-ulpt.yaml` for ULPT node bindings.
- Added `renesas,ra-ulpt-timer.yaml` for ULPT timer bindings.

modules:
- Updated `Kconfig.renesas_fsp` to support ULPT and LPM.

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
2025-04-03 08:41:08 +02:00
Nhut Nguyen
8f2879a156 drivers: gpio: rz: Fix a build error
Fix a build error of redefinition of a variable in gpio_renesas_rz.h

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-04-03 06:25:06 +02:00
S Mohamed Fiaz
2eb0fb2746 west.yml: Update hal_silabs revision
This commit updates the hal_silabs revision

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-04-03 06:24:54 +02:00
S Mohamed Fiaz
701be0c331 driver: sleeptimer: siwx917: Add siwx91x Sleeptimer driver
This commit enables the Sleeptimer driver support for the siwx917 device.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
2025-04-03 06:24:54 +02:00
Tom Hughes
d5d12f43f8 drivers: dma_wch: Add __used instead of disabling unused function warning
#84065 replaced diagnostic pragmas with TOOLCHAIN_* macros, but we don't
need to use that here since __used is a cleaner way to indicate that the
function is used and will also prevent it from being optimized away at
link time if LTO is enabled.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-03 06:24:44 +02:00
Lyle Zhu
c09cf23844 Bluetooth: HFP_AG: Add ACL conn to the connected callback
If the AG works as Data Channel Acceptor, the ACL conn cannot be known
by the application of AG. Similar with HF, add ACL conn as the first
parameter to the `connected` callback of AG.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
ec0d473ec0 Bluetooth: HFP_AG: Remove unnecessary code line __fallthrough
Remove all unnecessary code lines `__fallthrough` from switch-case.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
ded0b176a6 Bluetooth: HFP_AG: Optimize feature access
Add `BOTH_SUPT_FEAT(ag, _hf_feature, _ag_feature)` to check if the
feature is supported by both side.
Add `HF_SUPT_FEAT(ag, _feature)` to check if the feature is supported
by HF.
Add `AG_SUPT_FEAT(ag, _feature)` to check if the feature is supported
by AG.

Use `BOTH_SUPT_FEAT/HF_SUPT_FEAT/AG_SUPT_FEAT` to optimize code that
checks whether a feature is supported.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
9cda31a4ca Bluetooth: HFP_AG: Remove unnecessary lock for feature read access
The lock/unlock for AG/HF feature read access is unnecessary.
For AG feature, it only be changed when creating new AG object.
For HF feature, it only be changed when exchanging feature in SLC
establishment.

Remove the hfp_ag_lock/hfp_ag_unlock for AG/HF feature read access.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
d37f250174 Bluetooth: HFP_AG: Change "-EOPNOTSUPP" to "-ENOEXEC"
There is an error reported in platform `native_sim` that the value of
`EOPNOTSUPP` is same as `ENOTSUP`.
It cause the building error `duplicate case value '-95'` reported.

Use `ENOEXEC` to replace `EOPNOTSUPP` to fix the building issue.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
68d2526130 Sample: Bluetooth: HFP_HF: Update the sample
Due to the interface of HF is updated, update HF sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
eb327af328 Bluetooth: HFP: Divide hfp_internal.h
Divide hfp_internal.h into two parts, HFP HF part hfp_hf_internal.h and
HFP common part hfp_internal.h.

Includes "hfp_internal.h" in file "hfp_ag_internal.h".
Includes "hfp_ag_internal.h" in file "hfp_ag.c".

Includes "hfp_internal.h" in file "hfp_hf_internal.h".
Includes "hfp_hf_internal.h" in file "hfp_hf.c".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
fcedda6a00 Sample: Bluetooth: HFP_AG: Update the sample
Due to the interface of AG is updated, update AG sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
67e01dfd26 Bluetooth: Shell: BR: Find HFP_HF records on HFP_AG side
Add a option `HFPHF` to find HFP HF SDP records from HFP AG side.

Add a SDP records discovery parameter `discov_hfphf` for this option.

Add a function `sdp_hfp_hf_user` to handle the discovery result.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
eba356d56b Bluetooth: shell: Support HFP HF and AG
Support HFP HF and AG in shell.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
781074c6e2 Bluetooth: HFP_HF: Improve SCO accept
Find HF object according to conn object index directly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
3723ba1eee Bluetooth: HFP_AG: Support RFCOMM responder
Define SDP records for HFP AG. Register HFP AG SDP service records in
AG initialization.

Register HFP AG RFCOMM server in AG initialization.

Register HFP AG SCO server in AG initialization.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
4833f82a8c Bluetooth: HFP_HF: Verify ability to reject a call
Check the ability of AG to reject a call. If the AG cannot reject the
call, return error `-ENOTSUP`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
507c2e7fc0 Bluetooth: HFP_AG: Ability to reject call
Add a configuration `CONFIG_BT_HFP_AG_REJECT_CALL` for feature
`Ability to reject a call`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
d7cdadc4be Bluetooth: HFP_HF: Initiate SLC establishment
Add function `bt_hfp_hf_connect` to initialize the Service Level
Connection establishment procedure.

Add function `bt_hfp_hf_disconnect` to release the Service Level
Connection.

Clear HF object if the RFCOMM is disconnected.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
f482613478 Bluetooth: HFP_AG: fix typo
Change `Dailing` to `Dialing`.
Change `HFP unit` to `HF`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
d9dd2e476b Bluetooth: HFP_HF: fix typo
Change `HF_SINGNAL_IND` to `HF_SIGNAL_IND`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
0d7eca6955 Bluetooth: HFP_AG: Support HF Indicators
Add configuration `CONFIG_BT_HFP_AG_HF_INDICATORS` to enable feature
HF Indicators.

Add configuration `CONFIG_BT_HFP_AG_HF_INDICATOR_ENH_SAFETY` to
support HF indicator `Enhanced Safety`.

Add configuration `CONFIG_BT_HFP_AG_HF_INDICATOR_BATTERY` to support
HF indicator `Remaining level of Battery`.

Add function `bt_hfp_ag_hf_indicator` to activate/deactivate HF
indicator.

Optimize the handle of AT command `AT+BIND`.

Handle AT command `AT+BIEV`.

Add callback `hf_indicator_value` to notify the value of HF indicator.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
01de855828 Bluetooth: HFP_HF: Support HF Indicators
Add configuration `CONFIG_BT_HFP_HF_HF_INDICATORS` to enable feature
HF Indicators.

Add configuration `CONFIG_BT_HFP_HF_HF_INDICATOR_ENH_SAFETY` to
support HF indicator `Enhanced Safety`.

Add configuration `CONFIG_BT_HFP_HF_HF_INDICATOR_BATTERY` to support
HF indicator `Remaining level of Battery`.

Add function `bt_hfp_hf_enhanced_safety` to transfer enhanced safety
status.

Add function `bt_hfp_hf_battery` to transfer Remaining level of
Battery.

Send AT command to notify AG the supported HF indicators of HF in SLC
initialization sequence.

Send AT command to get the supported HF indicators of AG in SLC
initialization sequence.

Send AT command to get the enabled/disabled state of generic status
indicators from AG in SLC initialization sequence.

Handle unsolicited result code `+BIND`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
04122445bb Bluetooth: HFP_HF: Optimize SLC init procedure
In current implementation, it is difficult to insert new AT commands
in the SLC initialization sequence.

Add a SLC initialization sequence. Send AT command one by one.

It will be easy to insert new AT commands in the appropriate position.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
32e6c21e0d Bluetooth: HFP_AG: Indicators Activation and Deactivation
Improve the process of AT command `AT+BIA` to mask the activated/
deactivated indicators.

Only notify the activated indicator if the value of it is updated.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
2011dcb3ee Bluetooth: HFP_HF: Activate/deactivate AG indicators
Add a function `bt_hfp_hf_indicator_status` to activate/deactivate AG
indicators.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
f915f86761 Bluetooth: HFP_AG: Set service availability
Add a function `bt_hfp_ag_service_availability` to set the service
availability.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
dbd3887b91 Bluetooth: HFP_AG: Set battery level
Add a function `bt_hfp_ag_battery_level` to set the battery level.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
04c4abdcb3 Bluetooth: HFP_AG: Set roaming status
Add a function `bt_hfp_ag_roaming_status` to set the roaming status.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
afa09067ca Bluetooth: HFP_AG: Set signal strength
Add a function `bt_hfp_ag_signal_strength` to set the signal strength.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
b622e748b8 Bluetooth: HFP_AG: Send subscriber number info
Handle AT command `AT+CNUM`.

Add a callback function `subscriber_number` to notify the upper layer
that the HF needs to get subscriber number information from the AG.

If there is subscriber number information needs to be sent, the passed
function `bt_hfp_ag_query_subscriber_func_t func` can be called for
this purpose.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
5dd303620a Bluetooth: HFP_HF: Query subscriber number
Add function `bt_hfp_hf_query_subscriber` to query the AG subscriber
number.

Add callback `subscriber_number` to notify the result of the query of
the subscriber number information.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
1e4c740298 Bluetooth: HFP_AG: Handle DTMF code
Handle AT command `AT+VTS`.

Add a callback `transmit_dtmf_code`. When a valid AT command `AT+VTS`
is received, call the callback to notify the upper layer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
a3a1b409dc Bluetooth: HFP_HF: Transmit DTMF Code
Add a function `bt_hfp_hf_transmit_dtmf_code` to transmit DTMF Codes.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
43be8b8698 Bluetooth: HFP_AG: Attach a phone number for a voice tag
Add configuration `CONFIG_BT_HFP_AG_VOICE_TAG` to enable the feature
`attach a phone number for a voice tag`.

Handle AT command `AT+BINP=1`.

Add callback `request_phone_number` to notify the request and get the
phone number from the upper layer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
853b51d3f6 Bluetooth: HFP_HF: Request phone number
Add a function `bt_hfp_hf_request_phone_number` to request phone number
to the AG.

Add a callback `request_phone_number` to notify the result of the
request.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
f842c19ff9 Bluetooth: HFP_AG: Support Voice recognition activation
Add configuration `CONFIG_BT_HFP_AG_VOICE_RECG` to enable Voice
recognition activation feature.

Add configuration `CONFIG_BT_HFP_AG_ENH_VOICE_RECG` to enable Enhanced
Voice Recognition Status feature.

Add configuration `CONFIG_BT_HFP_AG_VOICE_RECG_TEXT` to enable Voice
Recognition Text feature.

Add function `bt_hfp_ag_voice_recognition` activate/deactivate the
Voice recognition activation feature.

Add function `bt_hfp_ag_vre_state` to notify the state of the voice
recognition engine.

Add function `bt_hfp_ag_vre_textual_representation` to notify the
state and textual representation of voice recognition engine.

Add callback `voice_recognition` to notify the upper layer the status
of voice recognition activation.

Add callback `ready_to_accept_audio` to notify the upper layer that
the HF is ready to accept audio.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00