Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * ATC2609A PMIC register definitions
0004  *
0005  * Copyright (C) 2019 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
0006  */
0007 
0008 #ifndef __LINUX_MFD_ATC260X_ATC2609A_H
0009 #define __LINUX_MFD_ATC260X_ATC2609A_H
0010 
0011 enum atc2609a_irq_def {
0012     ATC2609A_IRQ_AUDIO = 0,
0013     ATC2609A_IRQ_OV,
0014     ATC2609A_IRQ_OC,
0015     ATC2609A_IRQ_OT,
0016     ATC2609A_IRQ_UV,
0017     ATC2609A_IRQ_ALARM,
0018     ATC2609A_IRQ_ONOFF,
0019     ATC2609A_IRQ_WKUP,
0020     ATC2609A_IRQ_IR,
0021     ATC2609A_IRQ_REMCON,
0022     ATC2609A_IRQ_POWER_IN,
0023 };
0024 
0025 /* PMU Registers */
0026 #define ATC2609A_PMU_SYS_CTL0           0x00
0027 #define ATC2609A_PMU_SYS_CTL1           0x01
0028 #define ATC2609A_PMU_SYS_CTL2           0x02
0029 #define ATC2609A_PMU_SYS_CTL3           0x03
0030 #define ATC2609A_PMU_SYS_CTL4           0x04
0031 #define ATC2609A_PMU_SYS_CTL5           0x05
0032 #define ATC2609A_PMU_SYS_CTL6           0x06
0033 #define ATC2609A_PMU_SYS_CTL7           0x07
0034 #define ATC2609A_PMU_SYS_CTL8           0x08
0035 #define ATC2609A_PMU_SYS_CTL9           0x09
0036 #define ATC2609A_PMU_BAT_CTL0           0x0A
0037 #define ATC2609A_PMU_BAT_CTL1           0x0B
0038 #define ATC2609A_PMU_VBUS_CTL0          0x0C
0039 #define ATC2609A_PMU_VBUS_CTL1          0x0D
0040 #define ATC2609A_PMU_WALL_CTL0          0x0E
0041 #define ATC2609A_PMU_WALL_CTL1          0x0F
0042 #define ATC2609A_PMU_SYS_PENDING        0x10
0043 #define ATC2609A_PMU_APDS_CTL0          0x11
0044 #define ATC2609A_PMU_APDS_CTL1          0x12
0045 #define ATC2609A_PMU_APDS_CTL2          0x13
0046 #define ATC2609A_PMU_CHARGER_CTL        0x14
0047 #define ATC2609A_PMU_BAKCHARGER_CTL     0x15
0048 #define ATC2609A_PMU_SWCHG_CTL0         0x16
0049 #define ATC2609A_PMU_SWCHG_CTL1         0x17
0050 #define ATC2609A_PMU_SWCHG_CTL2         0x18
0051 #define ATC2609A_PMU_SWCHG_CTL3         0x19
0052 #define ATC2609A_PMU_SWCHG_CTL4         0x1A
0053 #define ATC2609A_PMU_DC_OSC         0x1B
0054 #define ATC2609A_PMU_DC0_CTL0           0x1C
0055 #define ATC2609A_PMU_DC0_CTL1           0x1D
0056 #define ATC2609A_PMU_DC0_CTL2           0x1E
0057 #define ATC2609A_PMU_DC0_CTL3           0x1F
0058 #define ATC2609A_PMU_DC0_CTL4           0x20
0059 #define ATC2609A_PMU_DC0_CTL5           0x21
0060 #define ATC2609A_PMU_DC0_CTL6           0x22
0061 #define ATC2609A_PMU_DC1_CTL0           0x23
0062 #define ATC2609A_PMU_DC1_CTL1           0x24
0063 #define ATC2609A_PMU_DC1_CTL2           0x25
0064 #define ATC2609A_PMU_DC1_CTL3           0x26
0065 #define ATC2609A_PMU_DC1_CTL4           0x27
0066 #define ATC2609A_PMU_DC1_CTL5           0x28
0067 #define ATC2609A_PMU_DC1_CTL6           0x29
0068 #define ATC2609A_PMU_DC2_CTL0           0x2A
0069 #define ATC2609A_PMU_DC2_CTL1           0x2B
0070 #define ATC2609A_PMU_DC2_CTL2           0x2C
0071 #define ATC2609A_PMU_DC2_CTL3           0x2D
0072 #define ATC2609A_PMU_DC2_CTL4           0x2E
0073 #define ATC2609A_PMU_DC2_CTL5           0x2F
0074 #define ATC2609A_PMU_DC2_CTL6           0x30
0075 #define ATC2609A_PMU_DC3_CTL0           0x31
0076 #define ATC2609A_PMU_DC3_CTL1           0x32
0077 #define ATC2609A_PMU_DC3_CTL2           0x33
0078 #define ATC2609A_PMU_DC3_CTL3           0x34
0079 #define ATC2609A_PMU_DC3_CTL4           0x35
0080 #define ATC2609A_PMU_DC3_CTL5           0x36
0081 #define ATC2609A_PMU_DC3_CTL6           0x37
0082 #define ATC2609A_PMU_DC_ZR          0x38
0083 #define ATC2609A_PMU_LDO0_CTL0          0x39
0084 #define ATC2609A_PMU_LDO0_CTL1          0x3A
0085 #define ATC2609A_PMU_LDO1_CTL0          0x3B
0086 #define ATC2609A_PMU_LDO1_CTL1          0x3C
0087 #define ATC2609A_PMU_LDO2_CTL0          0x3D
0088 #define ATC2609A_PMU_LDO2_CTL1          0x3E
0089 #define ATC2609A_PMU_LDO3_CTL0          0x3F
0090 #define ATC2609A_PMU_LDO3_CTL1          0x40
0091 #define ATC2609A_PMU_LDO4_CTL0          0x41
0092 #define ATC2609A_PMU_LDO4_CTL1          0x42
0093 #define ATC2609A_PMU_LDO5_CTL0          0x43
0094 #define ATC2609A_PMU_LDO5_CTL1          0x44
0095 #define ATC2609A_PMU_LDO6_CTL0          0x45
0096 #define ATC2609A_PMU_LDO6_CTL1          0x46
0097 #define ATC2609A_PMU_LDO7_CTL0          0x47
0098 #define ATC2609A_PMU_LDO7_CTL1          0x48
0099 #define ATC2609A_PMU_LDO8_CTL0          0x49
0100 #define ATC2609A_PMU_LDO8_CTL1          0x4A
0101 #define ATC2609A_PMU_LDO9_CTL           0x4B
0102 #define ATC2609A_PMU_OV_INT_EN          0x4C
0103 #define ATC2609A_PMU_OV_STATUS          0x4D
0104 #define ATC2609A_PMU_UV_INT_EN          0x4E
0105 #define ATC2609A_PMU_UV_STATUS          0x4F
0106 #define ATC2609A_PMU_OC_INT_EN          0x50
0107 #define ATC2609A_PMU_OC_STATUS          0x51
0108 #define ATC2609A_PMU_OT_CTL         0x52
0109 #define ATC2609A_PMU_CM_CTL0            0x53
0110 #define ATC2609A_PMU_FW_USE0            0x54
0111 #define ATC2609A_PMU_FW_USE1            0x55
0112 #define ATC2609A_PMU_ADC12B_I           0x56
0113 #define ATC2609A_PMU_ADC12B_V           0x57
0114 #define ATC2609A_PMU_ADC12B_DUMMY       0x58
0115 #define ATC2609A_PMU_AUXADC_CTL0        0x59
0116 #define ATC2609A_PMU_AUXADC_CTL1        0x5A
0117 #define ATC2609A_PMU_BATVADC            0x5B
0118 #define ATC2609A_PMU_BATIADC            0x5C
0119 #define ATC2609A_PMU_WALLVADC           0x5D
0120 #define ATC2609A_PMU_WALLIADC           0x5E
0121 #define ATC2609A_PMU_VBUSVADC           0x5F
0122 #define ATC2609A_PMU_VBUSIADC           0x60
0123 #define ATC2609A_PMU_SYSPWRADC          0x61
0124 #define ATC2609A_PMU_REMCONADC          0x62
0125 #define ATC2609A_PMU_SVCCADC            0x63
0126 #define ATC2609A_PMU_CHGIADC            0x64
0127 #define ATC2609A_PMU_IREFADC            0x65
0128 #define ATC2609A_PMU_BAKBATADC          0x66
0129 #define ATC2609A_PMU_ICTEMPADC          0x67
0130 #define ATC2609A_PMU_AUXADC0            0x68
0131 #define ATC2609A_PMU_AUXADC1            0x69
0132 #define ATC2609A_PMU_AUXADC2            0x6A
0133 #define ATC2609A_PMU_AUXADC3            0x6B
0134 #define ATC2609A_PMU_ICTEMPADC_ADJ      0x6C
0135 #define ATC2609A_PMU_BDG_CTL            0x6D
0136 #define ATC2609A_RTC_CTL            0x6E
0137 #define ATC2609A_RTC_MSALM          0x6F
0138 #define ATC2609A_RTC_HALM           0x70
0139 #define ATC2609A_RTC_YMDALM         0x71
0140 #define ATC2609A_RTC_MS             0x72
0141 #define ATC2609A_RTC_H              0x73
0142 #define ATC2609A_RTC_DC             0x74
0143 #define ATC2609A_RTC_YMD            0x75
0144 #define ATC2609A_EFUSE_DAT          0x76
0145 #define ATC2609A_EFUSECRTL1         0x77
0146 #define ATC2609A_EFUSECRTL2         0x78
0147 #define ATC2609A_PMU_DC4_CTL0           0x79
0148 #define ATC2609A_PMU_DC4_CTL1           0x7A
0149 #define ATC2609A_PMU_DC4_CTL2           0x7B
0150 #define ATC2609A_PMU_DC4_CTL3           0x7C
0151 #define ATC2609A_PMU_DC4_CTL4           0x7D
0152 #define ATC2609A_PMU_DC4_CTL5           0x7E
0153 #define ATC2609A_PMU_DC4_CTL6           0x7F
0154 #define ATC2609A_PMU_PWR_STATUS         0x80
0155 #define ATC2609A_PMU_S2_PWR         0x81
0156 #define ATC2609A_CLMT_CTL0          0x82
0157 #define ATC2609A_CLMT_DATA0         0x83
0158 #define ATC2609A_CLMT_DATA1         0x84
0159 #define ATC2609A_CLMT_DATA2         0x85
0160 #define ATC2609A_CLMT_DATA3         0x86
0161 #define ATC2609A_CLMT_ADD0          0x87
0162 #define ATC2609A_CLMT_ADD1          0x88
0163 #define ATC2609A_CLMT_OCV_TABLE         0x89
0164 #define ATC2609A_CLMT_R_TABLE           0x8A
0165 #define ATC2609A_PMU_PWRON_CTL0         0x8D
0166 #define ATC2609A_PMU_PWRON_CTL1         0x8E
0167 #define ATC2609A_PMU_PWRON_CTL2         0x8F
0168 #define ATC2609A_IRC_CTL            0x90
0169 #define ATC2609A_IRC_STAT           0x91
0170 #define ATC2609A_IRC_CC             0x92
0171 #define ATC2609A_IRC_KDC            0x93
0172 #define ATC2609A_IRC_WK             0x94
0173 #define ATC2609A_IRC_RCC            0x95
0174 
0175 /* AUDIO_OUT Registers */
0176 #define ATC2609A_AUDIOINOUT_CTL         0xA0
0177 #define ATC2609A_AUDIO_DEBUGOUTCTL      0xA1
0178 #define ATC2609A_DAC_DIGITALCTL         0xA2
0179 #define ATC2609A_DAC_VOLUMECTL0         0xA3
0180 #define ATC2609A_DAC_ANALOG0            0xA4
0181 #define ATC2609A_DAC_ANALOG1            0xA5
0182 #define ATC2609A_DAC_ANALOG2            0xA6
0183 #define ATC2609A_DAC_ANALOG3            0xA7
0184 
0185 /* AUDIO_IN Registers */
0186 #define ATC2609A_ADC_DIGITALCTL         0xA8
0187 #define ATC2609A_ADC_HPFCTL         0xA9
0188 #define ATC2609A_ADC_CTL            0xAA
0189 #define ATC2609A_AGC_CTL0           0xAB
0190 #define ATC2609A_AGC_CTL1           0xAC
0191 #define ATC2609A_AGC_CTL2           0xAD
0192 #define ATC2609A_ADC_ANALOG0            0xAE
0193 #define ATC2609A_ADC_ANALOG1            0xAF
0194 
0195 /* PCM_IF Registers */
0196 #define ATC2609A_PCM0_CTL           0xB0
0197 #define ATC2609A_PCM1_CTL           0xB1
0198 #define ATC2609A_PCM2_CTL           0xB2
0199 #define ATC2609A_PCMIF_CTL          0xB3
0200 
0201 /* CMU_CONTROL Registers */
0202 #define ATC2609A_CMU_DEVRST         0xC1
0203 
0204 /* INTS Registers */
0205 #define ATC2609A_INTS_PD            0xC8
0206 #define ATC2609A_INTS_MSK           0xC9
0207 
0208 /* MFP Registers */
0209 #define ATC2609A_MFP_CTL            0xD0
0210 #define ATC2609A_PAD_VSEL           0xD1
0211 #define ATC2609A_GPIO_OUTEN         0xD2
0212 #define ATC2609A_GPIO_INEN          0xD3
0213 #define ATC2609A_GPIO_DAT           0xD4
0214 #define ATC2609A_PAD_DRV            0xD5
0215 #define ATC2609A_PAD_EN             0xD6
0216 #define ATC2609A_DEBUG_SEL          0xD7
0217 #define ATC2609A_DEBUG_IE           0xD8
0218 #define ATC2609A_DEBUG_OE           0xD9
0219 #define ATC2609A_CHIP_VER           0xDC
0220 
0221 /* PWSI Registers */
0222 #define ATC2609A_PWSI_CTL           0xF0
0223 #define ATC2609A_PWSI_STATUS            0xF1
0224 
0225 /* TWSI Registers */
0226 #define ATC2609A_SADDR              0xFF
0227 
0228 /* PMU_SYS_CTL0 Register Mask Bits */
0229 #define ATC2609A_PMU_SYS_CTL0_IR_WK_EN          BIT(5)
0230 #define ATC2609A_PMU_SYS_CTL0_RESET_WK_EN       BIT(6)
0231 #define ATC2609A_PMU_SYS_CTL0_HDSW_WK_EN        BIT(7)
0232 #define ATC2609A_PMU_SYS_CTL0_ALARM_WK_EN       BIT(8)
0233 #define ATC2609A_PMU_SYS_CTL0_REM_CON_WK_EN     BIT(9)
0234 #define ATC2609A_PMU_SYS_CTL0_RESTART_EN        BIT(10)
0235 #define ATC2609A_PMU_SYS_CTL0_WKIRQ_WK_EN       BIT(11)
0236 #define ATC2609A_PMU_SYS_CTL0_ONOFF_SHORT_WK_EN     BIT(12)
0237 #define ATC2609A_PMU_SYS_CTL0_ONOFF_LONG_WK_EN      BIT(13)
0238 #define ATC2609A_PMU_SYS_CTL0_WALL_WK_EN        BIT(14)
0239 #define ATC2609A_PMU_SYS_CTL0_USB_WK_EN         BIT(15)
0240 #define ATC2609A_PMU_SYS_CTL0_WK_ALL            (GENMASK(15, 5) & (~BIT(10)))
0241 
0242 /* PMU_SYS_CTL1 Register Mask Bits */
0243 #define ATC2609A_PMU_SYS_CTL1_EN_S1         BIT(0)
0244 #define ATC2609A_PMU_SYS_CTL1_LB_S4_EN          BIT(2)
0245 #define ATC2609A_PMU_SYS_CTL1_LB_S4         GENMASK(4, 3)
0246 #define ATC2609A_PMU_SYS_CTL1_LB_S4_3_1V        BIT(4)
0247 #define ATC2609A_PMU_SYS_CTL1_IR_WK_FLAG        BIT(5)
0248 #define ATC2609A_PMU_SYS_CTL1_RESET_WK_FLAG     BIT(6)
0249 #define ATC2609A_PMU_SYS_CTL1_HDSW_WK_FLAG      BIT(7)
0250 #define ATC2609A_PMU_SYS_CTL1_ALARM_WK_FLAG     BIT(8)
0251 #define ATC2609A_PMU_SYS_CTL1_REM_CON_WK_FLAG       BIT(9)
0252 #define ATC2609A_PMU_SYS_CTL1_RESTART_WK_FLAG       BIT(10)
0253 #define ATC2609A_PMU_SYS_CTL1_WKIRQ_WK_FLAG     BIT(11)
0254 #define ATC2609A_PMU_SYS_CTL1_ONOFF_SHORT_WK_FLAG   BIT(12)
0255 #define ATC2609A_PMU_SYS_CTL1_ONOFF_LONG_WK_FLAG    BIT(13)
0256 #define ATC2609A_PMU_SYS_CTL1_WALL_WK_FLAG      BIT(14)
0257 #define ATC2609A_PMU_SYS_CTL1_USB_WK_FLAG       BIT(15)
0258 
0259 /* PMU_SYS_CTL2 Register Mask Bits */
0260 #define ATC2609A_PMU_SYS_CTL2_PMU_A_EN          BIT(0)
0261 #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_INT_EN    BIT(1)
0262 #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_PD        BIT(2)
0263 #define ATC2609A_PMU_SYS_CTL2_S2TIMER           GENMASK(5, 3)
0264 #define ATC2609A_PMU_SYS_CTL2_S2_TIMER_EN       BIT(6)
0265 #define ATC2609A_PMU_SYS_CTL2_ONOFF_RESET_TIME_SEL  GENMASK(8, 7)
0266 #define ATC2609A_PMU_SYS_CTL2_ONOFF_RESET_EN        BIT(9)
0267 #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS_TIME      GENMASK(11, 10)
0268 #define ATC2609A_PMU_SYS_CTL2_ONOFF_LSP_INT_EN      BIT(12)
0269 #define ATC2609A_PMU_SYS_CTL2_ONOFF_LONG_PRESS      BIT(13)
0270 #define ATC2609A_PMU_SYS_CTL2_ONOFF_SHORT_PRESS     BIT(14)
0271 #define ATC2609A_PMU_SYS_CTL2_ONOFF_PRESS       BIT(15)
0272 
0273 /* PMU_SYS_CTL3 Register Mask Bits */
0274 #define ATC2609A_PMU_SYS_CTL3_S2S3TOS1_TIMER        GENMASK(8, 7)
0275 #define ATC2609A_PMU_SYS_CTL3_S2S3TOS1_TIMER_EN     BIT(9)
0276 #define ATC2609A_PMU_SYS_CTL3_S3_TIMER          GENMASK(12, 10)
0277 #define ATC2609A_PMU_SYS_CTL3_S3_TIMER_EN       BIT(13)
0278 #define ATC2609A_PMU_SYS_CTL3_EN_S3         BIT(14)
0279 #define ATC2609A_PMU_SYS_CTL3_EN_S2         BIT(15)
0280 
0281 /* PMU_SYS_CTL5 Register Mask Bits */
0282 #define ATC2609A_PMU_SYS_CTL5_WALLWKDTEN        BIT(7)
0283 #define ATC2609A_PMU_SYS_CTL5_VBUSWKDTEN        BIT(8)
0284 #define ATC2609A_PMU_SYS_CTL5_REMCON_DECT_EN        BIT(9)
0285 #define ATC2609A_PMU_SYS_CTL5_ONOFF_8S_SEL      BIT(10)
0286 
0287 /* INTS_MSK Register Mask Bits */
0288 #define ATC2609A_INTS_MSK_AUDIO             BIT(0)
0289 #define ATC2609A_INTS_MSK_OV                BIT(1)
0290 #define ATC2609A_INTS_MSK_OC                BIT(2)
0291 #define ATC2609A_INTS_MSK_OT                BIT(3)
0292 #define ATC2609A_INTS_MSK_UV                BIT(4)
0293 #define ATC2609A_INTS_MSK_ALARM             BIT(5)
0294 #define ATC2609A_INTS_MSK_ONOFF             BIT(6)
0295 #define ATC2609A_INTS_MSK_WKUP              BIT(7)
0296 #define ATC2609A_INTS_MSK_IR                BIT(8)
0297 #define ATC2609A_INTS_MSK_REMCON            BIT(9)
0298 #define ATC2609A_INTS_MSK_POWERIN           BIT(10)
0299 
0300 /* CMU_DEVRST Register Mask Bits */
0301 #define ATC2609A_CMU_DEVRST_AUDIO           BIT(0)
0302 #define ATC2609A_CMU_DEVRST_MFP             BIT(1)
0303 #define ATC2609A_CMU_DEVRST_INTS            BIT(2)
0304 
0305 /* PAD_EN Register Mask Bits */
0306 #define ATC2609A_PAD_EN_EXTIRQ              BIT(0)
0307 
0308 #endif /* __LINUX_MFD_ATC260X_ATC2609A_H */