PebbleOS v4.45.0-50-g17e860a43
Loading...
Searching...
No Matches
pbl_audio_ops Struct Reference

Device driver operations. More...

#include <audio.h>

Data Fields

int(* init )(const struct pbl_audio *audio)
 Optional.
 
void(* get_caps )(const struct pbl_audio *audio, struct pbl_audio_caps *caps)
 Report the capabilities.
 
int(* start )(const struct pbl_audio *audio, const struct pbl_audio_stream *stream, int32_t gain_mdb, bool mute)
 Start streaming the ring, applying gain_mdb and mute before any sample reaches the output.
 
int(* stop )(const struct pbl_audio *audio)
 Stop streaming.
 
int(* set_gain )(const struct pbl_audio *audio, int32_t gain_mdb)
 Optional, required with a variable gain.
 
int(* set_mute )(const struct pbl_audio *audio, bool mute)
 Optional.
 
void(* sync_for_device )(const struct pbl_audio *audio, void *buf, size_t len)
 Optional.
 
void(* sync_for_cpu )(const struct pbl_audio *audio, void *buf, size_t len)
 Optional.
 
int(* pointer )(const struct pbl_audio *audio, size_t *frames)
 Optional.
 

Detailed Description

Device driver operations.

Called with the device lock held, except the sync and pointer operations, which may be called from the driver's interrupt.

Field Documentation

◆ get_caps

void(* pbl_audio_ops::get_caps) (const struct pbl_audio *audio, struct pbl_audio_caps *caps)

Report the capabilities.

Gain fields are ignored on a device linked to a codec.

◆ init

int(* pbl_audio_ops::init) (const struct pbl_audio *audio)

Optional.

Bring the hardware up. Returns 0, -ENODEV if absent, or a negative errno.

◆ pointer

int(* pbl_audio_ops::pointer) (const struct pbl_audio *audio, size_t *frames)

Optional.

Report the frame position of the hardware within the ring.

◆ set_gain

int(* pbl_audio_ops::set_gain) (const struct pbl_audio *audio, int32_t gain_mdb)

Optional, required with a variable gain.

Set the gain while streaming.

◆ set_mute

int(* pbl_audio_ops::set_mute) (const struct pbl_audio *audio, bool mute)

Optional.

Set the mute while streaming; without it, mute sets the lowest gain.

◆ start

int(* pbl_audio_ops::start) (const struct pbl_audio *audio, const struct pbl_audio_stream *stream, int32_t gain_mdb, bool mute)

Start streaming the ring, applying gain_mdb and mute before any sample reaches the output.

Returns 0, -EINVAL for a stream the hardware cannot run, or a negative errno.

◆ stop

int(* pbl_audio_ops::stop) (const struct pbl_audio *audio)

Stop streaming.

pbl_audio_period_elapsed() is not called once it returns.

◆ sync_for_cpu

void(* pbl_audio_ops::sync_for_cpu) (const struct pbl_audio *audio, void *buf, size_t len)

Optional.

Make hardware writes to a capture period visible to the CPU.

◆ sync_for_device

void(* pbl_audio_ops::sync_for_device) (const struct pbl_audio *audio, void *buf, size_t len)

Optional.

Make CPU writes to a playback period visible to the hardware.


The documentation for this struct was generated from the following file: