요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Spreadtrum SC9860 Pin Controller
Please refer to sprd,pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: Must be "sprd,sc9860-pinctrl".
- reg: The register address of pin controller device.
- pins : An array of strings, each string containing the name of a pin.
Optional properties:
- function: A string containing the name of the function, values must be
one of: "func1", "func2", "func3" and "func4".
- drive-strength: Drive strength in mA. Supported values: 2, 4, 6, 8, 10,
12, 14, 16, 20, 21, 24, 25, 27, 29, 31 and 33.
- input-schmitt-disable: Enable schmitt-trigger mode.
- input-schmitt-enable: Disable schmitt-trigger mode.
- bias-disable: Disable pin bias.
- bias-pull-down: Pull down on pin.
- bias-pull-up: Pull up on pin. Supported values: 20000 for pull-up resistor
is 20K and 4700 for pull-up resistor is 4.7K.
- input-enable: Enable pin input.
- input-disable: Enable pin output.
- output-high: Set the pin as an output level high.
- output-low: Set the pin as an output level low.
- sleep-hardware-state: Indicate these configs in this state are sleep related.
- sprd,control: Control values referring to databook for global control pins.
- sprd,sleep-mode: Choose the pin sleep mode, and supported values are:
AP_SLEEP, PUBCP_SLEEP, TGLDSP_SLEEP and AGDSP_SLEEP.
Pin sleep mode definition:
enum pin_sleep_mode {
AP_SLEEP = BIT(0),
PUBCP_SLEEP = BIT(1),
TGLDSP_SLEEP = BIT(2),
AGDSP_SLEEP = BIT(3),
};
Example:
pin_controller: pinctrl@402a0000 {
compatible = "sprd,sc9860-pinctrl";
reg = <0x402a0000 0x10000>;
grp1: sd0 {
pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE";
sprd,control = <0x1>;
};
grp2: rfctl_33 {
pins = "SC9860_RFCTL33";
function = "func2";
sprd,sleep-mode = <AP_SLEEP | PUBCP_SLEEP>;
grp2_sleep_mode: rfctl_33_sleep {
pins = "SC9860_RFCTL33";
sleep-hardware-state;
output-low;
}
};
grp3: rfctl_misc_20 {
pins = "SC9860_RFCTL20_MISC";
drive-strength = <10>;
bias-pull-up = <4700>;
grp3_sleep_mode: rfctl_misc_sleep {
pins = "SC9860_RFCTL20_MISC";
sleep-hardware-state;
bias-pull-up;
}
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
SC9860 공통 binding과 필수 속성
1-10공통 binding과 사용법은 이 directory의 `sprd,pinctrl.txt`를 참조합니다. SC9860 pin controller의 필수 `compatible`은 `sprd,sc9860-pinctrl`이고 `reg`는 controller device의 register address입니다.
필수 `pins`는 string 배열이며 각 string은 pin 이름 하나를 담습니다.
선택 속성과 지원 값
11-30`function`은 function 이름 string이고 `func1`, `func2`, `func3`, `func4` 중 하나여야 합니다. `drive-strength`는 mA 단위이며 아래의 열여섯 값을 지원합니다. `bias-pull-up`은 20000이면 20K, 4700이면 4.7K pull-up resistor를 뜻합니다.
| Property | Supported values |
|---|---|
| function | func1, func2, func3, func4 |
| drive-strength | 2, 4, 6, 8, 10, 12, 14, 16, 20, 21, 24, 25, 27, 29, 31, 33 mA |
| bias-pull-up | 20000 (20K), 4700 (4.7K) |
| sprd,sleep-mode | AP_SLEEP, PUBCP_SLEEP, TGLDSP_SLEEP, AGDSP_SLEEP |
`bias-disable`, `bias-pull-down`, `input-enable`, `input-disable`, `output-high`, `output-low`은 각각 pin bias 비활성화, pull-down, input 활성화, output 활성화, output high, output low를 설정합니다. `sleep-hardware-state`는 해당 state의 설정이 sleep 관련임을 표시하고 `sprd,control`은 global-control pin의 databook 값을 지정합니다.
`sprd,sleep-mode`는 pin sleep mode를 고르며 AP, PUBCP, TGLDSP, AGDSP의 sleep 값을 지원합니다.
공통 문서와 마찬가지로 원문은 `input-schmitt-disable`을 Schmitt-trigger 활성화, `input-schmitt-enable`을 비활성화라고 설명합니다. 이 역전된 문구를 원문 그대로 반영했습니다.
Pin sleep mode 정의
31-38네 sleep mode는 각각 bit 0부터 bit 3까지의 flag로 정의되므로 bitwise OR로 여러 system을 동시에 선택할 수 있습니다.
enum pin_sleep_mode {
AP_SLEEP = BIT(0),
PUBCP_SLEEP = BIT(1),
TGLDSP_SLEEP = BIT(2),
AGDSP_SLEEP = BIT(3),
};
SC9860 pin group 예제
39-70`grp1`은 두 global-control field pin에 `sprd,control = <0x1>`을 적용합니다. `grp2`는 RFCTL33을 `func2`로 mux하고 AP와 PUBCP sleep mode에서 low output을 hardware가 적용하도록 합니다.
`grp3`은 RFCTL20_MISC에 10mA drive strength와 4.7K pull-up을 적용하고, sleep hardware state에서도 pull-up을 설정합니다.
pin_controller: pinctrl@402a0000 {
compatible = "sprd,sc9860-pinctrl";
reg = <0x402a0000 0x10000>;
grp1: sd0 {
pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE";
sprd,control = <0x1>;
};
grp2: rfctl_33 {
pins = "SC9860_RFCTL33";
function = "func2";
sprd,sleep-mode = <AP_SLEEP | PUBCP_SLEEP>;
grp2_sleep_mode: rfctl_33_sleep {
pins = "SC9860_RFCTL33";
sleep-hardware-state;
output-low;
}
};
grp3: rfctl_misc_20 {
pins = "SC9860_RFCTL20_MISC";
drive-strength = <10>;
bias-pull-up = <4700>;
grp3_sleep_mode: rfctl_misc_sleep {
pins = "SC9860_RFCTL20_MISC";
sleep-hardware-state;
bias-pull-up;
}
};
};
요약과 해설
sprd,sc9860-pinctrl.txt:1-70지원 값과 sleep bit flag를 정리하고 global·common·misc pin group 예제를 해설합니다.