← Documents Documentation/power/regulator/overview.rst GitHub 원문 ↗

Linux 6.18.37 · Power

Linux voltage and current regulator framework

Regulator·PMIC·consumer·power domain 용어, 3단계 constraint와 네 framework interface를 설명합니다.

Source pathDocumentation/power/regulator/overview.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

overview.rst:1-178

Regulator·PMIC·consumer·power domain 용어, 3단계 constraint와 네 framework interface를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =============================================
2 Linux voltage and current regulator framework
3 =============================================
4
5 About
6 =====
7
8 This framework is designed to provide a standard kernel interface to control
9 voltage and current regulators.
10
11 The intention is to allow systems to dynamically control regulator power output
12 in order to save power and prolong battery life. This applies to both voltage
13 regulators (where voltage output is controllable) and current sinks (where
14 current limit is controllable).
15
16 (C) 2008 Wolfson Microelectronics PLC.
17
18 Author: Liam Girdwood <[email protected]>
19
20
21 Nomenclature
22 ============
23
24 Some terms used in this document:
25
26 - Regulator
27 - Electronic device that supplies power to other devices.
28 Most regulators can enable and disable their output while
29 some can control their output voltage and or current.
30
31 Input Voltage -> Regulator -> Output Voltage
32
33
34 - PMIC
35 - Power Management IC. An IC that contains numerous
36 regulators and often contains other subsystems.
37
38
39 - Consumer
40 - Electronic device that is supplied power by a regulator.
41 Consumers can be classified into two types:-
42
43 Static: consumer does not change its supply voltage or
44 current limit. It only needs to enable or disable its
45 power supply. Its supply voltage is set by the hardware,
46 bootloader, firmware or kernel board initialisation code.
47
48 Dynamic: consumer needs to change its supply voltage or
49 current limit to meet operation demands.
50
51
52 - Power Domain
53 - Electronic circuit that is supplied its input power by the
54 output power of a regulator, switch or by another power
55 domain.
56
57 The supply regulator may be behind a switch(s). i.e.::
58
59 Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A]
60 | |
61 | +-> [Consumer B], [Consumer C]
62 |
63 +-> [Consumer D], [Consumer E]
64
65 That is one regulator and three power domains:
66
67 - Domain 1: Switch-1, Consumers D & E.
68 - Domain 2: Switch-2, Consumers B & C.
69 - Domain 3: Consumer A.
70
71 and this represents a "supplies" relationship:
72
73 Domain-1 --> Domain-2 --> Domain-3.
74
75 A power domain may have regulators that are supplied power
76 by other regulators. i.e.::
77
78 Regulator-1 -+-> Regulator-2 -+-> [Consumer A]
79 |
80 +-> [Consumer B]
81
82 This gives us two regulators and two power domains:
83
84 - Domain 1: Regulator-2, Consumer B.
85 - Domain 2: Consumer A.
86
87 and a "supplies" relationship:
88
89 Domain-1 --> Domain-2
90
91
92 - Constraints
93 - Constraints are used to define power levels for performance
94 and hardware protection. Constraints exist at three levels:
95
96 Regulator Level: This is defined by the regulator hardware
97 operating parameters and is specified in the regulator
98 datasheet. i.e.
99
100 - voltage output is in the range 800mV -> 3500mV.
101 - regulator current output limit is 20mA @ 5V but is
102 10mA @ 10V.
103
104 Power Domain Level: This is defined in software by kernel
105 level board initialisation code. It is used to constrain a
106 power domain to a particular power range. i.e.
107
108 - Domain-1 voltage is 3300mV
109 - Domain-2 voltage is 1400mV -> 1600mV
110 - Domain-3 current limit is 0mA -> 20mA.
111
112 Consumer Level: This is defined by consumer drivers
113 dynamically setting voltage or current limit levels.
114
115 e.g. a consumer backlight driver asks for a current increase
116 from 5mA to 10mA to increase LCD illumination. This passes
117 to through the levels as follows :-
118
119 Consumer: need to increase LCD brightness. Lookup and
120 request next current mA value in brightness table (the
121 consumer driver could be used on several different
122 personalities based upon the same reference device).
123
124 Power Domain: is the new current limit within the domain
125 operating limits for this domain and system state (e.g.
126 battery power, USB power)
127
128 Regulator Domains: is the new current limit within the
129 regulator operating parameters for input/output voltage.
130
131 If the regulator request passes all the constraint tests
132 then the new regulator value is applied.
133
134
135 Design
136 ======
137
138 The framework is designed and targeted at SoC based devices but may also be
139 relevant to non SoC devices and is split into the following four interfaces:-
140
141
142 1. Consumer driver interface.
143
144 This uses a similar API to the kernel clock interface in that consumer
145 drivers can get and put a regulator (like they can with clocks atm) and
146 get/set voltage, current limit, mode, enable and disable. This should
147 allow consumers complete control over their supply voltage and current
148 limit. This also compiles out if not in use so drivers can be reused in
149 systems with no regulator based power control.
150
151 See Documentation/power/regulator/consumer.rst
152
153 2. Regulator driver interface.
154
155 This allows regulator drivers to register their regulators and provide
156 operations to the core. It also has a notifier call chain for propagating
157 regulator events to clients.
158
159 See Documentation/power/regulator/regulator.rst
160
161 3. Machine interface.
162
163 This interface is for machine specific code and allows the creation of
164 voltage/current domains (with constraints) for each regulator. It can
165 provide regulator constraints that will prevent device damage through
166 overvoltage or overcurrent caused by buggy client drivers. It also
167 allows the creation of a regulator tree whereby some regulators are
168 supplied by others (similar to a clock tree).
169
170 See Documentation/power/regulator/machine.rst
171
172 4. Userspace ABI.
173
174 The framework also exports a lot of useful voltage/current/opmode data to
175 userspace via sysfs. This could be used to help monitor device power
176 consumption and status.
177
178 See Documentation/ABI/testing/sysfs-class-regulator
179

3. 한국어 전문 번역

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

Framework 목적과 저작자

1-20

이 framework는 voltage regulator와 current regulator를 제어하는 표준 kernel interface를 제공합니다.

System이 regulator power output을 동적으로 제어해 power를 절약하고 battery life를 늘리게 하는 것이 목적입니다. Output voltage를 제어하는 voltage regulator와 current limit을 제어하는 current sink 모두에 적용됩니다.

Copyright는 2008 Wolfson Microelectronics PLC이고 저자는 Liam Girdwood `<[email protected]>`입니다.

Regulator framework
kernel standard interfacecontrol voltage output or current limitmatch operating demandsave power and prolong battery life

동적 output 제어가 energy 절감과 battery 수명으로 이어집니다.

=============================================
Linux voltage and current regulator framework
=============================================

About
=====

This framework is designed to provide a standard kernel interface to control
voltage and current regulators.

The intention is to allow systems to dynamically control regulator power output
in order to save power and prolong battery life. This applies to both voltage
regulators (where voltage output is controllable) and current sinks (where
current limit is controllable).

(C) 2008  Wolfson Microelectronics PLC.

Author: Liam Girdwood <[email protected]>

Regulator, PMIC와 consumer

21-51

Regulator는 다른 device에 power를 공급하는 electronic device입니다. 대부분 output을 enable/disable할 수 있고 일부는 output voltage 또는 current도 제어합니다. 흐름은 `Input Voltage -> Regulator -> Output Voltage`입니다.

PMIC는 Power Management IC로, 여러 regulator와 흔히 다른 subsystem까지 포함하는 IC입니다.

Consumer는 regulator에서 power를 공급받는 electronic device입니다. Static consumer는 supply voltage나 current limit을 바꾸지 않고 power enable/disable만 필요합니다. Supply voltage는 hardware, bootloader, firmware 또는 kernel board initialization code가 설정합니다.

Dynamic consumer는 동작 요구에 맞춰 supply voltage 또는 current limit을 바꿔야 합니다.

Regulator 용어
용어의미
Regulator다른 device에 power를 공급·제어
PMIC여러 regulator와 subsystem을 포함한 IC
Static consumerEnable/disable만 수행
Dynamic consumerVoltage/current limit을 runtime에 변경

Provider, 통합 IC, consumer 유형을 구분합니다.

Nomenclature
============

Some terms used in this document:

  - Regulator
                 - Electronic device that supplies power to other devices.
                   Most regulators can enable and disable their output while
                   some can control their output voltage and or current.

                   Input Voltage -> Regulator -> Output Voltage


  - PMIC
                 - Power Management IC. An IC that contains numerous
                   regulators and often contains other subsystems.


  - Consumer
                 - Electronic device that is supplied power by a regulator.
                   Consumers can be classified into two types:-

                   Static: consumer does not change its supply voltage or
                   current limit. It only needs to enable or disable its
                   power supply. Its supply voltage is set by the hardware,
                   bootloader, firmware or kernel board initialisation code.

                   Dynamic: consumer needs to change its supply voltage or
                   current limit to meet operation demands.

Power domain과 supplies 관계

52-91

Power domain은 regulator, switch 또는 다른 power domain의 output power를 input으로 받는 electronic circuit입니다.

첫 예제에서 Regulator가 Switch-1과 Consumer D·E에 공급하고, Switch-1은 Switch-2와 Consumer B·C에, Switch-2는 Consumer A에 공급합니다. 이는 Domain 1 `Switch-1, Consumers D & E`, Domain 2 `Switch-2, Consumers B & C`, Domain 3 `Consumer A`이며 `Domain-1 -> Domain-2 -> Domain-3` supplies 관계입니다.

두 번째 예제에서는 Regulator-1이 Regulator-2와 Consumer B에 공급하고 Regulator-2가 Consumer A에 공급합니다. Domain 1은 `Regulator-2, Consumer B`, Domain 2는 `Consumer A`이고 supplies 관계는 `Domain-1 -> Domain-2`입니다.

Switch 기반 power domain
RegulatorDomain-1: Switch-1 + Consumers D/EDomain-2: Switch-2 + Consumers B/CDomain-3: Consumer A

원문의 ASCII tree를 domain supplies 관계로 재구성했습니다.

Regulator cascade
Regulator-1Domain-1: Regulator-2 + Consumer BDomain-2: Consumer A

Upstream regulator가 downstream regulator와 direct consumer를 함께 공급합니다.

Power-domain 예제
예제Domain 수Supplies relation
Switch chain3Domain-1 -> Domain-2 -> Domain-3
Regulator cascade2Domain-1 -> Domain-2

Physical branch를 software domain과 supplies chain으로 변환합니다.

  - Power Domain
                 - Electronic circuit that is supplied its input power by the
                   output power of a regulator, switch or by another power
                   domain.

                   The supply regulator may be behind a switch(s). i.e.::

                     Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A]
                                |             |
                                |             +-> [Consumer B], [Consumer C]
                                |
                                +-> [Consumer D], [Consumer E]

                   That is one regulator and three power domains:

                   - Domain 1: Switch-1, Consumers D & E.
                   - Domain 2: Switch-2, Consumers B & C.
                   - Domain 3: Consumer A.

                   and this represents a "supplies" relationship:

                   Domain-1 --> Domain-2 --> Domain-3.

                   A power domain may have regulators that are supplied power
                   by other regulators. i.e.::

                     Regulator-1 -+-> Regulator-2 -+-> [Consumer A]
                                  |
                                  +-> [Consumer B]

                   This gives us two regulators and two power domains:

                   - Domain 1: Regulator-2, Consumer B.
                   - Domain 2: Consumer A.

                   and a "supplies" relationship:

                   Domain-1 --> Domain-2

세 단계 constraint

92-134

Constraint는 performance와 hardware protection을 위한 power level을 정의하며 regulator level, power-domain level, consumer level의 세 단계에 존재합니다.

Regulator-level constraint는 datasheet에 명시된 hardware operating parameter입니다. 예를 들어 voltage output 800~3500mV, current output limit 5V에서 20mA·10V에서 10mA입니다.

Power-domain-level constraint는 kernel board initialization code가 software로 정의하며 domain을 특정 power 범위로 제한합니다. 예로 Domain-1 3300mV, Domain-2 1400~1600mV, Domain-3 current limit 0~20mA가 있습니다.

Consumer-level constraint는 consumer driver가 voltage 또는 current-limit level을 동적으로 설정합니다. 예를 들어 backlight driver가 LCD 밝기를 높이려고 current를 5mA에서 10mA로 올리도록 요청합니다.

이 요청은 consumer가 brightness table에서 다음 current 값을 선택하고, power domain이 현재 battery/USB 같은 system state에서 domain limit 안인지 검사하고, regulator domain이 input/output voltage에 대한 hardware parameter 안인지 검사하는 순서로 통과합니다. 모든 constraint test를 통과해야 새 regulator 값을 적용합니다.

Constraint level
Level정의 주체
ConsumerConsumer driverBacklight 5mA -> 10mA
Power domainBoard initializationDomain voltage/current range
RegulatorHardware datasheetVoltage·current operating parameter

Dynamic 요청은 좁은 consumer 의도에서 board와 hardware safety 검증으로 올라갑니다.

Constraint 검증
consumer chooses requested valuecheck power-domain limits and system statecheck regulator hardware parametersapply new regulator value

모든 단계의 범위를 통과한 요청만 hardware에 적용합니다.

  - Constraints
                 - Constraints are used to define power levels for performance
                   and hardware protection. Constraints exist at three levels:

                   Regulator Level: This is defined by the regulator hardware
                   operating parameters and is specified in the regulator
                   datasheet. i.e.

                     - voltage output is in the range 800mV -> 3500mV.
                     - regulator current output limit is 20mA @ 5V but is
                       10mA @ 10V.

                   Power Domain Level: This is defined in software by kernel
                   level board initialisation code. It is used to constrain a
                   power domain to a particular power range. i.e.

                     - Domain-1 voltage is 3300mV
                     - Domain-2 voltage is 1400mV -> 1600mV
                     - Domain-3 current limit is 0mA -> 20mA.

                   Consumer Level: This is defined by consumer drivers
                   dynamically setting voltage or current limit levels.

                   e.g. a consumer backlight driver asks for a current increase
                   from 5mA to 10mA to increase LCD illumination. This passes
                   to through the levels as follows :-

                   Consumer: need to increase LCD brightness. Lookup and
                   request next current mA value in brightness table (the
                   consumer driver could be used on several different
                   personalities based upon the same reference device).

                   Power Domain: is the new current limit within the domain
                   operating limits for this domain and system state (e.g.
                   battery power, USB power)

                   Regulator Domains: is the new current limit within the
                   regulator operating parameters for input/output voltage.

                   If the regulator request passes all the constraint tests
                   then the new regulator value is applied.

네 가지 framework interface

135-178

Framework는 SoC device를 주 대상으로 설계됐지만 non-SoC device에도 관련될 수 있으며 네 interface로 나뉩니다.

Consumer driver interface는 kernel clock interface와 비슷하게 regulator get/put, voltage·current limit·mode get/set, enable/disable을 제공합니다. 사용하지 않을 때 compile out되므로 regulator 기반 power control이 없는 system에서도 driver를 재사용할 수 있습니다. 자세한 내용은 `Documentation/power/regulator/consumer.rst`를 봅니다.

Regulator driver interface는 regulator driver가 regulator와 operation을 core에 등록하게 하고 event를 client로 전달하는 notifier call chain을 제공합니다. `Documentation/power/regulator/regulator.rst`를 참고합니다.

Machine interface는 machine-specific code가 regulator별 voltage/current domain과 constraint를 만들게 합니다. Buggy client driver의 overvoltage·overcurrent로 인한 손상을 막고, regulator가 다른 regulator에서 공급받는 clock-tree 같은 regulator tree도 만들 수 있습니다. `Documentation/power/regulator/machine.rst`를 참고합니다.

Userspace ABI는 유용한 voltage, current, operating-mode data를 sysfs로 내보내 device power consumption과 상태 monitoring을 돕습니다. `Documentation/ABI/testing/sysfs-class-regulator`를 참고합니다.

Regulator framework interface
Interface책임문서
Consumer driverGet/put, voltage/current/mode, enableconsumer.rst
Regulator driverProvider 등록과 notifierregulator.rst
MachineDomain constraint와 regulator treemachine.rst
Userspace ABIsysfs monitoring datasysfs-class-regulator

Consumer 요청, provider 구현, board safety, 관찰 ABI를 분리합니다.

Design
======

The framework is designed and targeted at SoC based devices but may also be
relevant to non SoC devices and is split into the following four interfaces:-


   1. Consumer driver interface.

      This uses a similar API to the kernel clock interface in that consumer
      drivers can get and put a regulator (like they can with clocks atm) and
      get/set voltage, current limit, mode, enable and disable. This should
      allow consumers complete control over their supply voltage and current
      limit. This also compiles out if not in use so drivers can be reused in
      systems with no regulator based power control.

        See Documentation/power/regulator/consumer.rst

   2. Regulator driver interface.

      This allows regulator drivers to register their regulators and provide
      operations to the core. It also has a notifier call chain for propagating
      regulator events to clients.

        See Documentation/power/regulator/regulator.rst

   3. Machine interface.

      This interface is for machine specific code and allows the creation of
      voltage/current domains (with constraints) for each regulator. It can
      provide regulator constraints that will prevent device damage through
      overvoltage or overcurrent caused by buggy client drivers. It also
      allows the creation of a regulator tree whereby some regulators are
      supplied by others (similar to a clock tree).

        See Documentation/power/regulator/machine.rst

   4. Userspace ABI.

      The framework also exports a lot of useful voltage/current/opmode data to
      userspace via sysfs. This could be used to help monitor device power
      consumption and status.

        See Documentation/ABI/testing/sysfs-class-regulator