diff options
author | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> | 2015-06-26 09:08:11 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-08-11 10:08:41 -0400 |
commit | bc00d68f2f209dd7ad01f64c3bdf67e608c363f1 (patch) | |
tree | 09f26a454fe0fe65dd778925a0f1cf1ea5f76cc1 | |
parent | acdecb04e2115747f260700384f2c403c8e9693e (diff) |
mfd: 880m80x: Make use of BIT() macro
Instead of hard coding the shift for bit definition, use
BIT() macro.
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | include/linux/mfd/88pm80x.h | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index 97cb283cc8e1..8fcad63fab55 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h | |||
@@ -60,60 +60,60 @@ enum { | |||
60 | /* page 0 basic: slave adder 0x60 */ | 60 | /* page 0 basic: slave adder 0x60 */ |
61 | 61 | ||
62 | #define PM800_STATUS_1 (0x01) | 62 | #define PM800_STATUS_1 (0x01) |
63 | #define PM800_ONKEY_STS1 (1 << 0) | 63 | #define PM800_ONKEY_STS1 BIT(0) |
64 | #define PM800_EXTON_STS1 (1 << 1) | 64 | #define PM800_EXTON_STS1 BIT(1) |
65 | #define PM800_CHG_STS1 (1 << 2) | 65 | #define PM800_CHG_STS1 BIT(2) |
66 | #define PM800_BAT_STS1 (1 << 3) | 66 | #define PM800_BAT_STS1 BIT(3) |
67 | #define PM800_VBUS_STS1 (1 << 4) | 67 | #define PM800_VBUS_STS1 BIT(4) |
68 | #define PM800_LDO_PGOOD_STS1 (1 << 5) | 68 | #define PM800_LDO_PGOOD_STS1 BIT(5) |
69 | #define PM800_BUCK_PGOOD_STS1 (1 << 6) | 69 | #define PM800_BUCK_PGOOD_STS1 BIT(6) |
70 | 70 | ||
71 | #define PM800_STATUS_2 (0x02) | 71 | #define PM800_STATUS_2 (0x02) |
72 | #define PM800_RTC_ALARM_STS2 (1 << 0) | 72 | #define PM800_RTC_ALARM_STS2 BIT(0) |
73 | 73 | ||
74 | /* Wakeup Registers */ | 74 | /* Wakeup Registers */ |
75 | #define PM800_WAKEUP1 (0x0D) | 75 | #define PM800_WAKEUP1 (0x0D) |
76 | 76 | ||
77 | #define PM800_WAKEUP2 (0x0E) | 77 | #define PM800_WAKEUP2 (0x0E) |
78 | #define PM800_WAKEUP2_INV_INT (1 << 0) | 78 | #define PM800_WAKEUP2_INV_INT BIT(0) |
79 | #define PM800_WAKEUP2_INT_CLEAR (1 << 1) | 79 | #define PM800_WAKEUP2_INT_CLEAR BIT(1) |
80 | #define PM800_WAKEUP2_INT_MASK (1 << 2) | 80 | #define PM800_WAKEUP2_INT_MASK BIT(2) |
81 | 81 | ||
82 | #define PM800_POWER_UP_LOG (0x10) | 82 | #define PM800_POWER_UP_LOG (0x10) |
83 | 83 | ||
84 | /* Referance and low power registers */ | 84 | /* Referance and low power registers */ |
85 | #define PM800_LOW_POWER1 (0x20) | 85 | #define PM800_LOW_POWER1 (0x20) |
86 | #define PM800_LOW_POWER2 (0x21) | 86 | #define PM800_LOW_POWER2 (0x21) |
87 | #define PM800_LOW_POWER_CONFIG3 (0x22) | 87 | #define PM800_LOW_POWER_CONFIG3 (0x22) |
88 | #define PM800_LOW_POWER_CONFIG4 (0x23) | 88 | #define PM800_LOW_POWER_CONFIG4 (0x23) |
89 | 89 | ||
90 | /* GPIO register */ | 90 | /* GPIO register */ |
91 | #define PM800_GPIO_0_1_CNTRL (0x30) | 91 | #define PM800_GPIO_0_1_CNTRL (0x30) |
92 | #define PM800_GPIO0_VAL (1 << 0) | 92 | #define PM800_GPIO0_VAL BIT(0) |
93 | #define PM800_GPIO0_GPIO_MODE(x) (x << 1) | 93 | #define PM800_GPIO0_GPIO_MODE(x) (x << 1) |
94 | #define PM800_GPIO1_VAL (1 << 4) | 94 | #define PM800_GPIO1_VAL BIT(4) |
95 | #define PM800_GPIO1_GPIO_MODE(x) (x << 5) | 95 | #define PM800_GPIO1_GPIO_MODE(x) (x << 5) |
96 | 96 | ||
97 | #define PM800_GPIO_2_3_CNTRL (0x31) | 97 | #define PM800_GPIO_2_3_CNTRL (0x31) |
98 | #define PM800_GPIO2_VAL (1 << 0) | 98 | #define PM800_GPIO2_VAL BIT(0) |
99 | #define PM800_GPIO2_GPIO_MODE(x) (x << 1) | 99 | #define PM800_GPIO2_GPIO_MODE(x) (x << 1) |
100 | #define PM800_GPIO3_VAL (1 << 4) | 100 | #define PM800_GPIO3_VAL BIT(4) |
101 | #define PM800_GPIO3_GPIO_MODE(x) (x << 5) | 101 | #define PM800_GPIO3_GPIO_MODE(x) (x << 5) |
102 | #define PM800_GPIO3_MODE_MASK 0x1F | 102 | #define PM800_GPIO3_MODE_MASK 0x1F |
103 | #define PM800_GPIO3_HEADSET_MODE PM800_GPIO3_GPIO_MODE(6) | 103 | #define PM800_GPIO3_HEADSET_MODE PM800_GPIO3_GPIO_MODE(6) |
104 | 104 | ||
105 | #define PM800_GPIO_4_CNTRL (0x32) | 105 | #define PM800_GPIO_4_CNTRL (0x32) |
106 | #define PM800_GPIO4_VAL (1 << 0) | 106 | #define PM800_GPIO4_VAL BIT(0) |
107 | #define PM800_GPIO4_GPIO_MODE(x) (x << 1) | 107 | #define PM800_GPIO4_GPIO_MODE(x) (x << 1) |
108 | 108 | ||
109 | #define PM800_HEADSET_CNTRL (0x38) | 109 | #define PM800_HEADSET_CNTRL (0x38) |
110 | #define PM800_HEADSET_DET_EN (1 << 7) | 110 | #define PM800_HEADSET_DET_EN BIT(7) |
111 | #define PM800_HSDET_SLP (1 << 1) | 111 | #define PM800_HSDET_SLP BIT(1) |
112 | /* PWM register */ | 112 | /* PWM register */ |
113 | #define PM800_PWM1 (0x40) | 113 | #define PM800_PWM1 (0x40) |
114 | #define PM800_PWM2 (0x41) | 114 | #define PM800_PWM2 (0x41) |
115 | #define PM800_PWM3 (0x42) | 115 | #define PM800_PWM3 (0x42) |
116 | #define PM800_PWM4 (0x43) | 116 | #define PM800_PWM4 (0x43) |
117 | 117 | ||
118 | /* RTC Registers */ | 118 | /* RTC Registers */ |
119 | #define PM800_RTC_CONTROL (0xD0) | 119 | #define PM800_RTC_CONTROL (0xD0) |
@@ -123,55 +123,55 @@ enum { | |||
123 | #define PM800_RTC_MISC4 (0xE4) | 123 | #define PM800_RTC_MISC4 (0xE4) |
124 | #define PM800_RTC_MISC5 (0xE7) | 124 | #define PM800_RTC_MISC5 (0xE7) |
125 | /* bit definitions of RTC Register 1 (0xD0) */ | 125 | /* bit definitions of RTC Register 1 (0xD0) */ |
126 | #define PM800_ALARM1_EN (1 << 0) | 126 | #define PM800_ALARM1_EN BIT(0) |
127 | #define PM800_ALARM_WAKEUP (1 << 4) | 127 | #define PM800_ALARM_WAKEUP BIT(4) |
128 | #define PM800_ALARM (1 << 5) | 128 | #define PM800_ALARM BIT(5) |
129 | #define PM800_RTC1_USE_XO (1 << 7) | 129 | #define PM800_RTC1_USE_XO BIT(7) |
130 | 130 | ||
131 | /* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */ | 131 | /* Regulator Control Registers: BUCK1,BUCK5,LDO1 have DVC */ |
132 | 132 | ||
133 | /* buck registers */ | 133 | /* buck registers */ |
134 | #define PM800_SLEEP_BUCK1 (0x30) | 134 | #define PM800_SLEEP_BUCK1 (0x30) |
135 | 135 | ||
136 | /* BUCK Sleep Mode Register 1: BUCK[1..4] */ | 136 | /* BUCK Sleep Mode Register 1: BUCK[1..4] */ |
137 | #define PM800_BUCK_SLP1 (0x5A) | 137 | #define PM800_BUCK_SLP1 (0x5A) |
138 | #define PM800_BUCK1_SLP1_SHIFT 0 | 138 | #define PM800_BUCK1_SLP1_SHIFT 0 |
139 | #define PM800_BUCK1_SLP1_MASK (0x3 << PM800_BUCK1_SLP1_SHIFT) | 139 | #define PM800_BUCK1_SLP1_MASK (0x3 << PM800_BUCK1_SLP1_SHIFT) |
140 | 140 | ||
141 | /* page 2 GPADC: slave adder 0x02 */ | 141 | /* page 2 GPADC: slave adder 0x02 */ |
142 | #define PM800_GPADC_MEAS_EN1 (0x01) | 142 | #define PM800_GPADC_MEAS_EN1 (0x01) |
143 | #define PM800_MEAS_EN1_VBAT (1 << 2) | 143 | #define PM800_MEAS_EN1_VBAT BIT(2) |
144 | #define PM800_GPADC_MEAS_EN2 (0x02) | 144 | #define PM800_GPADC_MEAS_EN2 (0x02) |
145 | #define PM800_MEAS_EN2_RFTMP (1 << 0) | 145 | #define PM800_MEAS_EN2_RFTMP BIT(0) |
146 | #define PM800_MEAS_GP0_EN (1 << 2) | 146 | #define PM800_MEAS_GP0_EN BIT(2) |
147 | #define PM800_MEAS_GP1_EN (1 << 3) | 147 | #define PM800_MEAS_GP1_EN BIT(3) |
148 | #define PM800_MEAS_GP2_EN (1 << 4) | 148 | #define PM800_MEAS_GP2_EN BIT(4) |
149 | #define PM800_MEAS_GP3_EN (1 << 5) | 149 | #define PM800_MEAS_GP3_EN BIT(5) |
150 | #define PM800_MEAS_GP4_EN (1 << 6) | 150 | #define PM800_MEAS_GP4_EN BIT(6) |
151 | 151 | ||
152 | #define PM800_GPADC_MISC_CONFIG1 (0x05) | 152 | #define PM800_GPADC_MISC_CONFIG1 (0x05) |
153 | #define PM800_GPADC_MISC_CONFIG2 (0x06) | 153 | #define PM800_GPADC_MISC_CONFIG2 (0x06) |
154 | #define PM800_GPADC_MISC_GPFSM_EN (1 << 0) | 154 | #define PM800_GPADC_MISC_GPFSM_EN BIT(0) |
155 | #define PM800_GPADC_SLOW_MODE(x) (x << 3) | 155 | #define PM800_GPADC_SLOW_MODE(x) (x << 3) |
156 | 156 | ||
157 | #define PM800_GPADC_MISC_CONFIG3 (0x09) | 157 | #define PM800_GPADC_MISC_CONFIG3 (0x09) |
158 | #define PM800_GPADC_MISC_CONFIG4 (0x0A) | 158 | #define PM800_GPADC_MISC_CONFIG4 (0x0A) |
159 | 159 | ||
160 | #define PM800_GPADC_PREBIAS1 (0x0F) | 160 | #define PM800_GPADC_PREBIAS1 (0x0F) |
161 | #define PM800_GPADC0_GP_PREBIAS_TIME(x) (x << 0) | 161 | #define PM800_GPADC0_GP_PREBIAS_TIME(x) (x << 0) |
162 | #define PM800_GPADC_PREBIAS2 (0x10) | 162 | #define PM800_GPADC_PREBIAS2 (0x10) |
163 | 163 | ||
164 | #define PM800_GP_BIAS_ENA1 (0x14) | 164 | #define PM800_GP_BIAS_ENA1 (0x14) |
165 | #define PM800_GPADC_GP_BIAS_EN0 (1 << 0) | 165 | #define PM800_GPADC_GP_BIAS_EN0 BIT(0) |
166 | #define PM800_GPADC_GP_BIAS_EN1 (1 << 1) | 166 | #define PM800_GPADC_GP_BIAS_EN1 BIT(1) |
167 | #define PM800_GPADC_GP_BIAS_EN2 (1 << 2) | 167 | #define PM800_GPADC_GP_BIAS_EN2 BIT(2) |
168 | #define PM800_GPADC_GP_BIAS_EN3 (1 << 3) | 168 | #define PM800_GPADC_GP_BIAS_EN3 BIT(3) |
169 | 169 | ||
170 | #define PM800_GP_BIAS_OUT1 (0x15) | 170 | #define PM800_GP_BIAS_OUT1 (0x15) |
171 | #define PM800_BIAS_OUT_GP0 (1 << 0) | 171 | #define PM800_BIAS_OUT_GP0 BIT(0) |
172 | #define PM800_BIAS_OUT_GP1 (1 << 1) | 172 | #define PM800_BIAS_OUT_GP1 BIT(1) |
173 | #define PM800_BIAS_OUT_GP2 (1 << 2) | 173 | #define PM800_BIAS_OUT_GP2 BIT(2) |
174 | #define PM800_BIAS_OUT_GP3 (1 << 3) | 174 | #define PM800_BIAS_OUT_GP3 BIT(3) |
175 | 175 | ||
176 | #define PM800_GPADC0_LOW_TH 0x20 | 176 | #define PM800_GPADC0_LOW_TH 0x20 |
177 | #define PM800_GPADC1_LOW_TH 0x21 | 177 | #define PM800_GPADC1_LOW_TH 0x21 |
@@ -222,37 +222,37 @@ enum { | |||
222 | 222 | ||
223 | #define PM805_INT_STATUS1 (0x03) | 223 | #define PM805_INT_STATUS1 (0x03) |
224 | 224 | ||
225 | #define PM805_INT1_HP1_SHRT (1 << 0) | 225 | #define PM805_INT1_HP1_SHRT BIT(0) |
226 | #define PM805_INT1_HP2_SHRT (1 << 1) | 226 | #define PM805_INT1_HP2_SHRT BIT(1) |
227 | #define PM805_INT1_MIC_CONFLICT (1 << 2) | 227 | #define PM805_INT1_MIC_CONFLICT BIT(2) |
228 | #define PM805_INT1_CLIP_FAULT (1 << 3) | 228 | #define PM805_INT1_CLIP_FAULT BIT(3) |
229 | #define PM805_INT1_LDO_OFF (1 << 4) | 229 | #define PM805_INT1_LDO_OFF BIT(4) |
230 | #define PM805_INT1_SRC_DPLL_LOCK (1 << 5) | 230 | #define PM805_INT1_SRC_DPLL_LOCK BIT(5) |
231 | 231 | ||
232 | #define PM805_INT_STATUS2 (0x04) | 232 | #define PM805_INT_STATUS2 (0x04) |
233 | 233 | ||
234 | #define PM805_INT2_MIC_DET (1 << 0) | 234 | #define PM805_INT2_MIC_DET BIT(0) |
235 | #define PM805_INT2_SHRT_BTN_DET (1 << 1) | 235 | #define PM805_INT2_SHRT_BTN_DET BIT(1) |
236 | #define PM805_INT2_VOLM_BTN_DET (1 << 2) | 236 | #define PM805_INT2_VOLM_BTN_DET BIT(2) |
237 | #define PM805_INT2_VOLP_BTN_DET (1 << 3) | 237 | #define PM805_INT2_VOLP_BTN_DET BIT(3) |
238 | #define PM805_INT2_RAW_PLL_FAULT (1 << 4) | 238 | #define PM805_INT2_RAW_PLL_FAULT BIT(4) |
239 | #define PM805_INT2_FINE_PLL_FAULT (1 << 5) | 239 | #define PM805_INT2_FINE_PLL_FAULT BIT(5) |
240 | 240 | ||
241 | #define PM805_INT_MASK1 (0x05) | 241 | #define PM805_INT_MASK1 (0x05) |
242 | #define PM805_INT_MASK2 (0x06) | 242 | #define PM805_INT_MASK2 (0x06) |
243 | #define PM805_SHRT_BTN_DET (1 << 1) | 243 | #define PM805_SHRT_BTN_DET BIT(1) |
244 | 244 | ||
245 | /* number of status and int reg in a row */ | 245 | /* number of status and int reg in a row */ |
246 | #define PM805_INT_REG_NUM (2) | 246 | #define PM805_INT_REG_NUM (2) |
247 | 247 | ||
248 | #define PM805_MIC_DET1 (0x07) | 248 | #define PM805_MIC_DET1 (0x07) |
249 | #define PM805_MIC_DET_EN_MIC_DET (1 << 0) | 249 | #define PM805_MIC_DET_EN_MIC_DET BIT(0) |
250 | #define PM805_MIC_DET2 (0x08) | 250 | #define PM805_MIC_DET2 (0x08) |
251 | #define PM805_MIC_DET_STATUS1 (0x09) | 251 | #define PM805_MIC_DET_STATUS1 (0x09) |
252 | 252 | ||
253 | #define PM805_MIC_DET_STATUS3 (0x0A) | 253 | #define PM805_MIC_DET_STATUS3 (0x0A) |
254 | #define PM805_AUTO_SEQ_STATUS1 (0x0B) | 254 | #define PM805_AUTO_SEQ_STATUS1 (0x0B) |
255 | #define PM805_AUTO_SEQ_STATUS2 (0x0C) | 255 | #define PM805_AUTO_SEQ_STATUS2 (0x0C) |
256 | 256 | ||
257 | #define PM805_ADC_SETTING1 (0x10) | 257 | #define PM805_ADC_SETTING1 (0x10) |
258 | #define PM805_ADC_SETTING2 (0x11) | 258 | #define PM805_ADC_SETTING2 (0x11) |
@@ -261,7 +261,7 @@ enum { | |||
261 | #define PM805_ADC_GAIN2 (0x13) | 261 | #define PM805_ADC_GAIN2 (0x13) |
262 | #define PM805_DMIC_SETTING (0x15) | 262 | #define PM805_DMIC_SETTING (0x15) |
263 | #define PM805_DWS_SETTING (0x16) | 263 | #define PM805_DWS_SETTING (0x16) |
264 | #define PM805_MIC_CONFLICT_STS (0x17) | 264 | #define PM805_MIC_CONFLICT_STS (0x17) |
265 | 265 | ||
266 | #define PM805_PDM_SETTING1 (0x20) | 266 | #define PM805_PDM_SETTING1 (0x20) |
267 | #define PM805_PDM_SETTING2 (0x21) | 267 | #define PM805_PDM_SETTING2 (0x21) |
@@ -270,11 +270,11 @@ enum { | |||
270 | #define PM805_PDM_CONTROL2 (0x24) | 270 | #define PM805_PDM_CONTROL2 (0x24) |
271 | #define PM805_PDM_CONTROL3 (0x25) | 271 | #define PM805_PDM_CONTROL3 (0x25) |
272 | 272 | ||
273 | #define PM805_HEADPHONE_SETTING (0x26) | 273 | #define PM805_HEADPHONE_SETTING (0x26) |
274 | #define PM805_HEADPHONE_GAIN_A2A (0x27) | 274 | #define PM805_HEADPHONE_GAIN_A2A (0x27) |
275 | #define PM805_HEADPHONE_SHORT_STATE (0x28) | 275 | #define PM805_HEADPHONE_SHORT_STATE (0x28) |
276 | #define PM805_EARPHONE_SETTING (0x29) | 276 | #define PM805_EARPHONE_SETTING (0x29) |
277 | #define PM805_AUTO_SEQ_SETTING (0x2A) | 277 | #define PM805_AUTO_SEQ_SETTING (0x2A) |
278 | 278 | ||
279 | struct pm80x_rtc_pdata { | 279 | struct pm80x_rtc_pdata { |
280 | int vrtc; | 280 | int vrtc; |