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