1 /* 2 * Simple driver for Texas Instruments LM3630A LED Flash driver chip 3 * Copyright (C) 2012 Texas Instruments 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * 9 */ 10 11 #ifndef __LINUX_LM3630A_H 12 #define __LINUX_LM3630A_H 13 14 #define LM3630A_NAME "lm3630a_bl" 15 16 enum lm3630a_pwm_ctrl { 17 LM3630A_PWM_DISABLE = 0x00, 18 LM3630A_PWM_BANK_A, 19 LM3630A_PWM_BANK_B, 20 LM3630A_PWM_BANK_ALL, 21 LM3630A_PWM_BANK_A_ACT_LOW = 0x05, 22 LM3630A_PWM_BANK_B_ACT_LOW, 23 LM3630A_PWM_BANK_ALL_ACT_LOW, 24 }; 25 26 enum lm3630a_leda_ctrl { 27 LM3630A_LEDA_DISABLE = 0x00, 28 LM3630A_LEDA_ENABLE = 0x04, 29 LM3630A_LEDA_ENABLE_LINEAR = 0x14, 30 }; 31 32 enum lm3630a_ledb_ctrl { 33 LM3630A_LEDB_DISABLE = 0x00, 34 LM3630A_LEDB_ON_A = 0x01, 35 LM3630A_LEDB_ENABLE = 0x02, 36 LM3630A_LEDB_ENABLE_LINEAR = 0x0A, 37 }; 38 39 #define LM3630A_MAX_BRIGHTNESS 255 40 /* 41 *@leda_label : optional led a label. 42 *@leda_init_brt : led a init brightness. 4~255 43 *@leda_max_brt : led a max brightness. 4~255 44 *@leda_ctrl : led a disable, enable linear, enable exponential 45 *@ledb_label : optional led b label. 46 *@ledb_init_brt : led b init brightness. 4~255 47 *@ledb_max_brt : led b max brightness. 4~255 48 *@ledb_ctrl : led b disable, enable linear, enable exponential 49 *@pwm_period : pwm period 50 *@pwm_ctrl : pwm disable, bank a or b, active high or low 51 */ 52 struct lm3630a_platform_data { 53 54 /* led a config. */ 55 const char *leda_label; 56 int leda_init_brt; 57 int leda_max_brt; 58 enum lm3630a_leda_ctrl leda_ctrl; 59 /* led b config. */ 60 const char *ledb_label; 61 int ledb_init_brt; 62 int ledb_max_brt; 63 enum lm3630a_ledb_ctrl ledb_ctrl; 64 /* pwm config. */ 65 unsigned int pwm_period; 66 enum lm3630a_pwm_ctrl pwm_ctrl; 67 }; 68 69 #endif /* __LINUX_LM3630A_H */ 70