leds-lp55xx-common.h (b3b6f8119d752c969c6394314dc7ab80e6611111) | leds-lp55xx-common.h (10c06d178df11b0b2b746321a80ea14241997127) |
---|---|
1/* 2 * LP55XX Common Driver Header 3 * 4 * Copyright (C) 2012 Texas Instruments 5 * 6 * Author: Milo(Woogyom) Kim <milo.kim@ti.com> 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * version 2 as published by the Free Software Foundation. 11 * 12 * Derived from leds-lp5521.c, leds-lp5523.c 13 */ 14 15#ifndef _LEDS_LP55XX_COMMON_H 16#define _LEDS_LP55XX_COMMON_H 17 | 1/* 2 * LP55XX Common Driver Header 3 * 4 * Copyright (C) 2012 Texas Instruments 5 * 6 * Author: Milo(Woogyom) Kim <milo.kim@ti.com> 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * version 2 as published by the Free Software Foundation. 11 * 12 * Derived from leds-lp5521.c, leds-lp5523.c 13 */ 14 15#ifndef _LEDS_LP55XX_COMMON_H 16#define _LEDS_LP55XX_COMMON_H 17 |
18enum lp55xx_engine_index { 19 LP55XX_ENGINE_INVALID, 20 LP55XX_ENGINE_1, 21 LP55XX_ENGINE_2, 22 LP55XX_ENGINE_3, 23}; 24 |
|
18struct lp55xx_led; 19struct lp55xx_chip; 20 21/* 22 * struct lp55xx_reg 23 * @addr : Register address 24 * @val : Register value 25 */ --- 5 unchanged lines hidden (view full) --- 31/* 32 * struct lp55xx_device_config 33 * @reset : Chip specific reset command 34 * @enable : Chip specific enable command 35 * @max_channel : Maximum number of channels 36 * @post_init_device : Chip specific initialization code 37 * @brightness_work_fn : Brightness work function 38 * @set_led_current : LED current set function | 25struct lp55xx_led; 26struct lp55xx_chip; 27 28/* 29 * struct lp55xx_reg 30 * @addr : Register address 31 * @val : Register value 32 */ --- 5 unchanged lines hidden (view full) --- 38/* 39 * struct lp55xx_device_config 40 * @reset : Chip specific reset command 41 * @enable : Chip specific enable command 42 * @max_channel : Maximum number of channels 43 * @post_init_device : Chip specific initialization code 44 * @brightness_work_fn : Brightness work function 45 * @set_led_current : LED current set function |
46 * @firmware_cb : Call function when the firmware is loaded 47 * @run_engine : Run internal engine for pattern |
|
39 */ 40struct lp55xx_device_config { 41 const struct lp55xx_reg reset; 42 const struct lp55xx_reg enable; 43 const int max_channel; 44 45 /* define if the device has specific initialization process */ 46 int (*post_init_device) (struct lp55xx_chip *chip); 47 48 /* access brightness register */ 49 void (*brightness_work_fn)(struct work_struct *work); 50 51 /* current setting function */ 52 void (*set_led_current) (struct lp55xx_led *led, u8 led_current); | 48 */ 49struct lp55xx_device_config { 50 const struct lp55xx_reg reset; 51 const struct lp55xx_reg enable; 52 const int max_channel; 53 54 /* define if the device has specific initialization process */ 55 int (*post_init_device) (struct lp55xx_chip *chip); 56 57 /* access brightness register */ 58 void (*brightness_work_fn)(struct work_struct *work); 59 60 /* current setting function */ 61 void (*set_led_current) (struct lp55xx_led *led, u8 led_current); |
62 63 /* access program memory when the firmware is loaded */ 64 void (*firmware_cb)(struct lp55xx_chip *chip); 65 66 /* used for running firmware LED patterns */ 67 void (*run_engine) (struct lp55xx_chip *chip, bool start); |
|
53}; 54 55/* 56 * struct lp55xx_chip 57 * @cl : I2C communication for access registers 58 * @pdata : Platform specific data 59 * @lock : Lock for user-space interface 60 * @num_leds : Number of registered LEDs 61 * @cfg : Device specific configuration data | 68}; 69 70/* 71 * struct lp55xx_chip 72 * @cl : I2C communication for access registers 73 * @pdata : Platform specific data 74 * @lock : Lock for user-space interface 75 * @num_leds : Number of registered LEDs 76 * @cfg : Device specific configuration data |
77 * @engine_idx : Selected engine number 78 * @fw : Firmware data for running a LED pattern |
|
62 */ 63struct lp55xx_chip { 64 struct i2c_client *cl; 65 struct lp55xx_platform_data *pdata; 66 struct mutex lock; /* lock for user-space interface */ 67 int num_leds; 68 struct lp55xx_device_config *cfg; | 79 */ 80struct lp55xx_chip { 81 struct i2c_client *cl; 82 struct lp55xx_platform_data *pdata; 83 struct mutex lock; /* lock for user-space interface */ 84 int num_leds; 85 struct lp55xx_device_config *cfg; |
86 enum lp55xx_engine_index engine_idx; 87 const struct firmware *fw; |
|
69}; 70 71/* 72 * struct lp55xx_led 73 * @chan_nr : Channel number 74 * @cdev : LED class device 75 * @led_current : Current setting at each led channel 76 * @max_current : Maximun current at each led channel --- 34 unchanged lines hidden --- | 88}; 89 90/* 91 * struct lp55xx_led 92 * @chan_nr : Channel number 93 * @cdev : LED class device 94 * @led_current : Current setting at each led channel 95 * @max_current : Maximun current at each led channel --- 34 unchanged lines hidden --- |