blob: bf04628dcacf868af62875d7802968619d9d1c32 [file] [log] [blame]
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <dt-bindings/usb/audio.h>
/ {
uac2_headset: usb_audio2 {
compatible = "zephyr,uac2";
status = "okay";
full-speed;
high-speed;
audio-function = <AUDIO_FUNCTION_SUBCLASS_UNDEFINED>;
/* Clock supporting 48KHz
*
* Since the incoming audio may be between 8 and 48 KHz, we always upsample to 48KHz
*/
uac_aclk: aclk {
compatible = "zephyr,uac2-clock-source";
clock-type = "internal-programmable";
frequency-control = "read-only";
sampling-frequencies = <48000>;
/* Falsely claim synchronous audio because we
* currently don't calculate feedback value
*/
sof-synchronized;
};
/* USB Audio terminal from USB host to USB device */
out_terminal: out_terminal {
compatible = "zephyr,uac2-input-terminal";
clock-source = <&uac_aclk>;
terminal-type = <USB_TERMINAL_STREAMING>;
front-left;
front-right;
};
as_iso_out: out_interface {
compatible = "zephyr,uac2-audio-streaming";
linked-terminal = <&out_terminal>;
subslot-size = <2>;
bit-resolution = <16>;
};
/* USB Audio terminal from USB device to USB host */
in_terminal: in_terminal {
compatible = "zephyr,uac2-output-terminal";
data-source = <&bt_input>;
clock-source = <&uac_aclk>;
terminal-type = <USB_TERMINAL_STREAMING>;
};
as_iso_in: in_interface {
compatible = "zephyr,uac2-audio-streaming";
linked-terminal = <&in_terminal>;
subslot-size = <2>;
bit-resolution = <16>;
};
/* The bt_output terminal defines what we are sending over Bluetooth */
bt_output: headphones {
compatible = "zephyr,uac2-output-terminal";
data-source = <&out_terminal>;
clock-source = <&uac_aclk>;
terminal-type = <BIDIRECTIONAL_TERMINAL_UNDEFINED>;
assoc-terminal = <&bt_input>;
};
/* The bt_input terminal defines what we are receiving over Bluetooth */
bt_input: microphone {
compatible = "zephyr,uac2-input-terminal";
clock-source = <&uac_aclk>;
terminal-type = <BIDIRECTIONAL_TERMINAL_UNDEFINED>;
/* Circular reference, macros will figure it out and
* provide correct associated terminal ID because the
* terminals associations are always 1-to-1.
*
* assoc-terminal = <&bt_output>;
*/
front-left;
front-right;
};
};
};