← Documents Documentation/hwmon/g762.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver g762

G762의 PWM·DC 및 open-loop·closed-loop fan speed 제어입니다.

Source pathDocumentation/hwmon/g762.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

g762.rst:1-74

Hardware clock·pulse 설정과 runtime fan feedback interface를 구분합니다.

문서 개요
항목
SourceDocumentation/hwmon/g762.rst
분량74 source lines
DrivePWM·DC
Update최대 1회/초

원문 분량과 핵심 범위입니다.

핵심 흐름
물리 parameter 설정Loop 선택Target·PWM 입력RPM feedback

장치 동작의 기본 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 Kernel driver g762
2 ==================
3
4 The GMT G762 Fan Speed PWM Controller is connected directly to a fan
5 and performs closed-loop or open-loop control of the fan speed. Two
6 modes - PWM or DC - are supported by the device.
7
8 For additional information, a detailed datasheet is available at
9 http://natisbad.org/NAS/ref/GMT_EDS-762_763-080710-0.2.pdf. sysfs
10 bindings are described in Documentation/hwmon/sysfs-interface.rst.
11
12 The following entries are available to the user in a subdirectory of
13 /sys/bus/i2c/drivers/g762/ to control the operation of the device.
14 This can be done manually using the following entries but is usually
15 done via a userland daemon like fancontrol.
16
17 Note that those entries do not provide ways to setup the specific
18 hardware characteristics of the system (reference clock, pulses per
19 fan revolution, ...); Those can be modified via devicetree bindings
20 documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml or
21 using a specific platform_data structure in board initialization
22 file (see include/linux/platform_data/g762.h).
23
24 fan1_target:
25 set desired fan speed. This only makes sense in closed-loop
26 fan speed control (i.e. when pwm1_enable is set to 2).
27
28 fan1_input:
29 provide current fan rotation value in RPM as reported by
30 the fan to the device.
31
32 fan1_div:
33 fan clock divisor. Supported value are 1, 2, 4 and 8.
34
35 fan1_pulses:
36 number of pulses per fan revolution. Supported values
37 are 2 and 4.
38
39 fan1_fault:
40 reports fan failure, i.e. no transition on fan gear pin for
41 about 0.7s (if the fan is not voluntarily set off).
42
43 fan1_alarm:
44 in closed-loop control mode, if fan RPM value is 25% out
45 of the programmed value for over 6 seconds 'fan1_alarm' is
46 set to 1.
47
48 pwm1_enable:
49 set current fan speed control mode i.e. 1 for manual fan
50 speed control (open-loop) via pwm1 described below, 2 for
51 automatic fan speed control (closed-loop) via fan1_target
52 above.
53
54 pwm1_mode:
55 set or get fan driving mode: 1 for PWM mode, 0 for DC mode.
56
57 pwm1:
58 get or set PWM fan control value in open-loop mode. This is an
59 integer value between 0 and 255. 0 stops the fan, 255 makes
60 it run at full speed.
61
62 Both in PWM mode ('pwm1_mode' set to 1) and DC mode ('pwm1_mode' set to 0),
63 when current fan speed control mode is open-loop ('pwm1_enable' set to 1),
64 the fan speed is programmed by setting a value between 0 and 255 via 'pwm1'
65 entry (0 stops the fan, 255 makes it run at full speed). In closed-loop mode
66 ('pwm1_enable' set to 2), the expected rotation speed in RPM can be passed to
67 the chip via 'fan1_target'. In closed-loop mode, the target speed is compared
68 with current speed (available via 'fan1_input') by the device and a feedback
69 is performed to match that target value. The fan speed value is computed
70 based on the parameters associated with the physical characteristics of the
71 system: a reference clock source frequency, a number of pulses per fan
72 revolution, etc.
73
74 Note that the driver will update its values at most once per second.
75

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

G762 제어 방식과 hardware 설정

1-23

GMT 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로 지정합니다.

G762 구성 계층
계층설정위치
RuntimeTarget·mode·PWM/sys/bus/i2c/drivers/g762/
Userspace자동 fan policyfancontrol
FirmwareClock·pulse/revolutiongmt,g762.yaml
Board codeClock·pulse/revolutionplatform_data/g762.h

Runtime control과 물리 hardware 설정의 경계를 구분합니다.

G762 초기화
Reference clock 지정Pulses/revolution 지정PWM 또는 DC mode 구성Sysfs attribute 등록fancontrol 연결

물리 특성을 먼저 정한 뒤 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입니다.

G762 sysfs
Attribute값·권한의미
fan1_targetRPMClosed-loop 목표
fan1_inputRPM현재 회전 속도
fan1_div1, 2, 4, 8Fan clock divisor
fan1_pulses2, 4Pulses/revolution
fan1_fault0/1약 0.7초 transition 없음
fan1_alarm0/125% 편차가 6초 초과
pwm1_enable1=open, 2=closedControl loop
pwm1_mode1=PWM, 0=DCDrive method
pwm10..255Open-loop output

Fan feedback과 drive mode를 함께 제어합니다.

Closed-loop alarm
fan1_target 설정fan1_input 측정편차 25% 계산6초 지속 여부 확인fan1_alarm 설정

목표와 실제 속도의 지속 편차를 감시합니다.

  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-74

PWM 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가 사용됩니다.

드라이버 값은 최대 초당 한 번만 갱신됩니다.

G762 loop 비교
Loop입력Feedback범위
Open-looppwm1없음0..255
Closed-loopfan1_targetfan1_inputRPM
Update--최대 1회/초

Drive method와 별개로 control loop를 선택합니다.

Closed-loop feedback
Target RPM 입력Pulse period 측정Clock·pulse 수로 RPM 계산Target과 비교Drive output 보정

물리 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.