요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
====================
ASoC Platform Driver
====================
An ASoC platform driver class can be divided into audio DMA drivers, SoC DAI
drivers and DSP drivers. The platform drivers only target the SoC CPU and must
have no board specific code.
Audio DMA
=========
The platform DMA driver optionally supports the following ALSA operations:-
::
/* SoC audio ops */
struct snd_soc_ops {
int (*startup)(struct snd_pcm_substream *);
void (*shutdown)(struct snd_pcm_substream *);
int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
int (*hw_free)(struct snd_pcm_substream *);
int (*prepare)(struct snd_pcm_substream *);
int (*trigger)(struct snd_pcm_substream *, int);
};
The platform driver exports its DMA functionality via struct
snd_soc_component_driver:-
::
struct snd_soc_component_driver {
const char *name;
...
int (*probe)(struct snd_soc_component *);
void (*remove)(struct snd_soc_component *);
int (*suspend)(struct snd_soc_component *);
int (*resume)(struct snd_soc_component *);
/* pcm creation and destruction */
int (*pcm_new)(struct snd_soc_pcm_runtime *);
void (*pcm_free)(struct snd_pcm *);
...
const struct snd_pcm_ops *ops;
const struct snd_compr_ops *compr_ops;
...
};
Please refer to the :doc:`ALSA driver documentation
<../kernel-api/writing-an-alsa-driver>` for details of audio DMA.
An example DMA driver is soc/pxa/pxa2xx-pcm.c
SoC DAI Drivers
===============
Each SoC DAI driver must provide the following features:-
1. Digital audio interface (DAI) description
2. Digital audio interface configuration
3. PCM's description
4. SYSCLK configuration
5. Suspend and resume (optional)
Please see codec.rst for a description of items 1 - 4.
SoC DSP Drivers
===============
Each SoC DSP driver usually supplies the following features :-
1. DAPM graph
2. Mixer controls
3. DMA IO to/from DSP buffers (if applicable)
4. Definition of DSP front end (FE) PCM devices.
Please see DPCM.txt for a description of item 4.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
플랫폼 드라이버의 범위
1-7ASoC 플랫폼 드라이버 클래스는 오디오 DMA 드라이버, SoC DAI 드라이버, DSP 드라이버로 나눌 수 있다. 플랫폼 드라이버는 SoC CPU만을 대상으로 하며 보드에 종속된 코드를 포함해서는 안 된다.
플랫폼 드라이버 내부의 역할을 구분한다.
플랫폼 드라이버는 SoC 공통 기능까지만 담당한다.
====================
ASoC Platform Driver
====================
An ASoC platform driver class can be divided into audio DMA drivers, SoC DAI
drivers and DSP drivers. The platform drivers only target the SoC CPU and must
have no board specific code.
오디오 DMA 연산과 구성 요소 드라이버
8-52플랫폼 DMA 드라이버는 선택적으로 다음 ALSA 연산을 지원한다. `struct snd_soc_ops`의 `startup`은 스트림 시작 준비, `shutdown`은 스트림 종료 정리, `hw_params`는 하드웨어 매개변수 적용, `hw_free`는 할당된 하드웨어 자원 해제, `prepare`는 실행 직전 준비, `trigger`는 시작·정지 같은 스트림 명령 처리를 맡는다.
플랫폼 DMA 드라이버가 선택적으로 제공하는 ALSA 연산이다.
플랫폼 드라이버는 `struct snd_soc_component_driver`를 통해 DMA 기능을 내보낸다. `name`은 구성 요소 이름이며 `probe`와 `remove`는 구성 요소의 초기화와 제거를, `suspend`와 `resume`은 전원 관리 전환을 담당한다.
PCM 생성과 파괴를 위한 `pcm_new`와 `pcm_free`도 제공할 수 있다. `ops`는 일반 PCM 연산을 담은 `struct snd_pcm_ops`를, `compr_ops`는 압축 오디오 연산을 담은 `struct snd_compr_ops`를 가리킨다. 생략 부호로 표시된 다른 필드도 구조체에 존재하지만 원문은 DMA 설명에 필요한 부분만 발췌한다.
원문에 제시된 필드를 수명 주기별로 정리한다.
오디오 DMA의 자세한 내용은 `../kernel-api/writing-an-alsa-driver`의 ALSA 드라이버 문서를 참조한다. DMA 드라이버 예제는 `soc/pxa/pxa2xx-pcm.c`이다.
스트림 연산과 구성 요소 연산을 통해 SoC DMA 기능이 ASoC에 연결된다.
Audio DMA
=========
The platform DMA driver optionally supports the following ALSA operations:-
::
/* SoC audio ops */
struct snd_soc_ops {
int (*startup)(struct snd_pcm_substream *);
void (*shutdown)(struct snd_pcm_substream *);
int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
int (*hw_free)(struct snd_pcm_substream *);
int (*prepare)(struct snd_pcm_substream *);
int (*trigger)(struct snd_pcm_substream *, int);
};
The platform driver exports its DMA functionality via struct
snd_soc_component_driver:-
::
struct snd_soc_component_driver {
const char *name;
...
int (*probe)(struct snd_soc_component *);
void (*remove)(struct snd_soc_component *);
int (*suspend)(struct snd_soc_component *);
int (*resume)(struct snd_soc_component *);
/* pcm creation and destruction */
int (*pcm_new)(struct snd_soc_pcm_runtime *);
void (*pcm_free)(struct snd_pcm *);
...
const struct snd_pcm_ops *ops;
const struct snd_compr_ops *compr_ops;
...
};
Please refer to the :doc:`ALSA driver documentation
<../kernel-api/writing-an-alsa-driver>` for details of audio DMA.
An example DMA driver is soc/pxa/pxa2xx-pcm.c
SoC DAI 드라이버가 제공할 기능
53-66각 SoC DAI 드라이버는 Digital Audio Interface(DAI) 설명, DAI 구성, PCM 설명, SYSCLK 구성 기능을 제공해야 한다. 일시 중단과 복귀 기능은 선택 사항이다.
첫 번째부터 네 번째 항목의 설명은 `codec.rst`를 참조한다. 플랫폼 DAI는 코덱 DAI와 같은 형식의 능력과 설정 계약을 제공하되, SoC 쪽 디지털 오디오 인터페이스를 구현한다.
원문 목록의 필수 여부를 보존해 정리한다.
SoC와 코덱의 DAI 능력이 스트림 매개변수에 맞게 연결된다.
SoC DAI Drivers
===============
Each SoC DAI driver must provide the following features:-
1. Digital audio interface (DAI) description
2. Digital audio interface configuration
3. PCM's description
4. SYSCLK configuration
5. Suspend and resume (optional)
Please see codec.rst for a description of items 1 - 4.
SoC DSP 드라이버가 제공할 기능
67-78각 SoC DSP 드라이버는 일반적으로 DAPM 그래프, 믹서 제어, 적용 가능한 경우 DSP 버퍼로 들어가고 나오는 DMA 입출력, DSP 프런트엔드(FE) PCM 장치 정의를 제공한다.
네 번째 항목에 관한 설명은 원문이 가리키는 `DPCM.txt`를 참조한다. 이 문서에서는 원문의 파일명을 그대로 보존하며, FE PCM 장치는 DSP 경로의 사용자 측 스트림 종단을 정의한다.
DSP 플랫폼 드라이버의 일반적인 네 가지 책임이다.
프런트엔드 PCM에서 DSP 처리와 DMA를 거쳐 뒷단으로 이어지는 개념적 흐름이다.
SoC DSP Drivers
===============
Each SoC DSP driver usually supplies the following features :-
1. DAPM graph
2. Mixer controls
3. DMA IO to/from DSP buffers (if applicable)
4. Definition of DSP front end (FE) PCM devices.
Please see DPCM.txt for a description of item 4.
요약·해설
platform.rst:1-78ASoC 플랫폼 드라이버를 오디오 DMA, SoC DAI, DSP 영역으로 나누고 `snd_soc_ops`와 `snd_soc_component_driver`의 콜백 및 필드를 설명합니다. DAI와 DSP가 제공해야 할 기능, PCM·SYSCLK·DAPM·FE 경로를 원문 코드와 경로를 보존해 정리합니다.