|
4 | 4 | * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause |
5 | 5 | */ |
6 | 6 |
|
| 7 | + #include <dt-bindings/usb/audio.h> |
| 8 | + |
7 | 9 | / { |
8 | 10 | audioleds: audioleds { |
9 | 11 | compatible = "gpio-leds"; |
|
33 | 35 | }; |
34 | 36 | }; |
35 | 37 |
|
36 | | -&usbd { |
37 | | - hs_0: hs_0 { |
38 | | - compatible = "usb-audio-hs"; |
39 | | - mic-feature-mute; |
40 | | - mic-channel-l; |
41 | | - mic-channel-r; |
| 38 | +/ { |
| 39 | + uac2_headset: usb_audio2 { |
| 40 | + compatible = "zephyr,uac2"; |
| 41 | + status = "okay"; |
| 42 | + full-speed; |
| 43 | + audio-function = <AUDIO_FUNCTION_HEADSET>; |
| 44 | + |
| 45 | + uac_aclk: aclk { |
| 46 | + compatible = "zephyr,uac2-clock-source"; |
| 47 | + clock-type = "internal-programmable"; |
| 48 | + frequency-control = "read-only"; |
| 49 | + sampling-frequencies = <48000>; |
| 50 | + sof-synchronized; |
| 51 | + }; |
| 52 | + |
| 53 | + out_terminal: out_terminal { |
| 54 | + compatible = "zephyr,uac2-input-terminal"; |
| 55 | + clock-source = <&uac_aclk>; |
| 56 | + terminal-type = <USB_TERMINAL_STREAMING>; |
| 57 | + front-left; |
| 58 | + front-right; |
| 59 | + }; |
| 60 | + |
| 61 | + headphones_output: headphones { |
| 62 | + compatible = "zephyr,uac2-output-terminal"; |
| 63 | + data-source = <&out_terminal>; |
| 64 | + clock-source = <&uac_aclk>; |
| 65 | + terminal-type = <BIDIRECTIONAL_TERMINAL_HEADSET>; |
| 66 | + assoc-terminal = <&mic_input>; |
| 67 | + }; |
| 68 | + |
| 69 | + in_terminal: in_terminal { |
| 70 | + compatible = "zephyr,uac2-output-terminal"; |
| 71 | + data-source = <&mic_input>; |
| 72 | + clock-source = <&uac_aclk>; |
| 73 | + terminal-type = <USB_TERMINAL_STREAMING>; |
| 74 | + }; |
| 75 | + |
| 76 | + mic_input: microphone { |
| 77 | + compatible = "zephyr,uac2-input-terminal"; |
| 78 | + clock-source = <&uac_aclk>; |
| 79 | + terminal-type = <BIDIRECTIONAL_TERMINAL_HEADSET>; |
| 80 | + front-left; |
| 81 | + front-right; |
| 82 | + }; |
| 83 | + |
| 84 | + as_iso_out: out_interface { |
| 85 | + compatible = "zephyr,uac2-audio-streaming"; |
| 86 | + linked-terminal = <&out_terminal>; |
| 87 | + subslot-size = <2>; |
| 88 | + bit-resolution = <16>; |
| 89 | + }; |
42 | 90 |
|
43 | | - hp-feature-mute; |
44 | | - hp-channel-l; |
45 | | - hp-channel-r; |
| 91 | + as_iso_in: in_interface { |
| 92 | + compatible = "zephyr,uac2-audio-streaming"; |
| 93 | + linked-terminal = <&in_terminal>; |
| 94 | + subslot-size = <2>; |
| 95 | + bit-resolution = <16>; |
| 96 | + }; |
| 97 | + }; |
| 98 | +}; |
| 99 | + |
| 100 | +/ { |
| 101 | + uac2_headphones: usb_audio2 { |
| 102 | + compatible = "zephyr,uac2"; |
| 103 | + status = "okay"; |
| 104 | + full-speed; |
| 105 | + audio-function = <AUDIO_FUNCTION_OTHER>; |
| 106 | + |
| 107 | + hp_uac_aclk: hp_aclk { |
| 108 | + compatible = "zephyr,uac2-clock-source"; |
| 109 | + clock-type = "internal-programmable"; |
| 110 | + frequency-control = "read-only"; |
| 111 | + sampling-frequencies = <48000>; |
| 112 | + sof-synchronized; |
| 113 | + }; |
| 114 | + |
| 115 | + hp_out_terminal: out_terminal { |
| 116 | + compatible = "zephyr,uac2-input-terminal"; |
| 117 | + clock-source = <&hp_uac_aclk>; |
| 118 | + terminal-type = <USB_TERMINAL_STREAMING>; |
| 119 | + front-left; |
| 120 | + front-right; |
| 121 | + }; |
| 122 | + |
| 123 | + hp_headphones_output: hp_headphones_output { |
| 124 | + compatible = "zephyr,uac2-output-terminal"; |
| 125 | + data-source = <&hp_out_terminal>; |
| 126 | + clock-source = <&hp_uac_aclk>; |
| 127 | + terminal-type = <OUTPUT_TERMINAL_HEADPHONES>; |
| 128 | + }; |
| 129 | + |
| 130 | + hp_as_iso_out: out_interface { |
| 131 | + compatible = "zephyr,uac2-audio-streaming"; |
| 132 | + linked-terminal = <&hp_out_terminal>; |
| 133 | + subslot-size = <2>; |
| 134 | + bit-resolution = <16>; |
| 135 | + }; |
46 | 136 | }; |
47 | 137 | }; |
48 | 138 |
|
|
0 commit comments