1 /* SPDX-License-Identifier: GPL-2.0 */
3 // Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com/
5 #ifndef _TI_LMU_COMMON_H_
6 #define _TI_LMU_COMMON_H_
8 #include <linux/delay.h>
9 #include <linux/device.h>
10 #include <linux/init.h>
11 #include <linux/leds.h>
12 #include <linux/module.h>
13 #include <linux/regmap.h>
14 #include <linux/slab.h>
15 #include <uapi/linux/uleds.h>
17 #define LMU_11BIT_LSB_MASK (BIT(0) | BIT(1) | BIT(2))
18 #define LMU_11BIT_MSB_SHIFT 3
20 #define MAX_BRIGHTNESS_8BIT 255
21 #define MAX_BRIGHTNESS_11BIT 2047
24 struct regmap
*regmap
;
28 u8 lsb_brightness_reg
;
29 u8 msb_brightness_reg
;
36 int ti_lmu_common_set_brightness(struct ti_lmu_bank
*lmu_bank
, int brightness
);
38 int ti_lmu_common_set_ramp(struct ti_lmu_bank
*lmu_bank
);
40 int ti_lmu_common_get_ramp_params(struct device
*dev
,
41 struct fwnode_handle
*child
,
42 struct ti_lmu_bank
*lmu_data
);
44 int ti_lmu_common_get_brt_res(struct device
*dev
, struct fwnode_handle
*child
,
45 struct ti_lmu_bank
*lmu_data
);
47 #endif /* _TI_LMU_COMMON_H_ */