1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <dt-bindings/usb/audio.h>
8
9/ {
10	uac2_headset: usb_audio2 {
11		compatible = "zephyr,uac2";
12		status = "okay";
13		audio-function = <AUDIO_FUNCTION_HEADSET>;
14
15		uac_aclk: aclk {
16			compatible = "zephyr,uac2-clock-source";
17			clock-type = "internal-programmable";
18			frequency-control = "host-programmable";
19			sampling-frequencies = <48000>;
20		};
21
22		out_terminal: out_terminal {
23			compatible = "zephyr,uac2-input-terminal";
24			clock-source = <&uac_aclk>;
25			terminal-type = <USB_TERMINAL_STREAMING>;
26			front-left;
27			front-right;
28		};
29
30		headphones_output: headphones {
31			compatible = "zephyr,uac2-output-terminal";
32			data-source = <&out_terminal>;
33			clock-source = <&uac_aclk>;
34			terminal-type = <BIDIRECTIONAL_TERMINAL_HEADSET>;
35			assoc-terminal = <&mic_input>;
36		};
37
38		mic_input: microphone {
39			compatible = "zephyr,uac2-input-terminal";
40			clock-source = <&uac_aclk>;
41			terminal-type = <BIDIRECTIONAL_TERMINAL_HEADSET>;
42			/* Circular reference, macros will figure it out and
43			 * provide correct associated terminal ID because the
44			 * terminals associations are always 1-to-1.
45			 *
46			 * assoc-terminal = <&headphones_output>;
47			 */
48			front-left;
49		};
50
51		in_terminal: in_terminal {
52			compatible = "zephyr,uac2-output-terminal";
53			data-source = <&mic_input>;
54			clock-source = <&uac_aclk>;
55			terminal-type = <USB_TERMINAL_STREAMING>;
56		};
57
58		as_iso_out: out_interface {
59			compatible = "zephyr,uac2-audio-streaming";
60			linked-terminal = <&out_terminal>;
61			implicit-feedback;
62			subslot-size = <2>;
63			bit-resolution = <16>;
64		};
65
66		as_iso_in: in_interface {
67			compatible = "zephyr,uac2-audio-streaming";
68			linked-terminal = <&in_terminal>;
69			implicit-feedback;
70			subslot-size = <2>;
71			bit-resolution = <16>;
72		};
73	};
74};
75