요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
2. 영어 원문 전체
번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.
원문 전체 펼치기
==========================
Regulator Driver Interface
==========================
The regulator driver interface is relatively simple and designed to allow
regulator drivers to register their services with the core framework.
Registration
============
Drivers can register a regulator by calling::
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
const struct regulator_config *config);
This will register the regulator's capabilities and operations to the regulator
core.
Regulators can be unregistered by calling::
void regulator_unregister(struct regulator_dev *rdev);
Regulator Events
================
Regulators can send events (e.g. overtemperature, undervoltage, etc) to
consumer drivers by calling::
int regulator_notifier_call_chain(struct regulator_dev *rdev,
unsigned long event, void *data);
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.
Provider driver interface
1-8Regulator driver interface는 비교적 단순하며 regulator driver가 자신의 service를 core framework에 등록하도록 설계됐습니다.
Driver가 capability와 operation을 core에 등록하면 consumer가 공통 API로 사용합니다.
==========================
Regulator Driver Interface
==========================
The regulator driver interface is relatively simple and designed to allow
regulator drivers to register their services with the core framework.
등록과 해제
9-24Driver는 `regulator_register(regulator_desc, config)`를 호출해 regulator를 등록하고 `struct regulator_dev *`를 받습니다. 이 호출은 regulator capability와 operation을 regulator core에 등록합니다.
Regulator를 해제하려면 `regulator_unregister(rdev)`를 호출합니다.
등록 결과 rdev를 해제 호출까지 유지합니다.
Registration
============
Drivers can register a regulator by calling::
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
const struct regulator_config *config);
This will register the regulator's capabilities and operations to the regulator
core.
Regulators can be unregistered by calling::
void regulator_unregister(struct regulator_dev *rdev);
Provider event 전파
25-32Regulator는 overtemperature, undervoltage 같은 event를 `regulator_notifier_call_chain(rdev, event, data)`로 consumer driver에 보낼 수 있습니다.
Regulator 상태 이상을 core notifier chain을 통해 consumer에 전달합니다.
Regulator Events
================
Regulators can send events (e.g. overtemperature, undervoltage, etc) to
consumer drivers by calling::
int regulator_notifier_call_chain(struct regulator_dev *rdev,
unsigned long event, void *data);
요약·해설
regulator.rst:1-32Regulator provider가 capability와 operation을 core에 등록하고 event를 consumer로 전파하는 API를 설명합니다.