← Documents Documentation/devicetree/bindings/thermal/generic-adc-thermal.yaml GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings / Thermal

Generic ADC Thermal Sensor

ADC channel 값과 millidegree 온도를 lookup table로 변환하는 binding을 설명합니다.

Source pathDocumentation/devicetree/bindings/thermal/generic-adc-thermal.yaml
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

generic-adc-thermal.yaml:1-85

ADC channel 값과 millidegree 온도를 lookup table로 변환하는 binding을 설명합니다. 접을 수 있는 영어 원문 전체는 줄 좌표를 보존하고, 한국어 전문 번역에서는 compatible·property·phandle·register·interrupt·수치·예제 코드를 원형대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/thermal/generic-adc-thermal.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: General Purpose Analog To Digital Converter (ADC) based thermal sensor
8
9 maintainers:
10 - Laxman Dewangan <ldewangan@nvidia.com>
11
12 description:
13 On some of platforms, thermal sensor like thermistors are connected to
14 one of ADC channel and sensor resistance is read via voltage across the
15 sensor resistor. The voltage read across the sensor is mapped to
16 temperature using voltage-temperature lookup table.
17
18 $ref: thermal-sensor.yaml#
19
20 properties:
21 compatible:
22 const: generic-adc-thermal
23
24 '#thermal-sensor-cells':
25 const: 0
26
27 io-channels:
28 maxItems: 1
29
30 io-channel-names:
31 const: sensor-channel
32
33 temperature-lookup-table:
34 description: |
35 Lookup table to map the relation between ADC value and temperature.
36 When ADC is read, the value is looked up on the table to get the
37 equivalent temperature.
38
39 If not specified, driver assumes the ADC channel gives milliCelsius
40 directly.
41 $ref: /schemas/types.yaml#/definitions/int32-matrix
42 items:
43 items:
44 - description: Temperature in milliCelsius
45 - description: ADC read value
46
47 required:
48 - compatible
49 - io-channels
50 - io-channel-names
51
52 unevaluatedProperties: false
53
54 examples:
55 - |
56 #include <dt-bindings/thermal/thermal.h>
57
58 thermal-sensor {
59 compatible = "generic-adc-thermal";
60 #thermal-sensor-cells = <0>;
61 io-channels = <&ads1015 1>;
62 io-channel-names = "sensor-channel";
63 temperature-lookup-table = <
64 (-40000) 2578
65 (-39000) 2577
66 (-38000) 2576
67 (-37000) 2575
68 (-36000) 2574
69 (-35000) 2573
70 (-34000) 2572
71 (-33000) 2571
72 (-32000) 2569
73 (-31000) 2568
74 (-30000) 2567
75 /* skip */
76 118000 254
77 119000 247
78 120000 240
79 121000 233
80 122000 226
81 123000 220
82 124000 214
83 125000 208>;
84 };
85 ...
86

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>;
    };
...