← Documents Documentation/hwmon/pwm-fan.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver pwm-fan

일반 PWM API로 팬을 제어하고 선택적 타코미터의 1초 샘플에서 RPM을 계산합니다.

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

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

1. 요약·해설

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

요약·해설

pwm-fan.rst:1-32

하드웨어 독립적인 PWM 출력과 0~255 상대 속도를 제공하고 0 듀티에서 PWM·레귤레이터를 유지하는 네 모드를 정의합니다.

문서 개요
항목
SourceDocumentation/hwmon/pwm-fan.rst
분량32 source lines
PWM0~255
enable 모드0~3

원문 분량과 핵심 장치 구성을 정리합니다.

운영 흐름
PWM 장치 연결enable 모드 선택듀티 적용타코 인터럽트 집계RPM 공개

장치 인식부터 측정·제어까지의 핵심 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Kernel driver pwm-fan
2 =====================
3
4 This driver enables the use of a PWM module to drive a fan. It uses the
5 generic PWM interface thus it is hardware independent. It can be used on
6 many SoCs, as long as the SoC supplies a PWM line driver that exposes
7 the generic PWM API.
8
9 Author: Kamil Debski <k.debski@samsung.com>
10
11 Description
12 -----------
13
14 The driver implements a simple interface for driving a fan connected to
15 a PWM output. It uses the generic PWM interface, thus it can be used with
16 a range of SoCs. The driver exposes the fan to the user space through
17 the hwmon's sysfs interface.
18
19 The fan rotation speed returned via the optional 'fan1_input' is extrapolated
20 from the sampled interrupts from the tachometer signal within 1 second.
21
22 The driver provides the following sensor accesses in sysfs:
23
24 =============== ======= =======================================================
25 fan1_input ro fan tachometer speed in RPM
26 pwm1_enable rw keep enable mode, defines behaviour when pwm1=0
27 0 -> disable pwm and regulator
28 1 -> enable pwm; if pwm==0, disable pwm, keep regulator enabled
29 2 -> enable pwm; if pwm==0, keep pwm and regulator enabled
30 3 -> enable pwm; if pwm==0, disable pwm and regulator
31 pwm1 rw relative speed (0-255), 255=max. speed.
32 =============== ======= =======================================================
33

3. 한국어 전문 번역

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

하드웨어 독립적인 PWM 팬 드라이버

1-21

Kamil Debski가 작성한 `pwm-fan` 드라이버는 PWM 모듈로 팬을 구동합니다. 일반 PWM 인터페이스를 사용하므로 하드웨어 독립적이며, 일반 PWM API를 노출하는 PWM 라인 드라이버를 SoC가 제공하면 여러 SoC에서 사용할 수 있습니다.

PWM 출력에 연결된 팬을 제어하는 단순 인터페이스를 구현하고 hwmon sysfs를 통해 사용자 공간에 공개합니다.

선택적 `fan1_input`의 팬 회전 속도는 1초 동안 타코미터 신호에서 샘플링한 인터럽트를 바탕으로 외삽해 계산합니다.

pwm-fan 구조
구성역할
SoC PWM line drivergeneric PWM API 제공
pwm-fan상대 듀티를 팬 출력에 적용
hwmon sysfs사용자 공간 제어·측정
tachometer선택적 회전 펄스 입력
측정 창1초 인터럽트 샘플

일반 PWM 출력과 선택적 타코미터 입력을 연결합니다.

팬 속도 측정·제어
generic PWM 장치 연결pwm1 듀티 적용1초간 tachometer 인터럽트 집계RPM으로 외삽fan1_input으로 공개

PWM 출력과 타코미터 판독을 독립적으로 처리합니다.

Kernel driver pwm-fan
=====================

This driver enables the use of a PWM module to drive a fan. It uses the
generic PWM interface thus it is hardware independent. It can be used on
many SoCs, as long as the SoC supplies a PWM line driver that exposes
the generic PWM API.

Author: Kamil Debski <k.debski@samsung.com>

Description
-----------

The driver implements a simple interface for driving a fan connected to
a PWM output. It uses the generic PWM interface, thus it can be used with
a range of SoCs. The driver exposes the fan to the user space through
the hwmon's sysfs interface.

The fan rotation speed returned via the optional 'fan1_input' is extrapolated
from the sampled interrupts from the tachometer signal within 1 second.

pwm1_enable 모드와 0 듀티 동작

22-32

`fan1_input`은 읽기 전용이며 타코미터 팬 속도를 RPM으로 제공합니다.

`pwm1`은 읽기·쓰기가 가능한 상대 속도 0~255이고 255가 최고 속도입니다.

`pwm1_enable`은 읽기·쓰기가 가능하며 `pwm1=0`일 때 PWM과 레귤레이터를 어떻게 유지할지 정합니다.

모드 0은 PWM과 레귤레이터를 비활성화합니다. 모드 1은 PWM 모드를 사용하지만 듀티가 0이면 PWM만 끄고 레귤레이터는 켜 둡니다.

모드 2는 듀티가 0이어도 PWM과 레귤레이터를 모두 켜 둡니다. 모드 3은 PWM을 사용하지만 듀티가 0이면 PWM과 레귤레이터를 모두 끕니다.

pwm1_enable 모드
모드일반 동작pwm1=0
0비활성 모드PWM off, regulator off
1PWM 활성PWM off, regulator on
2PWM 활성PWM on, regulator on
3PWM 활성PWM off, regulator off

pwm1=0일 때 PWM·레귤레이터 상태를 정확히 구분합니다.

0 듀티 처리
팬 정지 시 레귤레이터 유지 필요성 판단pwm1_enable 0~3 선택pwm1에 0~255 기록0이면 모드별 PWM·전원 상태 적용필요하면 fan1_input으로 정지 확인

정지 시 전원 유지 요구에 맞는 enable 모드를 선택합니다.

The driver provides the following sensor accesses in sysfs:

=============== ======= =======================================================
fan1_input        ro        fan tachometer speed in RPM
pwm1_enable        rw        keep enable mode, defines behaviour when pwm1=0
                        0 -> disable pwm and regulator
                        1 -> enable pwm; if pwm==0, disable pwm, keep regulator enabled
                        2 -> enable pwm; if pwm==0, keep pwm and regulator enabled
                        3 -> enable pwm; if pwm==0, disable pwm and regulator
pwm1                rw        relative speed (0-255), 255=max. speed.
=============== ======= =======================================================