← Documents Documentation/devicetree/bindings/iio/accel/lis302.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

LIS302 Accelerometer

LIS3 family의 SPI/I2C, click, wakeup, IRQ와 axis 바인딩입니다.

Source pathDocumentation/devicetree/bindings/iio/accel/lis302.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

lis302.txt:1-119

두 bus 방식과 event engine 설정을 함께 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 LIS302 accelerometer devicetree bindings
2
3 This device is matched via its bus drivers, and has a number of properties
4 that apply in on the generic device (independent from the bus).
5
6
7 Required properties for the SPI bindings:
8 - compatible: should be set to "st,lis3lv02d-spi"
9 - reg: the chipselect index
10 - spi-max-frequency: maximal bus speed, should be set to 1000000 unless
11 constrained by external circuitry
12 - interrupts: the interrupt generated by the device
13
14 Required properties for the I2C bindings:
15 - compatible: should be set to "st,lis3lv02d"
16 - reg: i2c slave address
17 - Vdd-supply: The input supply for Vdd
18 - Vdd_IO-supply: The input supply for Vdd_IO
19
20
21 Optional properties for all bus drivers:
22
23 - st,click-single-{x,y,z}: if present, tells the device to issue an
24 interrupt on single click events on the
25 x/y/z axis.
26 - st,click-double-{x,y,z}: if present, tells the device to issue an
27 interrupt on double click events on the
28 x/y/z axis.
29 - st,click-thresh-{x,y,z}: set the x/y/z axis threshold
30 - st,click-click-time-limit: click time limit, from 0 to 127.5msec
31 with step of 0.5 msec
32 - st,click-latency: click latency, from 0 to 255 msec with
33 step of 1 msec.
34 - st,click-window: click window, from 0 to 255 msec with
35 step of 1 msec.
36 - st,irq{1,2}-disable: disable IRQ 1/2
37 - st,irq{1,2}-ff-wu-1: raise IRQ 1/2 on FF_WU_1 condition
38 - st,irq{1,2}-ff-wu-2: raise IRQ 1/2 on FF_WU_2 condition
39 - st,irq{1,2}-data-ready: raise IRQ 1/2 on data ready condition
40 - st,irq{1,2}-click: raise IRQ 1/2 on click condition
41 - st,irq-open-drain: consider IRQ lines open-drain
42 - st,irq-active-low: make IRQ lines active low
43 - st,wu-duration-1: duration register for Free-Fall/Wake-Up
44 interrupt 1
45 - st,wu-duration-2: duration register for Free-Fall/Wake-Up
46 interrupt 2
47 - st,wakeup-{x,y,z}-{lo,hi}: set wakeup condition on x/y/z axis for
48 upper/lower limit
49 - st,wakeup-threshold: set wakeup threshold
50 - st,wakeup2-{x,y,z}-{lo,hi}: set wakeup condition on x/y/z axis for
51 upper/lower limit for second wakeup
52 engine.
53 - st,wakeup2-threshold: set wakeup threshold for second wakeup
54 engine.
55 - st,highpass-cutoff-hz=: 1, 2, 4 or 8 for 1Hz, 2Hz, 4Hz or 8Hz of
56 highpass cut-off frequency
57 - st,hipass{1,2}-disable: disable highpass 1/2.
58 - st,default-rate=: set the default rate
59 - st,axis-{x,y,z}=: set the axis to map to the three coordinates.
60 Negative values can be used for inverted axis.
61 - st,{min,max}-limit-{x,y,z} set the min/max limits for x/y/z axis
62 (used by self-test)
63
64
65 Example for a SPI device node:
66
67 accelerometer@0 {
68 compatible = "st,lis302dl-spi";
69 reg = <0>;
70 spi-max-frequency = <1000000>;
71 interrupt-parent = <&gpio>;
72 interrupts = <104 0>;
73
74 st,click-single-x;
75 st,click-single-y;
76 st,click-single-z;
77 st,click-thresh-x = <10>;
78 st,click-thresh-y = <10>;
79 st,click-thresh-z = <10>;
80 st,irq1-click;
81 st,irq2-click;
82 st,wakeup-x-lo;
83 st,wakeup-x-hi;
84 st,wakeup-y-lo;
85 st,wakeup-y-hi;
86 st,wakeup-z-lo;
87 st,wakeup-z-hi;
88 };
89
90 Example for a I2C device node:
91
92 lis331dlh: accelerometer@18 {
93 compatible = "st,lis331dlh", "st,lis3lv02d";
94 reg = <0x18>;
95 Vdd-supply = <&lis3_reg>;
96 Vdd_IO-supply = <&lis3_reg>;
97
98 st,click-single-x;
99 st,click-single-y;
100 st,click-single-z;
101 st,click-thresh-x = <10>;
102 st,click-thresh-y = <10>;
103 st,click-thresh-z = <10>;
104 st,irq1-click;
105 st,irq2-click;
106 st,wakeup-x-lo;
107 st,wakeup-x-hi;
108 st,wakeup-y-lo;
109 st,wakeup-y-hi;
110 st,wakeup-z-lo;
111 st,wakeup-z-hi;
112 st,min-limit-x = <120>;
113 st,min-limit-y = <120>;
114 st,min-limit-z = <140>;
115 st,max-limit-x = <550>;
116 st,max-limit-y = <550>;
117 st,max-limit-z = <750>;
118 };
119
120

3. 한국어 전문 번역

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

LIS302 SPI/I2C 필수 속성

1-20

LIS302 accelerometer는 각 bus driver를 통해 match되며, bus 종류와 무관하게 generic device에 적용되는 여러 property를 갖습니다.

SPI binding의 필수 `compatible`은 `st,lis3lv02d-spi`, `reg`는 chip-select index, `spi-max-frequency`는 최대 bus speed입니다. 외부 회로가 제한하지 않는 한 1000000으로 설정해야 합니다. `interrupts`는 device가 생성하는 interrupt입니다.

I2C binding의 필수 `compatible`은 `st,lis3lv02d`, `reg`는 I2C slave address입니다. `Vdd-supply`와 `Vdd_IO-supply`는 각각 Vdd와 Vdd_IO input supply입니다.

Click, IRQ, wakeup과 axis 속성

21-64

모든 bus driver에서 `st,click-single-{x,y,z}`와 `st,click-double-{x,y,z}`는 각 축의 single/double click event에 interrupt를 생성하게 합니다. `st,click-thresh-{x,y,z}`는 축별 threshold입니다. `st,click-click-time-limit`는 0~127.5 ms를 0.5 ms step으로, `st,click-latency`와 `st,click-window`는 0~255 ms를 1 ms step으로 설정합니다.

`st,irq{1,2}-disable`은 IRQ 1/2를 끕니다. `st,irq{1,2}-ff-wu-1`, `st,irq{1,2}-ff-wu-2`, `st,irq{1,2}-data-ready`, `st,irq{1,2}-click`은 각각 FF_WU_1, FF_WU_2, data-ready, click condition에서 IRQ 1/2를 발생시킵니다. `st,irq-open-drain`은 IRQ line을 open-drain으로 취급하고 `st,irq-active-low`는 active-low로 만듭니다.

`st,wu-duration-1`과 `st,wu-duration-2`는 Free-Fall/Wake-Up interrupt 1과 2의 duration register입니다. `st,wakeup-{x,y,z}-{lo,hi}`는 첫 wakeup engine의 각 축 upper/lower limit condition, `st,wakeup-threshold`는 그 threshold입니다. `st,wakeup2-{x,y,z}-{lo,hi}`와 `st,wakeup2-threshold`는 둘째 wakeup engine에 같은 역할을 합니다.

`st,highpass-cutoff-hz` 값 1, 2, 4, 8은 각각 1, 2, 4, 8 Hz high-pass cutoff frequency를 뜻하고 `st,hipass{1,2}-disable`은 high-pass 1/2를 끕니다. `st,default-rate`는 기본 rate, `st,axis-{x,y,z}`는 세 좌표에 mapping할 axis이며 음수 값으로 axis를 반전할 수 있습니다. Self-test에 쓰는 `st,{min,max}-limit-{x,y,z}`는 축별 min/max limit입니다.

LIS302 event routing
기능군Property결과
Clickst,click-*축별 click 검출과 시간 window
IRQ routest,irq{1,2}-*조건을 IRQ 1 또는 2에 연결
Wakeupst,wakeup* / st,wu-duration-*두 wakeup engine의 축 조건
Signalst,irq-open-drain / active-lowIRQ electrical polarity
Axisst,axis-* / min,max-limit-*좌표 mapping과 self-test limit

Click, free-fall/wakeup와 data-ready source를 IRQ 1/2에 연결하는 property군입니다.

SPI와 I2C device 예제

65-119

SPI 예제는 chip-select 0, 최대 1 MHz, GPIO interrupt 104를 사용합니다. X/Y/Z single-click과 threshold 10을 설정하고 click을 IRQ1/IRQ2에 route하며 각 축의 low/high wakeup condition을 모두 활성화합니다. 예제 compatible은 원문 그대로 `st,lis302dl-spi`입니다.

accelerometer@0 {
        compatible = "st,lis302dl-spi";
        reg = <0>;
        spi-max-frequency = <1000000>;
        interrupt-parent = <&gpio>;
        interrupts = <104 0>;

        st,click-single-x;
        st,click-single-y;
        st,click-single-z;
        st,click-thresh-x = <10>;
        st,click-thresh-y = <10>;
        st,click-thresh-z = <10>;
        st,irq1-click;
        st,irq2-click;
        st,wakeup-x-lo;
        st,wakeup-x-hi;
        st,wakeup-y-lo;
        st,wakeup-y-hi;
        st,wakeup-z-lo;
        st,wakeup-z-hi;
};

I2C 예제의 LIS331DLH는 address `0x18`에서 `st,lis331dlh`와 generic `st,lis3lv02d` compatible을 함께 사용하고 Vdd/Vdd_IO 모두 `lis3_reg`에서 공급받습니다. 같은 click/wakeup 설정에 더해 X/Y/Z self-test minimum 120/120/140과 maximum 550/550/750을 지정합니다.

lis331dlh: accelerometer@18 {
        compatible = "st,lis331dlh", "st,lis3lv02d";
        reg = <0x18>;
        Vdd-supply = <&lis3_reg>;
        Vdd_IO-supply = <&lis3_reg>;

        st,click-single-x;
        st,click-single-y;
        st,click-single-z;
        st,click-thresh-x = <10>;
        st,click-thresh-y = <10>;
        st,click-thresh-z = <10>;
        st,irq1-click;
        st,irq2-click;
        st,wakeup-x-lo;
        st,wakeup-x-hi;
        st,wakeup-y-lo;
        st,wakeup-y-hi;
        st,wakeup-z-lo;
        st,wakeup-z-hi;
        st,min-limit-x = <120>;
        st,min-limit-y = <120>;
        st,min-limit-z = <140>;
        st,max-limit-x = <550>;
        st,max-limit-y = <550>;
        st,max-limit-z = <750>;
};