← Documents Documentation/leds/leds-lp3944.rst GitHub 원문 ↗

Linux 6.18.37 · LEDs

LP3944 LED Driver

8-channel LP3944의 DIM blink pattern과 embedded I2C board 등록 예제입니다.

Source pathDocumentation/leds/leds-lp3944.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

leds-lp3944.rst:1-59

LP3944는 두 DIM bank의 period와 duty cycle로 최대 8개 LED의 blink pattern을 제어합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ====================
2 Kernel driver lp3944
3 ====================
4
5 * National Semiconductor LP3944 Fun-light Chip
6
7 Prefix: 'lp3944'
8
9 Addresses scanned: None (see the Notes section below)
10
11 Datasheet:
12
13 Publicly available at the National Semiconductor website
14 http://www.national.com/pf/LP/LP3944.html
15
16 Authors:
17 Antonio Ospite <ospite@studenti.unina.it>
18
19
20 Description
21 -----------
22 The LP3944 is a helper chip that can drive up to 8 leds, with two programmable
23 DIM modes; it could even be used as a gpio expander but this driver assumes it
24 is used as a led controller.
25
26 The DIM modes are used to set _blink_ patterns for leds, the pattern is
27 specified supplying two parameters:
28
29 - period:
30 from 0s to 1.6s
31 - duty cycle:
32 percentage of the period the led is on, from 0 to 100
33
34 Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern.
35 See the datasheet for details.
36
37 LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
38 leds, the camera flash light and the lcds power.
39
40
41 Notes
42 -----
43 The chip is used mainly in embedded contexts, so this driver expects it is
44 registered using the i2c_board_info mechanism.
45
46 To register the chip at address 0x60 on adapter 0, set the platform data
47 according to include/linux/leds-lp3944.h, set the i2c board info::
48
49 static struct i2c_board_info a910_i2c_board_info[] __initdata = {
50 {
51 I2C_BOARD_INFO("lp3944", 0x60),
52 .platform_data = &a910_lp3944_leds,
53 },
54 };
55
56 and register it in the platform init function::
57
58 i2c_register_board_info(0, a910_i2c_board_info,
59 ARRAY_SIZE(a910_i2c_board_info));
60

3. 한국어 전문 번역

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

LP3944 channel과 DIM mode

1-36

National Semiconductor LP3944 Fun-light chip은 최대 8개 LED를 구동하고 program 가능한 DIM mode 두 개를 제공합니다. GPIO expander로도 사용할 수 있지만 이 driver는 LED controller 용도만 가정합니다.

DIM0와 DIM1은 LED blink pattern을 설정합니다. Pattern은 0초부터 1.6초까지의 `period`와, 한 주기 중 LED가 켜져 있는 비율인 0~100% `duty cycle` 두 parameter로 정의합니다.

LED를 DIM0 또는 DIM1 mode로 설정하면 선택한 pattern에 따라 blink합니다. 상세 register 동작은 datasheet를 참조합니다.

LP3944는 Motorola A910 smartphone에서 RGB LED, camera flash light, LCD power를 구동하는 데 사용됩니다.

LP3944 DIM pattern
Parameter범위의미
`period``0~1.6 s`Blink 한 주기
`duty cycle``0~100%`주기 중 LED on 시간 비율
Mode`DIM0` 또는 `DIM1`LED가 사용할 pattern bank

두 DIM bank가 각자 period와 duty cycle을 보유합니다.

====================
Kernel driver lp3944
====================

  * National Semiconductor LP3944 Fun-light Chip

    Prefix: 'lp3944'

    Addresses scanned: None (see the Notes section below)

    Datasheet:

        Publicly available at the National Semiconductor website
        http://www.national.com/pf/LP/LP3944.html

Authors:
        Antonio Ospite <ospite@studenti.unina.it>


Description
-----------
The LP3944 is a helper chip that can drive up to 8 leds, with two programmable
DIM modes; it could even be used as a gpio expander but this driver assumes it
is used as a led controller.

The DIM modes are used to set _blink_ patterns for leds, the pattern is
specified supplying two parameters:

  - period:
        from 0s to 1.6s
  - duty cycle:
        percentage of the period the led is on, from 0 to 100

Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern.
See the datasheet for details.

Embedded I2C 등록

37-59

이 chip은 주로 embedded system에 쓰이므로 driver는 `i2c_board_info`로 등록된다고 가정합니다.

Adapter 0의 address `0x60`에 등록하려면 `include/linux/leds-lp3944.h`에 맞는 platform data를 준비하고 `I2C_BOARD_INFO("lp3944", 0x60)`과 `.platform_data = &a910_lp3944_leds`를 선언합니다.

Platform init function에서 `i2c_register_board_info(0, a910_i2c_board_info, ARRAY_SIZE(a910_i2c_board_info))`를 호출해 static client 정보를 adapter 0에 연결합니다.

LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
leds, the camera flash light and the lcds power.


Notes
-----
The chip is used mainly in embedded contexts, so this driver expects it is
registered using the i2c_board_info mechanism.

To register the chip at address 0x60 on adapter 0, set the platform data
according to include/linux/leds-lp3944.h, set the i2c board info::

        static struct i2c_board_info a910_i2c_board_info[] __initdata = {
                {
                        I2C_BOARD_INFO("lp3944", 0x60),
                        .platform_data = &a910_lp3944_leds,
                },
        };

and register it in the platform init function::

        i2c_register_board_info(0, a910_i2c_board_info,
                        ARRAY_SIZE(a910_i2c_board_info));