Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * TI LMU (Lighting Management Unit) Devices
0004  *
0005  * Copyright 2017 Texas Instruments
0006  *
0007  * Author: Milo Kim <milo.kim@ti.com>
0008  */
0009 
0010 #ifndef __MFD_TI_LMU_H__
0011 #define __MFD_TI_LMU_H__
0012 
0013 #include <linux/gpio.h>
0014 #include <linux/notifier.h>
0015 #include <linux/regmap.h>
0016 #include <linux/gpio/consumer.h>
0017 
0018 /* Notifier event */
0019 #define LMU_EVENT_MONITOR_DONE      0x01
0020 
0021 enum ti_lmu_id {
0022     LM3631,
0023     LM3632,
0024     LM3633,
0025     LM3695,
0026     LM36274,
0027     LMU_MAX_ID,
0028 };
0029 
0030 enum ti_lmu_max_current {
0031     LMU_IMAX_5mA,
0032     LMU_IMAX_6mA,
0033     LMU_IMAX_7mA = 0x03,
0034     LMU_IMAX_8mA,
0035     LMU_IMAX_9mA,
0036     LMU_IMAX_10mA = 0x07,
0037     LMU_IMAX_11mA,
0038     LMU_IMAX_12mA,
0039     LMU_IMAX_13mA,
0040     LMU_IMAX_14mA,
0041     LMU_IMAX_15mA = 0x0D,
0042     LMU_IMAX_16mA,
0043     LMU_IMAX_17mA,
0044     LMU_IMAX_18mA,
0045     LMU_IMAX_19mA,
0046     LMU_IMAX_20mA = 0x13,
0047     LMU_IMAX_21mA,
0048     LMU_IMAX_22mA,
0049     LMU_IMAX_23mA = 0x17,
0050     LMU_IMAX_24mA,
0051     LMU_IMAX_25mA,
0052     LMU_IMAX_26mA,
0053     LMU_IMAX_27mA = 0x1C,
0054     LMU_IMAX_28mA,
0055     LMU_IMAX_29mA,
0056     LMU_IMAX_30mA,
0057 };
0058 
0059 enum lm363x_regulator_id {
0060     LM3631_BOOST,       /* Boost output */
0061     LM3631_LDO_CONT,    /* Display panel controller */
0062     LM3631_LDO_OREF,    /* Gamma reference */
0063     LM3631_LDO_POS,     /* Positive display bias output */
0064     LM3631_LDO_NEG,     /* Negative display bias output */
0065     LM3632_BOOST,       /* Boost output */
0066     LM3632_LDO_POS,     /* Positive display bias output */
0067     LM3632_LDO_NEG,     /* Negative display bias output */
0068     LM36274_BOOST,      /* Boost output */
0069     LM36274_LDO_POS,    /* Positive display bias output */
0070     LM36274_LDO_NEG,    /* Negative display bias output */
0071 };
0072 
0073 /**
0074  * struct ti_lmu
0075  *
0076  * @dev:    Parent device pointer
0077  * @regmap: Used for i2c communcation on accessing registers
0078  * @en_gpio:    GPIO for HWEN pin [Optional]
0079  * @notifier:   Notifier for reporting hwmon event
0080  */
0081 struct ti_lmu {
0082     struct device *dev;
0083     struct regmap *regmap;
0084     struct gpio_desc *en_gpio;
0085     struct blocking_notifier_head notifier;
0086 };
0087 #endif