← Documents Documentation/devicetree/bindings/sound/tdm-slot.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Sound

ASoC TDM slot

TDM slot 수·폭·TX/RX mask와 translation callback 규칙을 설명합니다.

Source pathDocumentation/devicetree/bindings/sound/tdm-slot.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

tdm-slot.txt:1-29

TDM slot 수·폭·TX/RX mask와 translation callback 규칙을 설명합니다. 영어 원문 전체와 줄 좌표를 보존하고 한국어 전문 번역에서는 property·callback·pin·phandle·수치와 예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 TDM slot:
2
3 This specifies audio DAI's TDM slot.
4
5 TDM slot properties:
6 dai-tdm-slot-num : Number of slots in use.
7 dai-tdm-slot-width : Width in bits for each slot.
8 dai-tdm-slot-tx-mask : Transmit direction slot mask, optional
9 dai-tdm-slot-rx-mask : Receive direction slot mask, optional
10
11 For instance:
12 dai-tdm-slot-num = <2>;
13 dai-tdm-slot-width = <8>;
14 dai-tdm-slot-tx-mask = <0 1>;
15 dai-tdm-slot-rx-mask = <1 0>;
16
17 And for each specified driver, there could be one .of_xlate_tdm_slot_mask()
18 to specify an explicit mapping of the channels and the slots. If it's absent
19 the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the
20 tx and rx masks.
21
22 For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit
23 for an active slot as default, and the default active bits are at the LSB of
24 the masks.
25
26 The explicit masks are given as array of integers, where the first
27 number presents bit-0 (LSB), second presents bit-1, etc. Any non zero
28 number is considered 1 and 0 is 0. snd_soc_of_xlate_tdm_slot_mask()
29 does not do anything, if either mask is set non zero value.
30

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

TDM slot 속성

1-10

Audio DAI의 TDM slot은 `dai-tdm-slot-num`으로 사용 slot 수, `dai-tdm-slot-width`로 각 slot bit width를 지정합니다. 선택 `dai-tdm-slot-tx-mask`와 `dai-tdm-slot-rx-mask`는 transmit·receive slot mask입니다.

2-slot 8-bit mask 예제

11-15

예제는 8-bit slot 2개에서 TX는 slot 1, RX는 slot 0을 활성화합니다.

dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <8>;
dai-tdm-slot-tx-mask = <0 1>;
dai-tdm-slot-rx-mask = <1 0>;

Driver mask translation 규칙

16-29

Driver는 `.of_xlate_tdm_slot_mask()`로 channel과 slot의 explicit mapping을 제공할 수 있습니다. 없으면 기본 `snd_soc_of_xlate_tdm_slot_mask()`가 TX/RX mask를 생성합니다.

기본 함수는 active slot을 1-bit로 나타내고 LSB부터 활성 bit를 배치합니다. Explicit mask는 integer 배열이며 첫 수가 bit 0(LSB), 둘째가 bit 1입니다. 0이 아닌 값은 1로 취급됩니다. TX 또는 RX mask가 이미 non-zero이면 `snd_soc_of_xlate_tdm_slot_mask()`는 아무 작업도 하지 않습니다.