요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Pincontrol driver for RK805 Power management IC.
RK805 has 2 pins which can be configured as GPIO output only.
Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt>
for details of the common pinctrl bindings used by client devices,
including the meaning of the phrase "pin configuration node".
Optional Pinmux properties:
--------------------------
Following properties are required if default setting of pins are required
at boot.
- pinctrl-names: A pinctrl state named per <pinctrl-bindings.txt>.
- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per
<pinctrl-bindings.txt>.
The pin configurations are defined as child of the pinctrl states node. Each
sub-node have following properties:
Required properties:
------------------
- #gpio-cells: Should be two. The first cell is the pin number and the
second is the GPIO flags.
- gpio-controller: Marks the device node as a GPIO controller.
- pins: List of pins. Valid values of pins properties are: gpio0, gpio1.
First 2 properties must be added in the RK805 PMIC node, documented in
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
Optional properties:
-------------------
Following are optional properties defined as pinmux DT binding document
<pinctrl-bindings.txt>. Absence of properties will leave the configuration
on default.
function,
output-low,
output-high.
Valid values for function properties are: gpio.
There are also not customised properties for any GPIO.
Example:
--------
rk805: rk805@18 {
compatible = "rockchip,rk805";
...
gpio-controller;
#gpio-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int_l>, <&rk805_default>;
rk805_default: pinmux {
gpio01 {
pins = "gpio0", "gpio1";
function = "gpio";
output-high;
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
RK805 pinctrl과 default state
1-19RK805 PMIC에는 output 전용 GPIO pin 2개가 있습니다. 공통 pinctrl binding과 pin configuration node의 의미는 `devicetree/bindings/pinctrl/pinctrl-bindings.txt`를 참조합니다.
Boot 때 default 설정이 필요하면 `pinctrl-names`와 `pinctrl[0...n]`을 사용하고, 실제 pin configuration은 pinctrl state node의 child subnode로 정의합니다.
GPIO controller 필수 속성
20-31`#gpio-cells`는 2이며 첫 cell은 pin 번호, 두 번째는 GPIO flag입니다. `gpio-controller`는 node를 GPIO controller로 표시합니다. `pins`의 유효 값은 `gpio0`, `gpio1`입니다.
앞의 `#gpio-cells`와 `gpio-controller`는 `Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml`에 설명된 RK805 PMIC node에 추가해야 합니다.
선택적 pinmux 속성
32-44선택 속성은 `function`, `output-low`, `output-high`이며 생략하면 default configuration을 유지합니다. 유효한 function 값은 `gpio`뿐이고 어떤 GPIO에도 custom property는 없습니다.
RK805 GPIO output 예제
45-63PMIC node를 GPIO controller로 선언하고 default pinctrl state에서 GPIO0과 GPIO1을 GPIO function의 high output으로 설정합니다.
rk805: rk805@18 {
compatible = "rockchip,rk805";
...
gpio-controller;
#gpio-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int_l>, <&rk805_default>;
rk805_default: pinmux {
gpio01 {
pins = "gpio0", "gpio1";
function = "gpio";
output-high;
};
};
};
요약과 해설
pinctrl-rk805.txt:1-63GPIO controller cell 계약과 두 pin의 low·high output 설정 예제를 제공합니다.