xref: /linux/include/linux/platform_data/lm3630a_bl.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
228e64a68SDaniel Jeong /*
328e64a68SDaniel Jeong * Simple driver for Texas Instruments LM3630A LED Flash driver chip
428e64a68SDaniel Jeong * Copyright (C) 2012 Texas Instruments
528e64a68SDaniel Jeong */
628e64a68SDaniel Jeong 
728e64a68SDaniel Jeong #ifndef __LINUX_LM3630A_H
828e64a68SDaniel Jeong #define __LINUX_LM3630A_H
928e64a68SDaniel Jeong 
1028e64a68SDaniel Jeong #define LM3630A_NAME "lm3630a_bl"
1128e64a68SDaniel Jeong 
1228e64a68SDaniel Jeong enum lm3630a_pwm_ctrl {
1328e64a68SDaniel Jeong 	LM3630A_PWM_DISABLE = 0x00,
1428e64a68SDaniel Jeong 	LM3630A_PWM_BANK_A,
1528e64a68SDaniel Jeong 	LM3630A_PWM_BANK_B,
1628e64a68SDaniel Jeong 	LM3630A_PWM_BANK_ALL,
1728e64a68SDaniel Jeong 	LM3630A_PWM_BANK_A_ACT_LOW = 0x05,
1828e64a68SDaniel Jeong 	LM3630A_PWM_BANK_B_ACT_LOW,
1928e64a68SDaniel Jeong 	LM3630A_PWM_BANK_ALL_ACT_LOW,
2028e64a68SDaniel Jeong };
2128e64a68SDaniel Jeong 
2228e64a68SDaniel Jeong enum lm3630a_leda_ctrl {
2328e64a68SDaniel Jeong 	LM3630A_LEDA_DISABLE = 0x00,
2428e64a68SDaniel Jeong 	LM3630A_LEDA_ENABLE = 0x04,
2528e64a68SDaniel Jeong 	LM3630A_LEDA_ENABLE_LINEAR = 0x14,
2628e64a68SDaniel Jeong };
2728e64a68SDaniel Jeong 
2828e64a68SDaniel Jeong enum lm3630a_ledb_ctrl {
2928e64a68SDaniel Jeong 	LM3630A_LEDB_DISABLE = 0x00,
3028e64a68SDaniel Jeong 	LM3630A_LEDB_ON_A = 0x01,
3128e64a68SDaniel Jeong 	LM3630A_LEDB_ENABLE = 0x02,
3228e64a68SDaniel Jeong 	LM3630A_LEDB_ENABLE_LINEAR = 0x0A,
3328e64a68SDaniel Jeong };
3428e64a68SDaniel Jeong 
3528e64a68SDaniel Jeong #define LM3630A_MAX_BRIGHTNESS 255
3628e64a68SDaniel Jeong /*
378fbce8efSBrian Masney  *@leda_label    : optional led a label.
3828e64a68SDaniel Jeong  *@leda_init_brt : led a init brightness. 4~255
3928e64a68SDaniel Jeong  *@leda_max_brt  : led a max brightness.  4~255
4028e64a68SDaniel Jeong  *@leda_ctrl     : led a disable, enable linear, enable exponential
418fbce8efSBrian Masney  *@ledb_label    : optional led b label.
4228e64a68SDaniel Jeong  *@ledb_init_brt : led b init brightness. 4~255
4328e64a68SDaniel Jeong  *@ledb_max_brt  : led b max brightness.  4~255
4428e64a68SDaniel Jeong  *@ledb_ctrl     : led b disable, enable linear, enable exponential
4528e64a68SDaniel Jeong  *@pwm_period    : pwm period
4628e64a68SDaniel Jeong  *@pwm_ctrl      : pwm disable, bank a or b, active high or low
4728e64a68SDaniel Jeong  */
4828e64a68SDaniel Jeong struct lm3630a_platform_data {
4928e64a68SDaniel Jeong 
5028e64a68SDaniel Jeong 	/* led a config.  */
518fbce8efSBrian Masney 	const char *leda_label;
5228e64a68SDaniel Jeong 	int leda_init_brt;
5328e64a68SDaniel Jeong 	int leda_max_brt;
5428e64a68SDaniel Jeong 	enum lm3630a_leda_ctrl leda_ctrl;
5528e64a68SDaniel Jeong 	/* led b config. */
568fbce8efSBrian Masney 	const char *ledb_label;
5728e64a68SDaniel Jeong 	int ledb_init_brt;
5828e64a68SDaniel Jeong 	int ledb_max_brt;
5928e64a68SDaniel Jeong 	enum lm3630a_ledb_ctrl ledb_ctrl;
6028e64a68SDaniel Jeong 	/* pwm config. */
6128e64a68SDaniel Jeong 	unsigned int pwm_period;
6228e64a68SDaniel Jeong 	enum lm3630a_pwm_ctrl pwm_ctrl;
6328e64a68SDaniel Jeong };
6428e64a68SDaniel Jeong 
6528e64a68SDaniel Jeong #endif /* __LINUX_LM3630A_H */
66