요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* ams AS3722 Power management IC.
Required properties:
-------------------
- compatible: Must be "ams,as3722".
- reg: I2C device address.
- interrupt-controller: AS3722 has internal interrupt controller which takes the
interrupt request from internal sub-blocks like RTC, regulators, GPIOs as well
as external input.
- #interrupt-cells: Should be set to 2 for IRQ number and flags.
The first cell is the IRQ number. IRQ numbers for different interrupt source
of AS3722 are defined at dt-bindings/mfd/as3722.h
The second cell is the flags, encoded as the trigger masks from binding document
interrupts.txt, using dt-bindings/irq.
Optional properties:
--------------------
- ams,enable-internal-int-pullup: Boolean property, to enable internal pullup on
interrupt pin. Missing this will disable internal pullup on INT pin.
- ams,enable-internal-i2c-pullup: Boolean property, to enable internal pullup on
i2c scl/sda pins. Missing this will disable internal pullup on i2c
scl/sda lines.
- ams,enable-ac-ok-power-on: Boolean property, to enable exit out of power off
mode with AC_OK pin (pin enabled in power off mode).
Optional submodule and their properties:
=======================================
Pinmux and GPIO:
===============
Device has 8 GPIO pins which can be configured as GPIO as well as the special IO
functions.
Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".
Following are properties which is needed if GPIO and pinmux functionality
is required:
Required properties:
-------------------
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Number of GPIO cells. Refer to binding document
gpio/gpio.txt
Optional properties:
--------------------
Following properties are require if pin control setting is required
at boot.
- pinctrl-names: A pinctrl state named "default" be defined, using the
bindings in pinctrl/pinctrl-bindings.txt.
- pinctrl[0...n]: Properties to contain the phandle that refer to
different nodes of pin control settings. These nodes represents
the pin control setting of state 0 to state n. Each of these
nodes contains different subnodes to represents some desired
configuration for a list of pins. This configuration can
include the mux function to select on those pin(s), and
various pin configuration parameters, such as pull-up,
open drain.
Each subnode have following properties:
Required properties:
- pins: List of pins. Valid values of pins properties are:
gpio0, gpio1, gpio2, gpio3, gpio4, gpio5,
gpio6, gpio7
Optional properties:
function, bias-disable, bias-pull-up, bias-pull-down,
bias-high-impedance, drive-open-drain.
Valid values for function properties are:
gpio, interrupt-out, gpio-in-interrupt,
vsup-vbat-low-undebounce-out,
vsup-vbat-low-debounce-out,
voltage-in-standby, oc-pg-sd0, oc-pg-sd6,
powergood-out, pwm-in, pwm-out, clk32k-out,
watchdog-in, soft-reset-in
Regulators:
===========
Device has multiple DCDC and LDOs. The node "regulators" is require if regulator
functionality is needed.
Following are properties of regulator subnode.
Optional properties:
-------------------
The input supply of regulators are the optional properties on the
regulator node. The input supply of these regulators are provided
through following properties:
vsup-sd2-supply: Input supply for SD2.
vsup-sd3-supply: Input supply for SD3.
vsup-sd4-supply: Input supply for SD4.
vsup-sd5-supply: Input supply for SD5.
vin-ldo0-supply: Input supply for LDO0.
vin-ldo1-6-supply: Input supply for LDO1 and LDO6.
vin-ldo2-5-7-supply: Input supply for LDO2, LDO5 and LDO7.
vin-ldo3-4-supply: Input supply for LDO3 and LDO4.
vin-ldo9-10-supply: Input supply for LDO9 and LDO10.
vin-ldo11-supply: Input supply for LDO11.
Optional sub nodes for regulators:
---------------------------------
The subnodes name is the name of regulator and it must be one of:
sd[0-6], ldo[0-7], ldo[9-11]
Each sub-node should contain the constraints and initialization
information for that regulator. See regulator.txt for a description
of standard properties for these sub-nodes.
Additional optional custom properties are listed below.
ams,ext-control: External control of the rail. The option of
this properties will tell which external input is
controlling this rail. Valid values are 0, 1, 2 ad 3.
0: There is no external control of this rail.
1: Rail is controlled by ENABLE1 input pin.
2: Rail is controlled by ENABLE2 input pin.
3: Rail is controlled by ENABLE3 input pin.
Missing this property on DT will be assume as no
external control. The external control pin macros
are defined @dt-bindings/mfd/as3722.h
ams,enable-tracking: Enable tracking with SD1, only supported
by LDO3.
Power-off:
=========
AS3722 supports the system power off by turning off all its rails.
The device node should have the following properties to enable this
functionality
ams,system-power-controller: Boolean, to enable the power off functionality
through this device.
Example:
--------
#include <dt-bindings/mfd/as3722.h>
...
ams3722 {
compatible = "ams,as3722";
reg = <0x48>;
ams,system-power-controller;
interrupt-parent = <&intc>;
interrupt-controller;
#interrupt-cells = <2>;
gpio-controller;
#gpio-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&as3722_default>;
as3722_default: pinmux {
gpio0 {
pins = "gpio0";
function = "gpio";
bias-pull-down;
};
gpio1_2_4_7 {
pins = "gpio1", "gpio2", "gpio4", "gpio7";
function = "gpio";
bias-pull-up;
};
gpio5 {
pins = "gpio5";
function = "clk32k_out";
};
}
regulators {
vsup-sd2-supply = <...>;
...
sd0 {
regulator-name = "vdd_cpu";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1400000>;
regulator-always-on;
ams,ext-control = <2>;
};
sd1 {
regulator-name = "vdd_core";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1400000>;
regulator-always-on;
ams,ext-control = <1>;
};
sd2 {
regulator-name = "vddio_ddr";
regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
};
sd4 {
regulator-name = "avdd-hdmi-pex";
regulator-min-microvolt = <1050000>;
regulator-max-microvolt = <1050000>;
regulator-always-on;
};
sd5 {
regulator-name = "vdd-1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
....
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ams AS3722 전원 관리 IC
1-2AS3722는 ams의 전원 관리 IC로 regulator, RTC, GPIO와 외부 입력의 인터럽트를 통합합니다.
I2C PMIC가 내부 interrupt controller, 8개 pinmux/GPIO, 여러 DCDC·LDO와 system power-off를 제공합니다.
필수 상위 속성
3-15`compatible`은 `ams,as3722`, `reg`는 I2C 장치 주소입니다. `interrupt-controller`는 AS3722가 RTC, regulator, GPIO 같은 내부 sub-block과 외부 입력의 요청을 받는 내부 interrupt controller임을 표시합니다.
`#interrupt-cells`는 IRQ 번호와 flag를 위해 2입니다. 첫 cell은 `dt-bindings/mfd/as3722.h`에 정의된 AS3722 interrupt source의 IRQ 번호입니다. 둘째 cell은 `dt-bindings/irq`를 사용해 `interrupts.txt`의 trigger mask로 인코딩한 flag입니다.
내부 pull-up과 AC_OK 기동
16-25불리언 `ams,enable-internal-int-pullup`은 interrupt pin의 내부 pull-up을 켭니다. 없으면 INT pin pull-up을 끕니다. `ams,enable-internal-i2c-pullup`은 I2C SCL/SDA 내부 pull-up을 켜며 없으면 두 선의 pull-up을 끕니다.
`ams,enable-ac-ok-power-on`은 power-off mode에서 AC_OK pin을 활성화해 그 pin으로 power-off mode를 빠져나오도록 합니다.
Pinmux와 GPIO 개요
26-37AS3722의 GPIO pin 8개는 일반 GPIO 또는 special I/O function으로 구성할 수 있습니다. 클라이언트 장치가 쓰는 공통 pinctrl 바인딩과 `pin configuration node`의 의미는 이 디렉터리의 `pinctrl-bindings.txt`를 참조합니다.
GPIO controller와 pin 설정
38-78GPIO 및 pinmux 기능이 필요하면 `gpio-controller`와 `#gpio-cells`가 필수입니다. GPIO cell 형식은 `gpio/gpio.txt`를 따릅니다. 부팅 때 pin control 설정이 필요하면 `pinctrl-names`에 `default` 상태를 정의하고 `pinctrl[0...n]`에 상태 0부터 n까지 각 설정 노드의 phandle을 넣습니다.
각 설정 노드는 pin 목록별 subnode를 가지며 mux function과 pull-up, open-drain 같은 구성을 지정합니다. subnode의 필수 `pins`에는 `gpio0`부터 `gpio7`까지를 사용할 수 있습니다. 선택 속성은 `function`, `bias-disable`, `bias-pull-up`, `bias-pull-down`, `bias-high-impedance`, `drive-open-drain`입니다.
원문이 허용하는 GPIO 및 special I/O function을 기능별로 정리했습니다.
Regulator supply와 외부 제어
79-124장치에는 여러 DCDC와 LDO가 있습니다. regulator 기능이 필요하면 `regulators` 노드가 필요합니다. regulator 입력 전원은 regulator 노드의 선택 속성입니다.
각 supply 속성이 공급하는 SD 또는 LDO rail입니다.
regulator subnode 이름은 `sd[0-6]`, `ldo[0-7]`, `ldo[9-11]` 중 하나여야 합니다. 각 노드는 해당 regulator의 constraint와 초기화 정보를 담으며 표준 속성은 `regulator.txt`를 따릅니다.
`ams,ext-control`은 rail을 제어하는 외부 입력을 선택합니다. 0은 외부 제어 없음, 1은 ENABLE1, 2는 ENABLE2, 3은 ENABLE3 pin입니다. 생략하면 외부 제어가 없다고 간주하며 매크로는 `dt-bindings/mfd/as3722.h`에 있습니다. `ams,enable-tracking`은 SD1 tracking을 켜며 LDO3에서만 지원됩니다.
System power-off
125-132AS3722는 모든 rail을 꺼 시스템 전원을 차단할 수 있습니다. 장치 노드에 불리언 `ams,system-power-controller`를 두면 이 장치를 통한 power-off 기능을 활성화합니다.
Pinmux와 regulator 예제
133-214예제는 헤더 `dt-bindings/mfd/as3722.h`를 포함하고 I2C 주소 `0x48`, system power controller, 두 interrupt cell과 두 GPIO cell을 지정합니다. GPIO0은 pull-down GPIO, GPIO1·2·4·7은 pull-up GPIO, GPIO5는 32kHz clock output입니다.
regulator 예제에서 SD0은 ENABLE2, SD1은 ENABLE1 외부 입력으로 제어됩니다. SD0·SD1은 0.7~1.4V, SD2는 1.35V, SD4는 1.05V, SD5는 1.8V로 항상 켜집니다. 원문의 `...`와 `....` 생략 표기는 그대로 보존합니다.
#include <dt-bindings/mfd/as3722.h>
...
ams3722 {
compatible = "ams,as3722";
reg = <0x48>;
ams,system-power-controller;
interrupt-parent = <&intc>;
interrupt-controller;
#interrupt-cells = <2>;
gpio-controller;
#gpio-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&as3722_default>;
as3722_default: pinmux {
gpio0 {
pins = "gpio0";
function = "gpio";
bias-pull-down;
};
gpio1_2_4_7 {
pins = "gpio1", "gpio2", "gpio4", "gpio7";
function = "gpio";
bias-pull-up;
};
gpio5 {
pins = "gpio5";
function = "clk32k_out";
};
}
regulators {
vsup-sd2-supply = <...>;
...
sd0 {
regulator-name = "vdd_cpu";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1400000>;
regulator-always-on;
ams,ext-control = <2>;
};
sd1 {
regulator-name = "vdd_core";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1400000>;
regulator-always-on;
ams,ext-control = <1>;
};
sd2 {
regulator-name = "vddio_ddr";
regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;
};
sd4 {
regulator-name = "avdd-hdmi-pex";
regulator-min-microvolt = <1050000>;
regulator-max-microvolt = <1050000>;
regulator-always-on;
};
sd5 {
regulator-name = "vdd-1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
....
};
};
요약과 해설
as3722.txt:1-214Pin function, regulator supply와 외부 ENABLE 제어를 설명합니다.