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_init_brt : led a init brightness. 4~255
42  *@leda_max_brt  : led a max brightness.  4~255
43  *@leda_ctrl     : led a disable, enable linear, enable exponential
44  *@ledb_init_brt : led b init brightness. 4~255
45  *@ledb_max_brt  : led b max brightness.  4~255
46  *@ledb_ctrl     : led b disable, enable linear, enable exponential
47  *@pwm_period    : pwm period
48  *@pwm_ctrl      : pwm disable, bank a or b, active high or low
49  */
50 struct lm3630a_platform_data {
51 
52 	/* led a config.  */
53 	int leda_init_brt;
54 	int leda_max_brt;
55 	enum lm3630a_leda_ctrl leda_ctrl;
56 	/* led b config. */
57 	int ledb_init_brt;
58 	int ledb_max_brt;
59 	enum lm3630a_ledb_ctrl ledb_ctrl;
60 	/* pwm config. */
61 	unsigned int pwm_period;
62 	enum lm3630a_pwm_ctrl pwm_ctrl;
63 };
64 
65 #endif /* __LINUX_LM3630A_H */
66