forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
leds: support new LP8501 device - another LP55xx common
LP8501 can drive up to 9 channels like LP5523. LEDs can be controlled directly via the I2C and programmable engines are supported. LP55xx common driver LP8501 is one of LP55xx family device, so LP55xx common code are used. Chip specific data is defined in the structure, 'lp55xx_device_config'. Differences between LP8501 and LP5523 Different register layout for LED output control and others. LP8501 specific feature for separate output power selection. LP8501 doesn't support external clock detection. Different programming engine data. LP8501 specific feature - output power selection Output channels are selected by power selection - Vout or Vdd. Separate power for VDD1-6 and VDD7-9 are available. It is configurable in the platform data. To support this feature, LP55xx DT structure and header are changed. Device tree binding is updated as well. LED pattern data Example pattern data is updated in the driver documentation. Signed-off-by: Milo Kim <[email protected]> Signed-off-by: Bryan Wu <[email protected]>
- Loading branch information
Showing
7 changed files
with
537 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
LP5521/LP5523/LP55231 Common Driver | ||
=================================== | ||
LP5521/LP5523/LP55231/LP5562/LP8501 Common Driver | ||
================================================= | ||
|
||
Authors: Milo(Woogyom) Kim <[email protected]> | ||
|
||
Description | ||
----------- | ||
LP5521, LP5523/55231 and LP5562 have common features as below. | ||
LP5521, LP5523/55231, LP5562 and LP8501 have common features as below. | ||
|
||
Register access via the I2C | ||
Device initialization/deinitialization | ||
|
@@ -109,6 +109,30 @@ As soon as 'loading' is set to 0, registered callback is called. | |
Inside the callback, the selected engine is loaded and memory is updated. | ||
To run programmed pattern, 'run_engine' attribute should be enabled. | ||
|
||
The pattern sqeuence of LP8501 is same as LP5523. | ||
However pattern data is specific. | ||
Ex 1) Engine 1 is used | ||
echo 1 > /sys/bus/i2c/devices/xxxx/select_engine | ||
echo 1 > /sys/class/firmware/lp8501/loading | ||
echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data | ||
echo 0 > /sys/class/firmware/lp8501/loading | ||
echo 1 > /sys/bus/i2c/devices/xxxx/run_engine | ||
|
||
Ex 2) Engine 2 and 3 are used at the same time | ||
echo 2 > /sys/bus/i2c/devices/xxxx/select_engine | ||
sleep 1 | ||
echo 1 > /sys/class/firmware/lp8501/loading | ||
echo "9d0140ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data | ||
echo 0 > /sys/class/firmware/lp8501/loading | ||
sleep 1 | ||
echo 3 > /sys/bus/i2c/devices/xxxx/select_engine | ||
sleep 1 | ||
echo 1 > /sys/class/firmware/lp8501/loading | ||
echo "9d0340ff7e0040007e00a001c000" > /sys/class/firmware/lp8501/data | ||
echo 0 > /sys/class/firmware/lp8501/loading | ||
sleep 1 | ||
echo 1 > /sys/class/leds/d1/device/run_engine | ||
|
||
( 'run_engine' and 'firmware_cb' ) | ||
The sequence of running the program data is common. | ||
But each device has own specific register addresses for commands. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.