요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: General Purpose Analog To Digital Converter (ADC) based thermal sensor
maintainers:
- Laxman Dewangan <ldewangan@nvidia.com>
description:
On some of platforms, thermal sensor like thermistors are connected to
one of ADC channel and sensor resistance is read via voltage across the
sensor resistor. The voltage read across the sensor is mapped to
temperature using voltage-temperature lookup table.
$ref: thermal-sensor.yaml#
properties:
compatible:
const: generic-adc-thermal
'#thermal-sensor-cells':
const: 0
io-channels:
maxItems: 1
io-channel-names:
const: sensor-channel
temperature-lookup-table:
description: |
Lookup table to map the relation between ADC value and temperature.
When ADC is read, the value is looked up on the table to get the
equivalent temperature.
If not specified, driver assumes the ADC channel gives milliCelsius
directly.
$ref: /schemas/types.yaml#/definitions/int32-matrix
items:
items:
- description: Temperature in milliCelsius
- description: ADC read value
required:
- compatible
- io-channels
- io-channel-names
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/thermal/thermal.h>
thermal-sensor {
compatible = "generic-adc-thermal";
#thermal-sensor-cells = <0>;
io-channels = <&ads1015 1>;
io-channel-names = "sensor-channel";
temperature-lookup-table = <
(-40000) 2578
(-39000) 2577
(-38000) 2576
(-37000) 2575
(-36000) 2574
(-35000) 2573
(-34000) 2572
(-33000) 2571
(-32000) 2569
(-31000) 2568
(-30000) 2567
/* skip */
118000 254
119000 247
120000 240
121000 233
122000 226
123000 220
124000 214
125000 208>;
};
...
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Generic ADC thermal sensor
1-19이 GPL-2.0-only 또는 BSD-2-Clause YAML 스키마는 범용 ADC 기반 thermal sensor를 정의하고 공통 `thermal-sensor.yaml#` 스키마를 참조합니다. 일부 platform에서는 thermistor 같은 sensor를 ADC channel에 연결해 sensor resistor 양단 전압으로 저항을 읽고, voltage-temperature lookup table로 전압을 온도에 대응시킵니다. Maintainer는 Laxman Dewangan입니다.
ADC channel 속성
20-32`compatible`은 `generic-adc-thermal`이고 `#thermal-sensor-cells`는 0입니다. `io-channels`는 ADC channel phandle/specifier를 한 항목으로 지정하며 `io-channel-names`는 `sensor-channel`로 고정됩니다.
온도 변환 lookup table
33-46`temperature-lookup-table`은 ADC 값과 온도의 관계를 나타내는 `int32-matrix`입니다. 각 행은 첫 번째 값으로 millidegree Celsius 온도, 두 번째 값으로 ADC read value를 둡니다. ADC를 읽으면 이 표에서 동등한 온도를 찾습니다. 이 속성이 없으면 driver는 ADC channel 값 자체가 millidegree Celsius라고 가정합니다.
필수 속성과 스키마 제한
47-53필수 속성은 `compatible`, `io-channels`, `io-channel-names`입니다. `unevaluatedProperties: false`로 공통 스키마에서 평가되지 않은 추가 속성을 금지합니다.
ADS1015 lookup table 예제
54-85예제는 ADS1015의 channel 1을 0-cell thermal sensor에 연결합니다. Lookup table은 -40000 millidegree에서 ADC 2578로 시작해 125000 millidegree에서 ADC 208까지 내려가며, 중간 행 일부는 `/* skip */`으로 생략되어 있습니다.
#include <dt-bindings/thermal/thermal.h>
thermal-sensor {
compatible = "generic-adc-thermal";
#thermal-sensor-cells = <0>;
io-channels = <&ads1015 1>;
io-channel-names = "sensor-channel";
temperature-lookup-table = <
(-40000) 2578
(-39000) 2577
(-38000) 2576
(-37000) 2575
(-36000) 2574
(-35000) 2573
(-34000) 2572
(-33000) 2571
(-32000) 2569
(-31000) 2568
(-30000) 2567
/* skip */
118000 254
119000 247
120000 240
121000 233
122000 226
123000 220
124000 214
125000 208>;
};
...
요약과 해설
generic-adc-thermal.yaml:1-85ADC channel 값과 millidegree 온도를 lookup table로 변환하는 binding을 설명합니다. 접을 수 있는 영어 원문 전체는 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·register·interrupt·수치·예제 코드를 원형대로 유지합니다.