1 ======================== 2 Kernel driver for lp5562 3 ======================== 4 5 * TI LP5562 LED Driver 6 7 Author: Milo(Woogyom) Kim <milo.kim@ti.com> 8 9 Description 10 =========== 11 12 LP5562 can drive up to 4 channels. R/G/B and 13 LEDs can be controlled directly via the led 14 15 All four channels can be also controlled usi 16 LP5562 has the internal program memory for r 17 For the details, please refer to 'firmware' 18 19 Device attribute 20 ================ 21 22 engine_mux 23 3 Engines are allocated in LP5562, but the n 24 Therefore each channel should be mapped to t 25 26 Value: RGB or W 27 28 This attribute is used for programming LED d 29 Unlike the LP5521/LP5523/55231, LP5562 has u 30 so additional sysfs is required 31 32 LED Map 33 34 ===== === =============================== 35 Red ... Engine 1 (fixed) 36 Green ... Engine 2 (fixed) 37 Blue ... Engine 3 (fixed) 38 White ... Engine 1 or 2 or 3 (selective) 39 ===== === =============================== 40 41 How to load the program data using engine_mux 42 ============================================= 43 44 Before loading the LP5562 program data, engi 45 the engine selection and loading the firmwar 46 Engine mux has two different mode, RGB and W 47 RGB is used for loading RGB program data, W 48 49 For example, run blinking green channel patt 50 51 echo 2 > /sys/bus/i2c/devices/xxxx/select_ 52 echo "RGB" > /sys/bus/i2c/devices/xxxx/eng 53 echo 1 > /sys/class/firmware/lp5562/loadin 54 echo "4000600040FF6000" > /sys/class/firmw 55 echo 0 > /sys/class/firmware/lp5562/loadin 56 echo 1 > /sys/bus/i2c/devices/xxxx/run_eng 57 58 To run a blinking white pattern:: 59 60 echo 1 or 2 or 3 > /sys/bus/i2c/devices/xx 61 echo "W" > /sys/bus/i2c/devices/xxxx/engin 62 echo 1 > /sys/class/firmware/lp5562/loadin 63 echo "4000600040FF6000" > /sys/class/firmw 64 echo 0 > /sys/class/firmware/lp5562/loadin 65 echo 1 > /sys/bus/i2c/devices/xxxx/run_eng 66 67 How to load the predefined patterns 68 =================================== 69 70 Please refer to 'leds-lp55xx.txt" 71 72 Setting Current of Each Channel 73 =============================== 74 75 Like LP5521 and LP5523/55231, LP5562 provide 76 The 'led_current' and 'max_current' are used 77 78 Example of Platform data 79 ======================== 80 81 :: 82 83 static struct lp55xx_led_config lp5562 84 { 85 .name = "R", 86 .chan_nr = 0, 87 .led_current = 20, 88 .max_current = 40, 89 }, 90 { 91 .name = "G", 92 .chan_nr = 1, 93 .led_current = 20, 94 .max_current = 40, 95 }, 96 { 97 .name = "B", 98 .chan_nr = 2, 99 .led_current = 20, 100 .max_current = 40, 101 }, 102 { 103 .name = "W", 104 .chan_nr = 3, 105 .led_current = 20, 106 .max_current = 40, 107 }, 108 }; 109 110 static int lp5562_setup(void) 111 { 112 /* setup HW resources */ 113 } 114 115 static void lp5562_release(void) 116 { 117 /* Release HW resources */ 118 } 119 120 static void lp5562_enable(bool state) 121 { 122 /* Control of chip enable sign 123 } 124 125 static struct lp55xx_platform_data lp5 126 .led_config = lp5562_led_c 127 .num_channels = ARRAY_SIZE(l 128 .setup_resources = lp5562_se 129 .release_resources = lp5562_re 130 .enable = lp5562_en 131 }; 132 133 To configure the platform specific data, lp55x 134 135 136 If the current is set to 0 in the platform dat 137 disabled and it is not visible in the sysfs.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.