Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * TI LMU (Lighting Management Unit) Device Register Map
0004  *
0005  * Copyright 2017 Texas Instruments
0006  *
0007  * Author: Milo Kim <milo.kim@ti.com>
0008  */
0009 
0010 #ifndef __MFD_TI_LMU_REGISTER_H__
0011 #define __MFD_TI_LMU_REGISTER_H__
0012 
0013 #include <linux/bitops.h>
0014 
0015 /* LM3631 */
0016 #define LM3631_REG_DEVCTRL          0x00
0017 #define LM3631_LCD_EN_MASK          BIT(1)
0018 #define LM3631_BL_EN_MASK           BIT(0)
0019 
0020 #define LM3631_REG_BRT_LSB          0x01
0021 #define LM3631_REG_BRT_MSB          0x02
0022 
0023 #define LM3631_REG_BL_CFG           0x06
0024 #define LM3631_BL_CHANNEL_MASK          BIT(3)
0025 #define LM3631_BL_DUAL_CHANNEL          0
0026 #define LM3631_BL_SINGLE_CHANNEL        BIT(3)
0027 #define LM3631_MAP_MASK             BIT(5)
0028 #define LM3631_EXPONENTIAL_MAP          0
0029 
0030 #define LM3631_REG_BRT_MODE         0x08
0031 #define LM3631_MODE_MASK            (BIT(1) | BIT(2) | BIT(3))
0032 #define LM3631_DEFAULT_MODE         (BIT(1) | BIT(3))
0033 
0034 #define LM3631_REG_SLOPE            0x09
0035 #define LM3631_SLOPE_MASK           0xF0
0036 #define LM3631_SLOPE_SHIFT          4
0037 
0038 #define LM3631_REG_LDO_CTRL1            0x0A
0039 #define LM3631_EN_OREF_MASK         BIT(0)
0040 #define LM3631_EN_VNEG_MASK         BIT(1)
0041 #define LM3631_EN_VPOS_MASK         BIT(2)
0042 
0043 #define LM3631_REG_LDO_CTRL2            0x0B
0044 #define LM3631_EN_CONT_MASK         BIT(0)
0045 
0046 #define LM3631_REG_VOUT_CONT            0x0C
0047 #define LM3631_VOUT_CONT_MASK           (BIT(6) | BIT(7))
0048 
0049 #define LM3631_REG_VOUT_BOOST           0x0C
0050 #define LM3631_REG_VOUT_POS         0x0D
0051 #define LM3631_REG_VOUT_NEG         0x0E
0052 #define LM3631_REG_VOUT_OREF            0x0F
0053 #define LM3631_VOUT_MASK            0x3F
0054 
0055 #define LM3631_REG_ENTIME_VCONT         0x0B
0056 #define LM3631_ENTIME_CONT_MASK         0x70
0057 
0058 #define LM3631_REG_ENTIME_VOREF         0x0F
0059 #define LM3631_REG_ENTIME_VPOS          0x10
0060 #define LM3631_REG_ENTIME_VNEG          0x11
0061 #define LM3631_ENTIME_MASK          0xF0
0062 #define LM3631_ENTIME_SHIFT         4
0063 
0064 #define LM3631_MAX_REG              0x16
0065 
0066 /* LM3632 */
0067 #define LM3632_REG_CONFIG1          0x02
0068 #define LM3632_OVP_MASK             (BIT(5) | BIT(6) | BIT(7))
0069 #define LM3632_OVP_25V              BIT(6)
0070 
0071 #define LM3632_REG_CONFIG2          0x03
0072 #define LM3632_SWFREQ_MASK          BIT(7)
0073 #define LM3632_SWFREQ_1MHZ          BIT(7)
0074 
0075 #define LM3632_REG_BRT_LSB          0x04
0076 #define LM3632_REG_BRT_MSB          0x05
0077 
0078 #define LM3632_REG_IO_CTRL          0x09
0079 #define LM3632_PWM_MASK             BIT(6)
0080 #define LM3632_I2C_MODE             0
0081 #define LM3632_PWM_MODE             BIT(6)
0082 
0083 #define LM3632_REG_ENABLE           0x0A
0084 #define LM3632_BL_EN_MASK           BIT(0)
0085 #define LM3632_BL_CHANNEL_MASK          (BIT(3) | BIT(4))
0086 #define LM3632_BL_SINGLE_CHANNEL            BIT(4)
0087 #define LM3632_BL_DUAL_CHANNEL          BIT(3)
0088 
0089 #define LM3632_REG_BIAS_CONFIG          0x0C
0090 #define LM3632_EXT_EN_MASK          BIT(0)
0091 #define LM3632_EN_VNEG_MASK         BIT(1)
0092 #define LM3632_EN_VPOS_MASK         BIT(2)
0093 
0094 #define LM3632_REG_VOUT_BOOST           0x0D
0095 #define LM3632_REG_VOUT_POS         0x0E
0096 #define LM3632_REG_VOUT_NEG         0x0F
0097 #define LM3632_VOUT_MASK            0x3F
0098 
0099 #define LM3632_MAX_REG              0x10
0100 
0101 /* LM3633 */
0102 #define LM3633_REG_HVLED_OUTPUT_CFG     0x10
0103 #define LM3633_HVLED1_CFG_MASK          BIT(0)
0104 #define LM3633_HVLED2_CFG_MASK          BIT(1)
0105 #define LM3633_HVLED3_CFG_MASK          BIT(2)
0106 #define LM3633_HVLED1_CFG_SHIFT         0
0107 #define LM3633_HVLED2_CFG_SHIFT         1
0108 #define LM3633_HVLED3_CFG_SHIFT         2
0109 
0110 #define LM3633_REG_BANK_SEL         0x11
0111 
0112 #define LM3633_REG_BL0_RAMP         0x12
0113 #define LM3633_REG_BL1_RAMP         0x13
0114 #define LM3633_BL_RAMPUP_MASK           0xF0
0115 #define LM3633_BL_RAMPUP_SHIFT          4
0116 #define LM3633_BL_RAMPDN_MASK           0x0F
0117 #define LM3633_BL_RAMPDN_SHIFT          0
0118 
0119 #define LM3633_REG_BL_RAMP_CONF         0x1B
0120 #define LM3633_BL_RAMP_MASK         0x0F
0121 #define LM3633_BL_RAMP_EACH         0x05
0122 
0123 #define LM3633_REG_PTN0_RAMP            0x1C
0124 #define LM3633_REG_PTN1_RAMP            0x1D
0125 #define LM3633_PTN_RAMPUP_MASK          0x70
0126 #define LM3633_PTN_RAMPUP_SHIFT         4
0127 #define LM3633_PTN_RAMPDN_MASK          0x07
0128 #define LM3633_PTN_RAMPDN_SHIFT         0
0129 
0130 #define LM3633_REG_LED_MAPPING_MODE     0x1F
0131 #define LM3633_LED_EXPONENTIAL          BIT(1)
0132 
0133 #define LM3633_REG_IMAX_HVLED_A         0x20
0134 #define LM3633_REG_IMAX_HVLED_B         0x21
0135 #define LM3633_REG_IMAX_LVLED_BASE      0x22
0136 
0137 #define LM3633_REG_BL_FEEDBACK_ENABLE       0x28
0138 
0139 #define LM3633_REG_ENABLE           0x2B
0140 #define LM3633_LED_BANK_OFFSET          2
0141 
0142 #define LM3633_REG_PATTERN          0x2C
0143 
0144 #define LM3633_REG_BOOST_CFG            0x2D
0145 #define LM3633_OVP_MASK             (BIT(1) | BIT(2))
0146 #define LM3633_OVP_40V              0x6
0147 
0148 #define LM3633_REG_PWM_CFG          0x2F
0149 #define LM3633_PWM_A_MASK           BIT(0)
0150 #define LM3633_PWM_B_MASK           BIT(1)
0151 
0152 #define LM3633_REG_BRT_HVLED_A_LSB      0x40
0153 #define LM3633_REG_BRT_HVLED_A_MSB      0x41
0154 #define LM3633_REG_BRT_HVLED_B_LSB      0x42
0155 #define LM3633_REG_BRT_HVLED_B_MSB      0x43
0156 
0157 #define LM3633_REG_BRT_LVLED_BASE       0x44
0158 
0159 #define LM3633_REG_PTN_DELAY            0x50
0160 
0161 #define LM3633_REG_PTN_LOWTIME          0x51
0162 
0163 #define LM3633_REG_PTN_HIGHTIME         0x52
0164 
0165 #define LM3633_REG_PTN_LOWBRT           0x53
0166 
0167 #define LM3633_REG_PTN_HIGHBRT          LM3633_REG_BRT_LVLED_BASE
0168 
0169 #define LM3633_REG_BL_OPEN_FAULT_STATUS     0xB0
0170 
0171 #define LM3633_REG_BL_SHORT_FAULT_STATUS    0xB2
0172 
0173 #define LM3633_REG_MONITOR_ENABLE       0xB4
0174 
0175 #define LM3633_MAX_REG              0xB4
0176 
0177 /* LM3695 */
0178 #define LM3695_REG_GP               0x10
0179 #define LM3695_BL_CHANNEL_MASK          BIT(3)
0180 #define LM3695_BL_DUAL_CHANNEL          0
0181 #define LM3695_BL_SINGLE_CHANNEL            BIT(3)
0182 #define LM3695_BRT_RW_MASK          BIT(2)
0183 #define LM3695_BL_EN_MASK           BIT(0)
0184 
0185 #define LM3695_REG_BRT_LSB          0x13
0186 #define LM3695_REG_BRT_MSB          0x14
0187 
0188 #define LM3695_MAX_REG              0x14
0189 
0190 /* LM36274 */
0191 #define LM36274_REG_REV             0x01
0192 #define LM36274_REG_BL_CFG_1            0x02
0193 #define LM36274_REG_BL_CFG_2            0x03
0194 #define LM36274_REG_BRT_LSB         0x04
0195 #define LM36274_REG_BRT_MSB         0x05
0196 #define LM36274_REG_BL_EN           0x08
0197 
0198 #define LM36274_REG_BIAS_CONFIG_1       0x09
0199 #define LM36274_EXT_EN_MASK         BIT(0)
0200 #define LM36274_EN_VNEG_MASK            BIT(1)
0201 #define LM36274_EN_VPOS_MASK            BIT(2)
0202 
0203 #define LM36274_REG_BIAS_CONFIG_2       0x0a
0204 #define LM36274_REG_BIAS_CONFIG_3       0x0b
0205 #define LM36274_REG_VOUT_BOOST          0x0c
0206 #define LM36274_REG_VOUT_POS            0x0d
0207 #define LM36274_REG_VOUT_NEG            0x0e
0208 #define LM36274_VOUT_MASK           0x3F
0209 
0210 #define LM36274_MAX_REG             0x13
0211 
0212 #endif