1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | /* |
3 | * TI LMU (Lighting Management Unit) Devices |
4 | * |
5 | * Copyright 2017 Texas Instruments |
6 | * |
7 | * Author: Milo Kim <milo.kim@ti.com> |
8 | */ |
9 | |
10 | #ifndef __MFD_TI_LMU_H__ |
11 | #define __MFD_TI_LMU_H__ |
12 | |
13 | #include <linux/gpio.h> |
14 | #include <linux/notifier.h> |
15 | #include <linux/regmap.h> |
16 | #include <linux/gpio/consumer.h> |
17 | |
18 | /* Notifier event */ |
19 | #define LMU_EVENT_MONITOR_DONE 0x01 |
20 | |
21 | enum ti_lmu_id { |
22 | LM3631, |
23 | LM3632, |
24 | LM3633, |
25 | LM3695, |
26 | LM36274, |
27 | LMU_MAX_ID, |
28 | }; |
29 | |
30 | enum ti_lmu_max_current { |
31 | LMU_IMAX_5mA, |
32 | LMU_IMAX_6mA, |
33 | LMU_IMAX_7mA = 0x03, |
34 | LMU_IMAX_8mA, |
35 | LMU_IMAX_9mA, |
36 | LMU_IMAX_10mA = 0x07, |
37 | LMU_IMAX_11mA, |
38 | LMU_IMAX_12mA, |
39 | LMU_IMAX_13mA, |
40 | LMU_IMAX_14mA, |
41 | LMU_IMAX_15mA = 0x0D, |
42 | LMU_IMAX_16mA, |
43 | LMU_IMAX_17mA, |
44 | LMU_IMAX_18mA, |
45 | LMU_IMAX_19mA, |
46 | LMU_IMAX_20mA = 0x13, |
47 | LMU_IMAX_21mA, |
48 | LMU_IMAX_22mA, |
49 | LMU_IMAX_23mA = 0x17, |
50 | LMU_IMAX_24mA, |
51 | LMU_IMAX_25mA, |
52 | LMU_IMAX_26mA, |
53 | LMU_IMAX_27mA = 0x1C, |
54 | LMU_IMAX_28mA, |
55 | LMU_IMAX_29mA, |
56 | LMU_IMAX_30mA, |
57 | }; |
58 | |
59 | enum lm363x_regulator_id { |
60 | LM3631_BOOST, /* Boost output */ |
61 | LM3631_LDO_CONT, /* Display panel controller */ |
62 | LM3631_LDO_OREF, /* Gamma reference */ |
63 | LM3631_LDO_POS, /* Positive display bias output */ |
64 | LM3631_LDO_NEG, /* Negative display bias output */ |
65 | LM3632_BOOST, /* Boost output */ |
66 | LM3632_LDO_POS, /* Positive display bias output */ |
67 | LM3632_LDO_NEG, /* Negative display bias output */ |
68 | LM36274_BOOST, /* Boost output */ |
69 | LM36274_LDO_POS, /* Positive display bias output */ |
70 | LM36274_LDO_NEG, /* Negative display bias output */ |
71 | }; |
72 | |
73 | /** |
74 | * struct ti_lmu |
75 | * |
76 | * @dev: Parent device pointer |
77 | * @regmap: Used for i2c communcation on accessing registers |
78 | * @en_gpio: GPIO for HWEN pin [Optional] |
79 | * @notifier: Notifier for reporting hwmon event |
80 | */ |
81 | struct ti_lmu { |
82 | struct device *dev; |
83 | struct regmap *regmap; |
84 | struct gpio_desc *en_gpio; |
85 | struct blocking_notifier_head notifier; |
86 | }; |
87 | #endif |
88 | |