Sound Open Firmware
Loading...
Searching...
No Matches
DAI Drivers

DAI Drivers API specification. More...

Data Structures

struct  dai
struct  dai_group
 DAI group information. More...
struct  llp_slot_info
 llp slot info for memory window More...
struct  dai_data
 DAI runtime data. More...

Macros

#define DAI_CREAT   BIT(0)
 If the device does not exist it will be created.

Typedefs

typedef int(* channel_copy_func) (const struct audio_stream *src, unsigned int src_channel, struct audio_stream *dst, unsigned int dst_channel, unsigned int frames)

Functions

static void dai_write (struct dai *dai, uint32_t reg, uint32_t value)
static uint32_t dai_read (struct dai *dai, uint32_t reg)
static void dai_update_bits (struct dai *dai, uint32_t reg, uint32_t mask, uint32_t value)
struct dai_group * dai_group_get (uint32_t group_id, uint32_t flags)
 API to request DAI group.
void dai_group_put (struct dai_group *group)
 API to release DAI group.
static int dai_init (struct sof *sof)
 API to initialize a platform DAI.
struct dai * dai_get (uint32_t type, uint32_t index, uint32_t flags)
 API to request a platform DAI.
void dai_put (struct dai *dai)
 API to release a platform DAI.
int dai_set_config (struct dai *dai, struct ipc_config_dai *config, const void *spec_config, size_t size)
 Digital Audio interface formatting.
int dai_get_handshake (struct dai *dai, int direction, int stream_id)
 Get Digital Audio interface DMA Handshake.
int dai_get_fifo_depth (struct dai *dai, int direction)
 Get Digital Audio interface fifo depth.
uint32_t dai_get_init_delay_ms (struct dai *dai)
 Get DAI initial delay in milliseconds.
int dai_get_stream_id (struct dai *dai, int direction)
 Get DAI stream id.
int dai_config_dma_channel (struct dai_data *dd, struct comp_dev *dev, const void *config)
 Configure DMA channel for DAI.
void dai_set_link_hda_config (uint16_t *link_config, struct ipc_config_dai *common_config, const void *spec_config)
 Configure HD Audio DMA params for DAI.
void dai_dma_release (struct dai_data *dd, struct comp_dev *dev)
 Reset DAI DMA config.
int dai_config (struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai *common_cfg, const void *spec_cfg)
 Configure DAI physical interface.
int dai_assign_group (struct dai_data *dd, struct comp_dev *dev, uint32_t group_id)
 Assign DAI to a group for simultaneous triggering.
int dai_position (struct comp_dev *dev, struct sof_ipc_stream_posn *posn)
 dai position for host driver.
void dai_dma_position_update (struct dai_data *dd, struct comp_dev *dev)
 update dai dma position for host driver.
void dai_release_llp_slot (struct dai_data *dd)
 release llp slot
__syscall const struct device * dai_get_device (enum sof_ipc_dai_type type, uint32_t index)
 Retrieve a pointer to the Zephyr device structure for a DAI of a given type and index.
const struct device ** dai_get_device_list (size_t *count)
 Retrieve the list of all DAI devices.

Detailed Description

DAI Drivers API specification.

Macro Definition Documentation

◆ DAI_CREAT

#define DAI_CREAT   BIT(0)

If the device does not exist it will be created.

Typedef Documentation

◆ channel_copy_func

typedef int(* channel_copy_func) (const struct audio_stream *src, unsigned int src_channel, struct audio_stream *dst, unsigned int dst_channel, unsigned int frames)

Function Documentation

◆ dai_assign_group()

int dai_assign_group ( struct dai_data * dd,
struct comp_dev * dev,
uint32_t group_id )

Assign DAI to a group for simultaneous triggering.

◆ dai_config()

int dai_config ( struct dai_data * dd,
struct comp_dev * dev,
struct ipc_config_dai * common_cfg,
const void * spec_cfg )

Configure DAI physical interface.

◆ dai_config_dma_channel()

int dai_config_dma_channel ( struct dai_data * dd,
struct comp_dev * dev,
const void * config )

Configure DMA channel for DAI.

◆ dai_dma_position_update()

void dai_dma_position_update ( struct dai_data * dd,
struct comp_dev * dev )

update dai dma position for host driver.

◆ dai_dma_release()

void dai_dma_release ( struct dai_data * dd,
struct comp_dev * dev )

Reset DAI DMA config.

◆ dai_get()

struct dai * dai_get ( uint32_t type,
uint32_t index,
uint32_t flags )

API to request a platform DAI.

Parameters
[in]typeType of requested DAI.
[in]indexIndex of requested DAI.
[in]flagsFlags (CREATE)

◆ dai_get_device()

__syscall const struct device * dai_get_device ( enum sof_ipc_dai_type type,
uint32_t index )

Retrieve a pointer to the Zephyr device structure for a DAI of a given type and index.

◆ dai_get_device_list()

const struct device ** dai_get_device_list ( size_t * count)

Retrieve the list of all DAI devices.

Parameters
countPointer to store the number of devices in the list.
Returns
Pointer to the array of device pointers.

◆ dai_get_fifo_depth()

int dai_get_fifo_depth ( struct dai * dai,
int direction )

Get Digital Audio interface fifo depth.

◆ dai_get_handshake()

int dai_get_handshake ( struct dai * dai,
int direction,
int stream_id )

Get Digital Audio interface DMA Handshake.

◆ dai_get_init_delay_ms()

uint32_t dai_get_init_delay_ms ( struct dai * dai)

Get DAI initial delay in milliseconds.

◆ dai_get_stream_id()

int dai_get_stream_id ( struct dai * dai,
int direction )

Get DAI stream id.

◆ dai_group_get()

struct dai_group * dai_group_get ( uint32_t group_id,
uint32_t flags )

API to request DAI group.

Returns a DAI group for the given ID and increments the counter of DAIs in the group.

If a group for the given ID doesn't exist, it will either return NULL or allocate a new group structure if the CREATE flag is supplied.

Parameters
[in]group_idGroup ID
[in]flagsFlags (CREATE)

◆ dai_group_put()

void dai_group_put ( struct dai_group * group)

API to release DAI group.

Decrements the DAI counter inside the group.

Parameters
[in]groupGroup

◆ dai_init()

int dai_init ( struct sof * sof)
inlinestatic

API to initialize a platform DAI.

Parameters
[in]sofPointer to firmware main context.

◆ dai_position()

int dai_position ( struct comp_dev * dev,
struct sof_ipc_stream_posn * posn )

dai position for host driver.

◆ dai_put()

void dai_put ( struct dai * dai)

API to release a platform DAI.

Parameters
[in]daiDAI to relese.

◆ dai_read()

uint32_t dai_read ( struct dai * dai,
uint32_t reg )
inlinestatic

◆ dai_release_llp_slot()

void dai_release_llp_slot ( struct dai_data * dd)

release llp slot

◆ dai_set_config()

int dai_set_config ( struct dai * dai,
struct ipc_config_dai * config,
const void * spec_config,
size_t size )

Digital Audio interface formatting.

◆ dai_set_link_hda_config()

void dai_set_link_hda_config ( uint16_t * link_config,
struct ipc_config_dai * common_config,
const void * spec_config )

Configure HD Audio DMA params for DAI.

◆ dai_update_bits()

void dai_update_bits ( struct dai * dai,
uint32_t reg,
uint32_t mask,
uint32_t value )
inlinestatic

◆ dai_write()

void dai_write ( struct dai * dai,
uint32_t reg,
uint32_t value )
inlinestatic