DAI Drivers

For the documentation of support devices refer to Supported Devices.


DAI drivers provide access to the Digital Audio Interfaces supported by the platform.

class lib {
   struct dai *dai_get(uint32_t type, uint32_t index)
   dai_put(struct dai*)
hide lib attributes

class dai_ops {
hide dai_ops attributes

class "struct dai" as s_dai {
   type : uint32_t
   index : uint32_t
   plat_data : dai_plat_data
   ops : const dai_ops *
   private : void *
hide s_dai methods

class "struct dai_plat_data" as s_dai_plat_data {
   base : uint32_t
   irq : uint32_t
   flags : uint32_t
   fifo : struct dai_plat_fifo_data[2]
hide s_dai_plat_data methods

class "struct dai_plat_fifo_data" as s_dai_plat_fifo_data {
   offset : uint32_t
   width : uint32_t
   depth : uint32_t
   watermark : uint32_t
   handshake : uint32_t
hide s_dai_plat_fifo_data methods

dai_ops - s_dai
s_dai -- s_dai_plat_data
s_dai_plat_data -- s_dai_plat_fifo_data
s_dai <- lib : provides

Figure 30 DAI Driver API

Programming Flows

DAI Initialization

When ADSP enters D0, the dai instances are registered in the list maintained by the lib.

Configuration & Commands

Before the dai client starts the device, it is configured with parameters from the IPC command.

participant host as "Host"
participant ipc
participant platform
participant dai_comp as "audio/dai"
participant dai
participant dai_hw

host -> ipc : ipc_dai_config(config)
   activate ipc

   ipc -> platform : dai_get(config->type, config->id)
      activate platform
   ipc <-- platform : dai ptr
   deactivate platform

   ipc -> dai : dai_set_config(config)
      activate dai
      dai -> dai_hw : setup
      activate dai_hw
   ipc <-- dai
   deactivate dai

host <-- ipc
deactivate ipc

host -> dai_comp : dai_comp_trigger(cmd)
   note right: Full call path includes parent pipeline
   activate dai_comp
   dai_comp -> dai : dai_trigger(cmd)
      activate dai
      dai -> dai_hw : update
   dai_comp <-- dai
host <-- dai_comp

Using DAI Driver API

See DAI Drivers API


The API is accessed through a common structure; however, an implementation may keep some specific private data attached to the dai.private pointer.

Supported Devices


Throughout this tutorial, we reference your website name as <your_website>.