* [dm][clk] fixup the work flow of CLK
Add RT_CLK_F_SET_RATE_NO_REPARENT so clock providers can preserv
the currently selected parent during rate changes.
Round and re-read the effective clock rate after parent handling,
skip redundant gate toggles and hardware programming when
the target is already active, and fix error handling for parent-clock allocation failures.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* style: format complete changed files with clang-format
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [dm][phye] Add Mode/State and MIPI D-PHY timing helper
Extend the generic PHY framework with cached mode and submode state,
avoiding redundant hardware mode changes.
Add MIPI D-PHY default timing calculation helpers based on
pixel clock or lane high-speed clock, and expose the new API through rtdevice.h.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* style: format complete changed files with clang-format
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [dm][regulator] update regulator
Replace the regulator framework spinlock with a mutex
because regulator operations may sleep.
Move always-on policy into the regulator core,
keep an initial enable reference for always-on supplies,
prevent the last disable from turning them off,
and let fixed/GPIO providers report and control their actual hardware state.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* [dm][regulator] add PWM regulator support
Signed-off-by: GuEe-GUI <2991707448@qq.com>
* style: format code with clang-format
* style: format complete changed files with clang-format
---------
Signed-off-by: GuEe-GUI <2991707448@qq.com>
1. Fixup the cooling control flow.
2. Replace the spinlock to mutex.
3. Fixup the PWM args for PWM-FAN.
4. Add GPIO-FAN
Signed-off-by: GuEe-GUI <2991707448@qq.com>
rt_data_queue_pop() holds the data queue spinlock while updating the ring
state, then calls rt_data_queue_len(). The length function tries to acquire
the same non-recursive spinlock again, causing an SMP deadlock when a pop
leaves the queue non-empty.
Add a private _data_queue_len_nolock() helper for callers which already hold
the queue lock. Keep the public rt_data_queue_len() protected by one spinlock
acquisition.
This does not change the public API, ABI, queue state transitions, low-water
mark wakeups, or event callback behavior.
Tested on a four-core Spacemit K1 with cyclic HDMI playback and by building the
SMP QEMU Virt64 RISC-V BSP with generic audio, Intel HDA and VirtIO Sound.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
Add rt_bus_probe_device() to retry driver matching for a registered
but unbound device. Use it when an OFW-created platform device
is requested again, while preserving native-bus ownership
for I2C, SPI, and other non-platform devices.
Also instantiate eligible child platform devices after a parent node is registered.
Signed-off-by: GuEe-GUI <2991707448@qq.com>
rt_pci_ep_set_msi() checked the set_msix callback before calling set_msi. That rejects endpoint controllers that implement MSI without MSI-X, and can call through a NULL set_msi pointer when only MSI-X is provided.
The same helper converts a requested MSI vector count into the log2 field passed to the controller. Stop after the first value large enough for the request so smaller requests are not widened by later loop iterations.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
rt_pic_linear_irq() stores irq_nr as a count and assigns pic->pirqs to the first entry in that range. rt_pic_find_pirq() therefore must treat the upper bound as exclusive.
The inclusive check could return pic->pirqs[irq_nr] when irq equals irq_start + irq_nr, which is one entry past the allocated range.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
Valid slew_rates indices are 0 through RT_ARRAY_SIZE(slew_rates) - 1.
The current check rejects only values greater than the table size,
allowing slew_idx == RT_ARRAY_SIZE(slew_rates) to index one element
past the table.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
_dac_control() checked the enabled callback before invoking disabled for RT_DAC_CMD_DISABLE. That can reject DAC drivers that provide a disable callback without enable, and can call through a NULL disabled callback when only enable is implemented.
Check the disabled callback in the disable command path so the guard matches the operation being dispatched.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
add serial v2 RX DMA event mode configuration for DMA-enabled builds
support STM32 UART RX DMA half/full transfer interrupt policy selection
validate RX DMA event mode before applying serial configuration
restore serial configuration when backend configure fails
1. Support DVFS and finsh cmd, there are 6 governors:
- conservative
- freedom
- performance
- powersave
- schedutil
2. Support DVFS for SCMI.
3. Port the Cooling device for DVFS.
4. Port the PM with DVFS.
Signed-off-by: GuEe-GUI <2991707448@qq.com>