요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Kernel driver g762
==================
The GMT G762 Fan Speed PWM Controller is connected directly to a fan
and performs closed-loop or open-loop control of the fan speed. Two
modes - PWM or DC - are supported by the device.
For additional information, a detailed datasheet is available at
http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf. sysfs
bindings are described in Documentation/hwmon/sysfs-interface.rst.
The following entries are available to the user in a subdirectory of
/sys/bus/i2c/drivers/g762/ to control the operation of the device.
This can be done manually using the following entries but is usually
done via a userland daemon like fancontrol.
Note that those entries do not provide ways to setup the specific
hardware characteristics of the system (reference clock, pulses per
fan revolution, ...); Those can be modified via devicetree bindings
documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml or
using a specific platform_data structure in board initialization
file (see include/linux/platform_data/g762.h).
fan1_target:
set desired fan speed. This only makes sense in closed-loop
fan speed control (i.e. when pwm1_enable is set to 2).
fan1_input:
provide current fan rotation value in RPM as reported by
the fan to the device.
fan1_div:
fan clock divisor. Supported value are 1, 2, 4 and 8.
fan1_pulses:
number of pulses per fan revolution. Supported values
are 2 and 4.
fan1_fault:
reports fan failure, i.e. no transition on fan gear pin for
about 0.7s (if the fan is not voluntarily set off).
fan1_alarm:
in closed-loop control mode, if fan RPM value is 25% out
of the programmed value for over 6 seconds 'fan1_alarm' is
set to 1.
pwm1_enable:
set current fan speed control mode i.e. 1 for manual fan
speed control (open-loop) via pwm1 described below, 2 for
automatic fan speed control (closed-loop) via fan1_target
above.
pwm1_mode:
set or get fan driving mode: 1 for PWM mode, 0 for DC mode.
pwm1:
get or set PWM fan control value in open-loop mode. This is an
integer value between 0 and 255. 0 stops the fan, 255 makes
it run at full speed.
Both in PWM mode ('pwm1_mode' set to 1) and DC mode ('pwm1_mode' set to 0),
when current fan speed control mode is open-loop ('pwm1_enable' set to 1),
the fan speed is programmed by setting a value between 0 and 255 via 'pwm1'
entry (0 stops the fan, 255 makes it run at full speed). In closed-loop mode
('pwm1_enable' set to 2), the expected rotation speed in RPM can be passed to
the chip via 'fan1_target'. In closed-loop mode, the target speed is compared
with current speed (available via 'fan1_input') by the device and a feedback
is performed to match that target value. The fan speed value is computed
based on the parameters associated with the physical characteristics of the
system: a reference clock source frequency, a number of pulses per fan
revolution, etc.
Note that the driver will update its values at most once per second.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
G762 제어 방식과 hardware 설정
1-23GMT G762 Fan Speed PWM Controller는 fan에 직접 연결되어 closed-loop 또는 open-loop로 fan speed를 제어합니다. 장치는 PWM과 DC 두 drive mode를 지원합니다.
상세 datasheet는 `http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf`에 있으며 sysfs binding은 `Documentation/hwmon/sysfs-interface.rst`에 설명되어 있습니다. 사용자는 `/sys/bus/i2c/drivers/g762/` 아래 항목으로 직접 제어할 수 있지만 보통 `fancontrol` 같은 userspace daemon이 사용합니다.
이 sysfs 항목으로 reference clock, 회전당 pulse 수 같은 system hardware 특성을 설정할 수는 없습니다. 해당 값은 `Documentation/devicetree/bindings/hwmon/gmt,g762.yaml`의 devicetree binding 또는 board 초기화 파일의 `include/linux/platform_data/g762.h` platform data로 지정합니다.
Runtime control과 물리 hardware 설정의 경계를 구분합니다.
물리 특성을 먼저 정한 뒤 runtime 제어를 엽니다.
Kernel driver g762
==================
The GMT G762 Fan Speed PWM Controller is connected directly to a fan
and performs closed-loop or open-loop control of the fan speed. Two
modes - PWM or DC - are supported by the device.
For additional information, a detailed datasheet is available at
http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf. sysfs
bindings are described in Documentation/hwmon/sysfs-interface.rst.
The following entries are available to the user in a subdirectory of
/sys/bus/i2c/drivers/g762/ to control the operation of the device.
This can be done manually using the following entries but is usually
done via a userland daemon like fancontrol.
Note that those entries do not provide ways to setup the specific
hardware characteristics of the system (reference clock, pulses per
fan revolution, ...); Those can be modified via devicetree bindings
documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml or
using a specific platform_data structure in board initialization
file (see include/linux/platform_data/g762.h).
G762 sysfs attribute
24-60`fan1_target`은 원하는 fan speed를 설정하며 `pwm1_enable=2`인 closed-loop에서만 의미가 있습니다. `fan1_input`은 장치가 보고하는 현재 RPM입니다. `fan1_div`는 1·2·4·8 중 fan clock divisor이고 `fan1_pulses`는 회전당 2 또는 4 pulse입니다.
`fan1_fault`는 fan이 의도적으로 꺼진 상태가 아닐 때 약 0.7초 동안 fan gear pin transition이 없으면 failure를 보고합니다. Closed-loop에서 실제 RPM이 programmed 값에서 25% 이상 벗어난 상태가 6초 넘게 지속되면 `fan1_alarm=1`이 됩니다.
`pwm1_enable=1`은 `pwm1`을 쓰는 manual open-loop, `2`는 `fan1_target`을 쓰는 automatic closed-loop입니다. `pwm1_mode=1`은 PWM drive, `0`은 DC drive입니다. Open-loop의 `pwm1`은 0~255이며 0은 정지, 255는 full speed입니다.
Fan feedback과 drive mode를 함께 제어합니다.
목표와 실제 속도의 지속 편차를 감시합니다.
fan1_target:
set desired fan speed. This only makes sense in closed-loop
fan speed control (i.e. when pwm1_enable is set to 2).
fan1_input:
provide current fan rotation value in RPM as reported by
the fan to the device.
fan1_div:
fan clock divisor. Supported value are 1, 2, 4 and 8.
fan1_pulses:
number of pulses per fan revolution. Supported values
are 2 and 4.
fan1_fault:
reports fan failure, i.e. no transition on fan gear pin for
about 0.7s (if the fan is not voluntarily set off).
fan1_alarm:
in closed-loop control mode, if fan RPM value is 25% out
of the programmed value for over 6 seconds 'fan1_alarm' is
set to 1.
pwm1_enable:
set current fan speed control mode i.e. 1 for manual fan
speed control (open-loop) via pwm1 described below, 2 for
automatic fan speed control (closed-loop) via fan1_target
above.
pwm1_mode:
set or get fan driving mode: 1 for PWM mode, 0 for DC mode.
pwm1:
get or set PWM fan control value in open-loop mode. This is an
integer value between 0 and 255. 0 stops the fan, 255 makes
it run at full speed.
Open-loop·closed-loop와 update 주기
61-74PWM mode와 DC mode 모두 `pwm1_enable=1` open-loop에서는 `pwm1`의 0~255 값으로 속도를 programming합니다. 0은 fan 정지이고 255는 full speed입니다.
`pwm1_enable=2` closed-loop에서는 기대 RPM을 `fan1_target`에 씁니다. 장치가 이를 `fan1_input` 현재 속도와 비교하고 feedback을 수행해 target에 맞춥니다. 속도 계산에는 reference clock frequency와 회전당 pulse 수 같은 물리 parameter가 사용됩니다.
드라이버 값은 최대 초당 한 번만 갱신됩니다.
Drive method와 별개로 control loop를 선택합니다.
물리 parameter를 반영한 RPM으로 target을 추종합니다.
Both in PWM mode ('pwm1_mode' set to 1) and DC mode ('pwm1_mode' set to 0),
when current fan speed control mode is open-loop ('pwm1_enable' set to 1),
the fan speed is programmed by setting a value between 0 and 255 via 'pwm1'
entry (0 stops the fan, 255 makes it run at full speed). In closed-loop mode
('pwm1_enable' set to 2), the expected rotation speed in RPM can be passed to
the chip via 'fan1_target'. In closed-loop mode, the target speed is compared
with current speed (available via 'fan1_input') by the device and a feedback
is performed to match that target value. The fan speed value is computed
based on the parameters associated with the physical characteristics of the
system: a reference clock source frequency, a number of pulses per fan
revolution, etc.
Note that the driver will update its values at most once per second.
요약·해설
g762.rst:1-74Hardware clock·pulse 설정과 runtime fan feedback interface를 구분합니다.
원문 분량과 핵심 범위입니다.
장치 동작의 기본 순서입니다.