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