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