Skip to content

drivers: dai: extend user-space support to more DAI drivers - #101193

Merged
henrikbrixandersen merged 7 commits into
zephyrproject-rtos:mainfrom
kv2019i:2025-user-dai-part2
Jan 13, 2026
Merged

drivers: dai: extend user-space support to more DAI drivers#101193
henrikbrixandersen merged 7 commits into
zephyrproject-rtos:mainfrom
kv2019i:2025-user-dai-part2

Conversation

@kv2019i

@kv2019i kv2019i commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Follow up to #99811 , with:

  • improve documentation
  • fix issues in syscall handlers and make the checks more robust
  • add missing get_properties to all Intel DAI types, allowing them all to be used from user-space

Handle the case if driver is not implementing get_properties_copy().

Document the behaviour and add a note that the method is optional and
users need to be handle the case that not all drivers will have this
method defined.

Also add documentation on error codes. Drivers should use -ENOENT if
no properties are defined for the device. This matches behaviour of
dai_get_properties() returning NULL if there are no properties.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
…copy

Fix function indentation to match coding style.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
…py()

dai_ssp_get_properties() can return NULL if there are no properties
defined for the device. Handle this case correctly in ssp driver's
dai_ssp_get_properties_copy() by returning -ENOENT in this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Make a in-kernel copy of 'cfg' parameter before passing the struct
to kernel z_impl_dai_config_set() implementation. This ensures
user-space will not have access to the object when kernel part
of the syscall is running.

Also add separate handling for the case where bespoke configuration
object is NULL. While no current driver works without a bespoke
configuration, this is not forbidden in the API and the generic syscall
handler should not assume a bespoke object is passed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@sonarqubecloud

Copy link
Copy Markdown

@kv2019i
kv2019i requested review from lyakh and ujfalusi December 18, 2025 14:53
return -ENOENT;
}

memcpy(prop, kernel_prop, sizeof(*kernel_prop));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this made me go check that prop was big enough to hold kernel_prop - admittedly I didn't have to go very far, but still maybe *prop = *kernel_prop; would be more explicit

@kv2019i
kv2019i requested a review from lyakh January 9, 2026 17:21
@kv2019i

kv2019i commented Jan 9, 2026

Copy link
Copy Markdown
Contributor Author

@lyakh @dbaluta @abonislawski @softwarecki @tmleman could you take a look? This would be ready to go...

@henrikbrixandersen
henrikbrixandersen merged commit 72d0660 into zephyrproject-rtos:main Jan 13, 2026
38 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants