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