Skip to content

Implement dmsai core device driver through dmdevfs - #5

Merged
JohnAmadis merged 1 commit into
mainfrom
feature/dmsai-core-driver
Oct 9, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
feature/dmsai-core-driver

Conversation

@JaxCalder

Copy link
Copy Markdown
Contributor

Summary

  • Implement the architecture-independent dmsai dmdrvi DIF: parse the dmdevfs-selected INI section, reserve one SAI port, expose /dev/dmsaiN, manage an exclusive open handle, and forward whole-frame PCM read/write to the port.
  • Implement START/STOP, configuration/status and per-handle timeout ioctls, stat, and flush. Add DMSAI_IOCTL_DRAIN so applications using Dmod_FileOpen can wait until TX has actually reached the output before STOP. The STM32 DMA engine tracks completed halves for this wait.
  • Accept padded TDM frames in the existing STM32 port, matching the F769 board config. Bump both modules to 0.2 because the core now requires the new port drain entry point.
  • Update API docs, README and examples. Preserve the existing tests, Makefile, CI and license badges.

Validation

  • Built dmsai, dmsai_port, dmsai_driver_board_test, dmsai_port_board_test and existing test_dmsai for STM32F7.
  • Installed local .dmf and .dmfc for the core, port and new test, plus the STM32F746G-DISCO SAI2 board config, into dmod-boot. Removed modules.dmp, its object and the config filesystem image before rebuilding. OpenOCD flashed and verified the firmware.
  • After 30 seconds, UART responded and ls /dev showed /dev/dmsai1. Ran dmsai_driver_board_test twice through the shell: both runs reported PASS (0).
  • The board test checks config/status, per-handle timeout, invalid and unknown ioctl errors, exclusive open, repeated START/STOP, a 300-frame DMA write, TX drain, RX read, drain-after-stop error and reopen. The dmdevfs error log during the second-open probe is expected.

The board test verifies digital DMA transfer and device control. WM8994 analog playback/capture is outside this test because codec setup belongs to its own driver.

@JohnAmadis
JohnAmadis merged commit 2e85552 into main Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants