12#ifndef ZEPHYR_INCLUDE_DRIVERS_UAOL_H_
13#define ZEPHYR_INCLUDE_DRIVERS_UAOL_H_
62typedef int (*uaol_api_config)(
const struct device *dev,
int stream,
struct uaol_config *config);
64typedef int (*uaol_api_start)(
const struct device *dev,
int stream);
66typedef int (*uaol_api_stop)(
const struct device *dev,
int stream);
68typedef int (*uaol_api_program_ep_table)(
const struct device *dev,
int stream,
73__subsystem
struct uaol_driver_api {
74 uaol_api_config config;
77 uaol_api_program_ep_table program_ep_table;
78 uaol_api_get_capabilities get_capabilities;
137 return DEVICE_API_GET(uaol, dev)->program_ep_table(dev, stream, entry, valid);
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1461
#define bool
Definition stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:525
UAOL hardware capabilities.
Definition uaol.h:19
uint32_t max_rx_fifo_size
Max RX FIFO size.
Definition uaol.h:24
uint32_t input_streams
Number of supported input streams.
Definition uaol.h:20
uint32_t bidirectional_streams
Number of supported bidir streams.
Definition uaol.h:22
uint32_t max_tx_fifo_size
Max TX FIFO size.
Definition uaol.h:23
uint32_t output_streams
Number of supported output streams.
Definition uaol.h:21
UAOL stream configuration data.
Definition uaol.h:34
uint16_t art_divider_m
USB ART divider multiplication value.
Definition uaol.h:38
enum uaol_direction direction
USB stream/endpoint direction.
Definition uaol.h:47
uint32_t sample_rate
Audio sample rate (frames per second ).
Definition uaol.h:40
uint16_t fifo_start_offset
UAOL FIFO start address offset.
Definition uaol.h:45
uint32_t sio_credit_size
SIO credit packet size in bytes.
Definition uaol.h:44
uint32_t channels
Number of audio channels.
Definition uaol.h:41
uint8_t xhci_function
xHCI controller function
Definition uaol.h:37
uint8_t xhci_bus
xHCI controller bus
Definition uaol.h:35
uint16_t art_divider_n
USB ART divider division value.
Definition uaol.h:39
uint8_t xhci_device
xHCI controller device
Definition uaol.h:36
uint32_t sample_bits
Audio sample (container) size in bits.
Definition uaol.h:42
uint16_t channel_map
HDA link stream and channels mapping for UAOL FIFO.
Definition uaol.h:46
uint32_t service_interval
Service interval for PCM stream operation in us.
Definition uaol.h:43
UAOL stream endpoint table entry.
Definition uaol.h:51
uint32_t split_ep
Split endpoint flag.
Definition uaol.h:54
uint32_t usb_ep_address
USB endpoint number.
Definition uaol.h:52
uint32_t device_slot_number
Slot number.
Definition uaol.h:53
static int uaol_program_ep_table(const struct device *dev, int stream, struct uaol_ep_table_entry entry, bool valid)
Program an endpoint table entry for UAOL individual stream.
Definition uaol.h:134
int uaol_get_mapped_hda_link_stream_id(const struct device *dev, int uaol_stream_id)
Get the HDA link stream ID mapped in HW to the UAOL stream ID.
static int uaol_get_capabilities(const struct device *dev, struct uaol_capabilities *caps)
Query UAOL hardware capabilities.
Definition uaol.h:148
static int uaol_config(const struct device *dev, int stream, struct uaol_config *cfg)
Set UAOL individual stream configuration.
Definition uaol.h:93
static int uaol_stop(const struct device *dev, int stream)
Stop UAOL individual stream operation.
Definition uaol.h:119
static int uaol_start(const struct device *dev, int stream)
Start UAOL individual stream operation.
Definition uaol.h:106
uaol_direction
UAOL stream/endpoint direction.
Definition uaol.h:28
@ UAOL_DIR_PLAYBACK
Host-to-device USB endpoint.
Definition uaol.h:29
@ UAOL_DIR_CAPTURE
Device-to-host USB endpoint.
Definition uaol.h:30