요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
2. 영어 원문 전체
번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.
원문 전체 펼치기
* GPIO Decoder DT bindings
Required Properties:
- compatible: should be "gpio-decoder"
- gpios: a spec of gpios (at least two) to be decoded to a number with
first entry representing the MSB.
Optional Properties:
- decoder-max-value: Maximum possible value that can be reported by
the gpios.
- linux,axis: the input subsystem axis to map to (ABS_X/ABS_Y).
Defaults to 0 (ABS_X).
Example:
gpio-decoder0 {
compatible = "gpio-decoder";
gpios = <&pca9536 3 GPIO_ACTIVE_HIGH>,
<&pca9536 2 GPIO_ACTIVE_HIGH>,
<&pca9536 1 GPIO_ACTIVE_HIGH>,
<&pca9536 0 GPIO_ACTIVE_HIGH>;
linux,axis = <0>; /* ABS_X */
decoder-max-value = <9>;
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.
GPIO bit vector decoder
1-13GPIO Decoder의 필수 `compatible`은 `gpio-decoder`입니다. `gpios`에는 number로 decode할 GPIO specifier를 최소 두 개 넣으며 첫 entry가 MSB입니다. 선택 `decoder-max-value`는 GPIO가 보고할 수 있는 최대값입니다. `linux,axis`는 mapping할 input subsystem axis인 `ABS_X` 또는 `ABS_Y`이며 기본값 0은 `ABS_X`입니다.
첫 GPIO를 MSB로 해석해 여러 digital line을 하나의 axis value로 만듭니다.
4-bit ABS_X 예제
14-23예제는 PCA9536 GPIO 3, 2, 1, 0을 active-high 4-bit 값으로 decode합니다. `linux,axis = <0>`으로 ABS_X에 mapping하고 보고 가능한 최대값을 9로 제한합니다.
gpio-decoder0 {
compatible = "gpio-decoder";
gpios = <&pca9536 3 GPIO_ACTIVE_HIGH>,
<&pca9536 2 GPIO_ACTIVE_HIGH>,
<&pca9536 1 GPIO_ACTIVE_HIGH>,
<&pca9536 0 GPIO_ACTIVE_HIGH>;
linux,axis = <0>; /* ABS_X */
decoder-max-value = <9>;
};
요약과 해설
gpio-decoder.txt:1-23MSB-first GPIO ordering과 최대값 제한을 설명합니다.