blob: 3420e09e2e209e038034f10e7cce5fde2a84aaad [file] [log] [blame]
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001/*
2 * TI Palmas
3 *
Ian Lartey654003e2013-03-22 14:55:12 +00004 * Copyright 2011-2013 Texas Instruments Inc.
Graeme Gregory2945fbc2012-05-15 15:48:56 +09005 *
6 * Author: Graeme Gregory <gg@slimlogic.co.uk>
Ian Lartey654003e2013-03-22 14:55:12 +00007 * Author: Ian Lartey <ian@slimlogic.co.uk>
Graeme Gregory2945fbc2012-05-15 15:48:56 +09008 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef __LINUX_MFD_PALMAS_H
17#define __LINUX_MFD_PALMAS_H
18
19#include <linux/usb/otg.h>
20#include <linux/leds.h>
21#include <linux/regmap.h>
22#include <linux/regulator/driver.h>
Graeme Gregoryb1f254e2013-05-28 10:50:11 +090023#include <linux/extcon.h>
24#include <linux/usb/phy_companion.h>
Graeme Gregory2945fbc2012-05-15 15:48:56 +090025
26#define PALMAS_NUM_CLIENTS 3
27
Ian Lartey654003e2013-03-22 14:55:12 +000028/* The ID_REVISION NUMBERS */
29#define PALMAS_CHIP_OLD_ID 0x0000
30#define PALMAS_CHIP_ID 0xC035
31#define PALMAS_CHIP_CHARGER_ID 0xC036
32
33#define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \
34 ((a) == PALMAS_CHIP_ID))
35#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
36
J Keerthy1ffb0be2013-06-19 11:27:48 +053037/**
38 * Palmas PMIC feature types
39 *
40 * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10_BOOST
41 * regulator.
42 *
43 * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a
44 * specific feature (above) or not. Return non-zero, if yes.
45 */
46#define PALMAS_PMIC_FEATURE_SMPS10_BOOST BIT(0)
47#define PALMAS_PMIC_HAS(b, f) \
48 ((b)->features & PALMAS_PMIC_FEATURE_ ## f)
49
Graeme Gregory2945fbc2012-05-15 15:48:56 +090050struct palmas_pmic;
Graeme Gregory190ef1a2012-08-28 13:47:37 +020051struct palmas_gpadc;
52struct palmas_resource;
53struct palmas_usb;
Graeme Gregory2945fbc2012-05-15 15:48:56 +090054
Graeme Gregoryb1f254e2013-05-28 10:50:11 +090055enum palmas_usb_state {
56 PALMAS_USB_STATE_DISCONNECT,
57 PALMAS_USB_STATE_VBUS,
58 PALMAS_USB_STATE_ID,
59};
60
Graeme Gregory2945fbc2012-05-15 15:48:56 +090061struct palmas {
62 struct device *dev;
63
64 struct i2c_client *i2c_clients[PALMAS_NUM_CLIENTS];
65 struct regmap *regmap[PALMAS_NUM_CLIENTS];
66
67 /* Stored chip id */
68 int id;
69
J Keerthy1ffb0be2013-06-19 11:27:48 +053070 unsigned int features;
Graeme Gregory2945fbc2012-05-15 15:48:56 +090071 /* IRQ Data */
72 int irq;
73 u32 irq_mask;
74 struct mutex irq_lock;
75 struct regmap_irq_chip_data *irq_data;
76
77 /* Child Devices */
78 struct palmas_pmic *pmic;
Graeme Gregory190ef1a2012-08-28 13:47:37 +020079 struct palmas_gpadc *gpadc;
80 struct palmas_resource *resource;
81 struct palmas_usb *usb;
Graeme Gregory2945fbc2012-05-15 15:48:56 +090082
83 /* GPIO MUXing */
84 u8 gpio_muxed;
85 u8 led_muxed;
86 u8 pwm_muxed;
87};
88
Graeme Gregory190ef1a2012-08-28 13:47:37 +020089struct palmas_gpadc_platform_data {
90 /* Channel 3 current source is only enabled during conversion */
91 int ch3_current;
92
93 /* Channel 0 current source can be used for battery detection.
94 * If used for battery detection this will cause a permanent current
95 * consumption depending on current level set here.
96 */
97 int ch0_current;
98
99 /* default BAT_REMOVAL_DAT setting on device probe */
100 int bat_removal;
101
102 /* Sets the START_POLARITY bit in the RT_CTRL register */
103 int start_polarity;
104};
105
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900106struct palmas_reg_init {
107 /* warm_rest controls the voltage levels after a warm reset
108 *
109 * 0: reload default values from OTP on warm reset
110 * 1: maintain voltage from VSEL on warm reset
111 */
112 int warm_reset;
113
114 /* roof_floor controls whether the regulator uses the i2c style
115 * of DVS or uses the method where a GPIO or other control method is
116 * attached to the NSLEEP/ENABLE1/ENABLE2 pins
117 *
118 * For SMPS
119 *
120 * 0: i2c selection of voltage
121 * 1: pin selection of voltage.
122 *
123 * For LDO unused
124 */
125 int roof_floor;
126
127 /* sleep_mode is the mode loaded to MODE_SLEEP bits as defined in
128 * the data sheet.
129 *
130 * For SMPS
131 *
132 * 0: Off
133 * 1: AUTO
134 * 2: ECO
135 * 3: Forced PWM
136 *
137 * For LDO
138 *
139 * 0: Off
140 * 1: On
141 */
142 int mode_sleep;
143
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900144 /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE
145 * register. Set this is the default voltage set in OTP needs
146 * to be overridden.
147 */
148 u8 vsel;
149
150};
151
Graeme Gregory7cc4c922012-08-28 13:47:39 +0200152enum palmas_regulators {
153 /* SMPS regulators */
154 PALMAS_REG_SMPS12,
155 PALMAS_REG_SMPS123,
156 PALMAS_REG_SMPS3,
157 PALMAS_REG_SMPS45,
158 PALMAS_REG_SMPS457,
159 PALMAS_REG_SMPS6,
160 PALMAS_REG_SMPS7,
161 PALMAS_REG_SMPS8,
162 PALMAS_REG_SMPS9,
Kishon Vijay Abraham I77409d92013-08-12 14:21:14 +0530163 PALMAS_REG_SMPS10_OUT2,
164 PALMAS_REG_SMPS10_OUT1,
Graeme Gregory7cc4c922012-08-28 13:47:39 +0200165 /* LDO regulators */
166 PALMAS_REG_LDO1,
167 PALMAS_REG_LDO2,
168 PALMAS_REG_LDO3,
169 PALMAS_REG_LDO4,
170 PALMAS_REG_LDO5,
171 PALMAS_REG_LDO6,
172 PALMAS_REG_LDO7,
173 PALMAS_REG_LDO8,
174 PALMAS_REG_LDO9,
175 PALMAS_REG_LDOLN,
176 PALMAS_REG_LDOUSB,
Laxman Dewanganaa07f022013-04-17 15:13:12 +0530177 /* External regulators */
178 PALMAS_REG_REGEN1,
179 PALMAS_REG_REGEN2,
180 PALMAS_REG_REGEN3,
181 PALMAS_REG_SYSEN1,
182 PALMAS_REG_SYSEN2,
Graeme Gregory7cc4c922012-08-28 13:47:39 +0200183 /* Total number of regulators */
184 PALMAS_NUM_REGS,
185};
186
Laxman Dewangancc01b462013-08-13 13:23:11 +0530187/* External controll signal name */
188enum {
189 PALMAS_EXT_CONTROL_ENABLE1 = 0x1,
190 PALMAS_EXT_CONTROL_ENABLE2 = 0x2,
191 PALMAS_EXT_CONTROL_NSLEEP = 0x4,
192};
193
194/*
195 * Palmas device resources can be controlled externally for
196 * enabling/disabling it rather than register write through i2c.
197 * Add the external controlled requestor ID for different resources.
198 */
199enum palmas_external_requestor_id {
200 PALMAS_EXTERNAL_REQSTR_ID_REGEN1,
201 PALMAS_EXTERNAL_REQSTR_ID_REGEN2,
202 PALMAS_EXTERNAL_REQSTR_ID_SYSEN1,
203 PALMAS_EXTERNAL_REQSTR_ID_SYSEN2,
204 PALMAS_EXTERNAL_REQSTR_ID_CLK32KG,
205 PALMAS_EXTERNAL_REQSTR_ID_CLK32KGAUDIO,
206 PALMAS_EXTERNAL_REQSTR_ID_REGEN3,
207 PALMAS_EXTERNAL_REQSTR_ID_SMPS12,
208 PALMAS_EXTERNAL_REQSTR_ID_SMPS3,
209 PALMAS_EXTERNAL_REQSTR_ID_SMPS45,
210 PALMAS_EXTERNAL_REQSTR_ID_SMPS6,
211 PALMAS_EXTERNAL_REQSTR_ID_SMPS7,
212 PALMAS_EXTERNAL_REQSTR_ID_SMPS8,
213 PALMAS_EXTERNAL_REQSTR_ID_SMPS9,
214 PALMAS_EXTERNAL_REQSTR_ID_SMPS10,
215 PALMAS_EXTERNAL_REQSTR_ID_LDO1,
216 PALMAS_EXTERNAL_REQSTR_ID_LDO2,
217 PALMAS_EXTERNAL_REQSTR_ID_LDO3,
218 PALMAS_EXTERNAL_REQSTR_ID_LDO4,
219 PALMAS_EXTERNAL_REQSTR_ID_LDO5,
220 PALMAS_EXTERNAL_REQSTR_ID_LDO6,
221 PALMAS_EXTERNAL_REQSTR_ID_LDO7,
222 PALMAS_EXTERNAL_REQSTR_ID_LDO8,
223 PALMAS_EXTERNAL_REQSTR_ID_LDO9,
224 PALMAS_EXTERNAL_REQSTR_ID_LDOLN,
225 PALMAS_EXTERNAL_REQSTR_ID_LDOUSB,
226
227 /* Last entry */
228 PALMAS_EXTERNAL_REQSTR_ID_MAX,
229};
230
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900231struct palmas_pmic_platform_data {
232 /* An array of pointers to regulator init data indexed by regulator
233 * ID
234 */
Graeme Gregory7cc4c922012-08-28 13:47:39 +0200235 struct regulator_init_data *reg_data[PALMAS_NUM_REGS];
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900236
237 /* An array of pointers to structures containing sleep mode and DVS
238 * configuration for regulators indexed by ID
239 */
Graeme Gregory7cc4c922012-08-28 13:47:39 +0200240 struct palmas_reg_init *reg_init[PALMAS_NUM_REGS];
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900241
242 /* use LDO6 for vibrator control */
243 int ldo6_vibrator;
Laxman Dewangan17c11a72013-04-17 15:13:13 +0530244
245 /* Enable tracking mode of LDO8 */
246 bool enable_ldo8_tracking;
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200247};
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900248
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200249struct palmas_usb_platform_data {
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200250 /* Do we enable the wakeup comparator on probe */
251 int wakeup;
252};
253
254struct palmas_resource_platform_data {
255 int regen1_mode_sleep;
256 int regen2_mode_sleep;
257 int sysen1_mode_sleep;
258 int sysen2_mode_sleep;
259
260 /* bitfield to be loaded to NSLEEP_RES_ASSIGN */
261 u8 nsleep_res;
262 /* bitfield to be loaded to NSLEEP_SMPS_ASSIGN */
263 u8 nsleep_smps;
264 /* bitfield to be loaded to NSLEEP_LDO_ASSIGN1 */
265 u8 nsleep_ldo1;
266 /* bitfield to be loaded to NSLEEP_LDO_ASSIGN2 */
267 u8 nsleep_ldo2;
268
269 /* bitfield to be loaded to ENABLE1_RES_ASSIGN */
270 u8 enable1_res;
271 /* bitfield to be loaded to ENABLE1_SMPS_ASSIGN */
272 u8 enable1_smps;
273 /* bitfield to be loaded to ENABLE1_LDO_ASSIGN1 */
274 u8 enable1_ldo1;
275 /* bitfield to be loaded to ENABLE1_LDO_ASSIGN2 */
276 u8 enable1_ldo2;
277
278 /* bitfield to be loaded to ENABLE2_RES_ASSIGN */
279 u8 enable2_res;
280 /* bitfield to be loaded to ENABLE2_SMPS_ASSIGN */
281 u8 enable2_smps;
282 /* bitfield to be loaded to ENABLE2_LDO_ASSIGN1 */
283 u8 enable2_ldo1;
284 /* bitfield to be loaded to ENABLE2_LDO_ASSIGN2 */
285 u8 enable2_ldo2;
286};
287
288struct palmas_clk_platform_data {
289 int clk32kg_mode_sleep;
290 int clk32kgaudio_mode_sleep;
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900291};
292
293struct palmas_platform_data {
Laxman Dewangandf545d12013-03-01 20:13:46 +0530294 int irq_flags;
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900295 int gpio_base;
296
297 /* bit value to be loaded to the POWER_CTRL register */
298 u8 power_ctrl;
299
300 /*
301 * boolean to select if we want to configure muxing here
302 * then the two value to load into the registers if true
303 */
304 int mux_from_pdata;
305 u8 pad1, pad2;
Bill Huangb81eec02013-08-08 04:45:05 -0700306 bool pm_off;
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900307
308 struct palmas_pmic_platform_data *pmic_pdata;
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200309 struct palmas_gpadc_platform_data *gpadc_pdata;
310 struct palmas_usb_platform_data *usb_pdata;
311 struct palmas_resource_platform_data *resource_pdata;
312 struct palmas_clk_platform_data *clk_pdata;
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900313};
314
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200315struct palmas_gpadc_calibration {
316 s32 gain;
317 s32 gain_error;
318 s32 offset_error;
319};
320
321struct palmas_gpadc {
322 struct device *dev;
323 struct palmas *palmas;
324
325 int ch3_current;
326 int ch0_current;
327
328 int gpadc_force;
329
330 int bat_removal;
331
332 struct mutex reading_lock;
333 struct completion irq_complete;
334
335 int eoc_sw_irq;
336
337 struct palmas_gpadc_calibration *palmas_cal_tbl;
338
339 int conv0_channel;
340 int conv1_channel;
341 int rt_channel;
342};
343
344struct palmas_gpadc_result {
345 s32 raw_code;
346 s32 corrected_code;
347 s32 result;
348};
349
350#define PALMAS_MAX_CHANNELS 16
351
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900352/* Define the palmas IRQ numbers */
353enum palmas_irqs {
354 /* INT1 registers */
355 PALMAS_CHARG_DET_N_VBUS_OVV_IRQ,
356 PALMAS_PWRON_IRQ,
357 PALMAS_LONG_PRESS_KEY_IRQ,
358 PALMAS_RPWRON_IRQ,
359 PALMAS_PWRDOWN_IRQ,
360 PALMAS_HOTDIE_IRQ,
361 PALMAS_VSYS_MON_IRQ,
362 PALMAS_VBAT_MON_IRQ,
363 /* INT2 registers */
364 PALMAS_RTC_ALARM_IRQ,
365 PALMAS_RTC_TIMER_IRQ,
366 PALMAS_WDT_IRQ,
367 PALMAS_BATREMOVAL_IRQ,
368 PALMAS_RESET_IN_IRQ,
369 PALMAS_FBI_BB_IRQ,
370 PALMAS_SHORT_IRQ,
371 PALMAS_VAC_ACOK_IRQ,
372 /* INT3 registers */
373 PALMAS_GPADC_AUTO_0_IRQ,
374 PALMAS_GPADC_AUTO_1_IRQ,
375 PALMAS_GPADC_EOC_SW_IRQ,
376 PALMAS_GPADC_EOC_RT_IRQ,
377 PALMAS_ID_OTG_IRQ,
378 PALMAS_ID_IRQ,
379 PALMAS_VBUS_OTG_IRQ,
380 PALMAS_VBUS_IRQ,
381 /* INT4 registers */
382 PALMAS_GPIO_0_IRQ,
383 PALMAS_GPIO_1_IRQ,
384 PALMAS_GPIO_2_IRQ,
385 PALMAS_GPIO_3_IRQ,
386 PALMAS_GPIO_4_IRQ,
387 PALMAS_GPIO_5_IRQ,
388 PALMAS_GPIO_6_IRQ,
389 PALMAS_GPIO_7_IRQ,
390 /* Total Number IRQs */
391 PALMAS_NUM_IRQ,
392};
393
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900394struct palmas_pmic {
395 struct palmas *palmas;
396 struct device *dev;
397 struct regulator_desc desc[PALMAS_NUM_REGS];
398 struct regulator_dev *rdev[PALMAS_NUM_REGS];
399 struct mutex mutex;
400
401 int smps123;
402 int smps457;
403
Kishon Vijay Abraham I77409d92013-08-12 14:21:14 +0530404 int range[PALMAS_REG_SMPS10_OUT1];
405 unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
406 unsigned int current_reg_mode[PALMAS_REG_SMPS10_OUT1];
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900407};
408
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200409struct palmas_resource {
410 struct palmas *palmas;
411 struct device *dev;
412};
413
414struct palmas_usb {
415 struct palmas *palmas;
416 struct device *dev;
417
Chanwoo Choi3f79a3f2014-04-21 20:44:53 +0900418 struct extcon_dev *edev;
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200419
Graeme Gregoryb1f254e2013-05-28 10:50:11 +0900420 int id_otg_irq;
421 int id_irq;
422 int vbus_otg_irq;
423 int vbus_irq;
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200424
Graeme Gregoryb1f254e2013-05-28 10:50:11 +0900425 enum palmas_usb_state linkstat;
Laxman Dewangan7281e052013-07-10 14:59:06 +0530426 int wakeup;
427 bool enable_vbus_detection;
428 bool enable_id_detection;
Graeme Gregory190ef1a2012-08-28 13:47:37 +0200429};
430
431#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)
432
433enum usb_irq_events {
434 /* Wakeup events from INT3 */
435 PALMAS_USB_ID_WAKEPUP,
436 PALMAS_USB_VBUS_WAKEUP,
437
438 /* ID_OTG_EVENTS */
439 PALMAS_USB_ID_GND,
440 N_PALMAS_USB_ID_GND,
441 PALMAS_USB_ID_C,
442 N_PALMAS_USB_ID_C,
443 PALMAS_USB_ID_B,
444 N_PALMAS_USB_ID_B,
445 PALMAS_USB_ID_A,
446 N_PALMAS_USB_ID_A,
447 PALMAS_USB_ID_FLOAT,
448 N_PALMAS_USB_ID_FLOAT,
449
450 /* VBUS_OTG_EVENTS */
451 PALMAS_USB_VB_SESS_END,
452 N_PALMAS_USB_VB_SESS_END,
453 PALMAS_USB_VB_SESS_VLD,
454 N_PALMAS_USB_VB_SESS_VLD,
455 PALMAS_USB_VA_SESS_VLD,
456 N_PALMAS_USB_VA_SESS_VLD,
457 PALMAS_USB_VA_VBUS_VLD,
458 N_PALMAS_USB_VA_VBUS_VLD,
459 PALMAS_USB_VADP_SNS,
460 N_PALMAS_USB_VADP_SNS,
461 PALMAS_USB_VADP_PRB,
462 N_PALMAS_USB_VADP_PRB,
463 PALMAS_USB_VOTG_SESS_VLD,
464 N_PALMAS_USB_VOTG_SESS_VLD,
465};
466
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900467/* defines so we can store the mux settings */
468#define PALMAS_GPIO_0_MUXED (1 << 0)
469#define PALMAS_GPIO_1_MUXED (1 << 1)
470#define PALMAS_GPIO_2_MUXED (1 << 2)
471#define PALMAS_GPIO_3_MUXED (1 << 3)
472#define PALMAS_GPIO_4_MUXED (1 << 4)
473#define PALMAS_GPIO_5_MUXED (1 << 5)
474#define PALMAS_GPIO_6_MUXED (1 << 6)
475#define PALMAS_GPIO_7_MUXED (1 << 7)
476
477#define PALMAS_LED1_MUXED (1 << 0)
478#define PALMAS_LED2_MUXED (1 << 1)
479
480#define PALMAS_PWM1_MUXED (1 << 0)
481#define PALMAS_PWM2_MUXED (1 << 1)
482
483/* helper macro to get correct slave number */
484#define PALMAS_BASE_TO_SLAVE(x) ((x >> 8) - 1)
Keerthy45ac60c2014-05-22 14:48:30 +0530485#define PALMAS_BASE_TO_REG(x, y) ((x & 0xFF) + y)
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900486
487/* Base addresses of IP blocks in Palmas */
Keerthy45ac60c2014-05-22 14:48:30 +0530488#define PALMAS_SMPS_DVS_BASE 0x020
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900489#define PALMAS_RTC_BASE 0x100
490#define PALMAS_VALIDITY_BASE 0x118
491#define PALMAS_SMPS_BASE 0x120
492#define PALMAS_LDO_BASE 0x150
493#define PALMAS_DVFS_BASE 0x180
494#define PALMAS_PMU_CONTROL_BASE 0x1A0
495#define PALMAS_RESOURCE_BASE 0x1D4
Laxman Dewangan0a8d3e22013-08-06 18:42:35 +0530496#define PALMAS_PU_PD_OD_BASE 0x1F0
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900497#define PALMAS_LED_BASE 0x200
498#define PALMAS_INTERRUPT_BASE 0x210
499#define PALMAS_USB_OTG_BASE 0x250
500#define PALMAS_VIBRATOR_BASE 0x270
501#define PALMAS_GPIO_BASE 0x280
502#define PALMAS_USB_BASE 0x290
503#define PALMAS_GPADC_BASE 0x2C0
504#define PALMAS_TRIM_GPADC_BASE 0x3CD
505
506/* Registers for function RTC */
Keerthy45ac60c2014-05-22 14:48:30 +0530507#define PALMAS_SECONDS_REG 0x00
508#define PALMAS_MINUTES_REG 0x01
509#define PALMAS_HOURS_REG 0x02
510#define PALMAS_DAYS_REG 0x03
511#define PALMAS_MONTHS_REG 0x04
512#define PALMAS_YEARS_REG 0x05
513#define PALMAS_WEEKS_REG 0x06
514#define PALMAS_ALARM_SECONDS_REG 0x08
515#define PALMAS_ALARM_MINUTES_REG 0x09
516#define PALMAS_ALARM_HOURS_REG 0x0A
517#define PALMAS_ALARM_DAYS_REG 0x0B
518#define PALMAS_ALARM_MONTHS_REG 0x0C
519#define PALMAS_ALARM_YEARS_REG 0x0D
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900520#define PALMAS_RTC_CTRL_REG 0x10
521#define PALMAS_RTC_STATUS_REG 0x11
522#define PALMAS_RTC_INTERRUPTS_REG 0x12
523#define PALMAS_RTC_COMP_LSB_REG 0x13
524#define PALMAS_RTC_COMP_MSB_REG 0x14
525#define PALMAS_RTC_RES_PROG_REG 0x15
526#define PALMAS_RTC_RESET_STATUS_REG 0x16
527
528/* Bit definitions for SECONDS_REG */
529#define PALMAS_SECONDS_REG_SEC1_MASK 0x70
Keerthy45ac60c2014-05-22 14:48:30 +0530530#define PALMAS_SECONDS_REG_SEC1_SHIFT 0x04
531#define PALMAS_SECONDS_REG_SEC0_MASK 0x0F
532#define PALMAS_SECONDS_REG_SEC0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900533
534/* Bit definitions for MINUTES_REG */
535#define PALMAS_MINUTES_REG_MIN1_MASK 0x70
Keerthy45ac60c2014-05-22 14:48:30 +0530536#define PALMAS_MINUTES_REG_MIN1_SHIFT 0x04
537#define PALMAS_MINUTES_REG_MIN0_MASK 0x0F
538#define PALMAS_MINUTES_REG_MIN0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900539
540/* Bit definitions for HOURS_REG */
541#define PALMAS_HOURS_REG_PM_NAM 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530542#define PALMAS_HOURS_REG_PM_NAM_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900543#define PALMAS_HOURS_REG_HOUR1_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530544#define PALMAS_HOURS_REG_HOUR1_SHIFT 0x04
545#define PALMAS_HOURS_REG_HOUR0_MASK 0x0F
546#define PALMAS_HOURS_REG_HOUR0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900547
548/* Bit definitions for DAYS_REG */
549#define PALMAS_DAYS_REG_DAY1_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530550#define PALMAS_DAYS_REG_DAY1_SHIFT 0x04
551#define PALMAS_DAYS_REG_DAY0_MASK 0x0F
552#define PALMAS_DAYS_REG_DAY0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900553
554/* Bit definitions for MONTHS_REG */
555#define PALMAS_MONTHS_REG_MONTH1 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530556#define PALMAS_MONTHS_REG_MONTH1_SHIFT 0x04
557#define PALMAS_MONTHS_REG_MONTH0_MASK 0x0F
558#define PALMAS_MONTHS_REG_MONTH0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900559
560/* Bit definitions for YEARS_REG */
561#define PALMAS_YEARS_REG_YEAR1_MASK 0xf0
Keerthy45ac60c2014-05-22 14:48:30 +0530562#define PALMAS_YEARS_REG_YEAR1_SHIFT 0x04
563#define PALMAS_YEARS_REG_YEAR0_MASK 0x0F
564#define PALMAS_YEARS_REG_YEAR0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900565
566/* Bit definitions for WEEKS_REG */
567#define PALMAS_WEEKS_REG_WEEK_MASK 0x07
Keerthy45ac60c2014-05-22 14:48:30 +0530568#define PALMAS_WEEKS_REG_WEEK_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900569
570/* Bit definitions for ALARM_SECONDS_REG */
571#define PALMAS_ALARM_SECONDS_REG_ALARM_SEC1_MASK 0x70
Keerthy45ac60c2014-05-22 14:48:30 +0530572#define PALMAS_ALARM_SECONDS_REG_ALARM_SEC1_SHIFT 0x04
573#define PALMAS_ALARM_SECONDS_REG_ALARM_SEC0_MASK 0x0F
574#define PALMAS_ALARM_SECONDS_REG_ALARM_SEC0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900575
576/* Bit definitions for ALARM_MINUTES_REG */
577#define PALMAS_ALARM_MINUTES_REG_ALARM_MIN1_MASK 0x70
Keerthy45ac60c2014-05-22 14:48:30 +0530578#define PALMAS_ALARM_MINUTES_REG_ALARM_MIN1_SHIFT 0x04
579#define PALMAS_ALARM_MINUTES_REG_ALARM_MIN0_MASK 0x0F
580#define PALMAS_ALARM_MINUTES_REG_ALARM_MIN0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900581
582/* Bit definitions for ALARM_HOURS_REG */
583#define PALMAS_ALARM_HOURS_REG_ALARM_PM_NAM 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530584#define PALMAS_ALARM_HOURS_REG_ALARM_PM_NAM_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900585#define PALMAS_ALARM_HOURS_REG_ALARM_HOUR1_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530586#define PALMAS_ALARM_HOURS_REG_ALARM_HOUR1_SHIFT 0x04
587#define PALMAS_ALARM_HOURS_REG_ALARM_HOUR0_MASK 0x0F
588#define PALMAS_ALARM_HOURS_REG_ALARM_HOUR0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900589
590/* Bit definitions for ALARM_DAYS_REG */
591#define PALMAS_ALARM_DAYS_REG_ALARM_DAY1_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530592#define PALMAS_ALARM_DAYS_REG_ALARM_DAY1_SHIFT 0x04
593#define PALMAS_ALARM_DAYS_REG_ALARM_DAY0_MASK 0x0F
594#define PALMAS_ALARM_DAYS_REG_ALARM_DAY0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900595
596/* Bit definitions for ALARM_MONTHS_REG */
597#define PALMAS_ALARM_MONTHS_REG_ALARM_MONTH1 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530598#define PALMAS_ALARM_MONTHS_REG_ALARM_MONTH1_SHIFT 0x04
599#define PALMAS_ALARM_MONTHS_REG_ALARM_MONTH0_MASK 0x0F
600#define PALMAS_ALARM_MONTHS_REG_ALARM_MONTH0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900601
602/* Bit definitions for ALARM_YEARS_REG */
603#define PALMAS_ALARM_YEARS_REG_ALARM_YEAR1_MASK 0xf0
Keerthy45ac60c2014-05-22 14:48:30 +0530604#define PALMAS_ALARM_YEARS_REG_ALARM_YEAR1_SHIFT 0x04
605#define PALMAS_ALARM_YEARS_REG_ALARM_YEAR0_MASK 0x0F
606#define PALMAS_ALARM_YEARS_REG_ALARM_YEAR0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900607
608/* Bit definitions for RTC_CTRL_REG */
609#define PALMAS_RTC_CTRL_REG_RTC_V_OPT 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530610#define PALMAS_RTC_CTRL_REG_RTC_V_OPT_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900611#define PALMAS_RTC_CTRL_REG_GET_TIME 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530612#define PALMAS_RTC_CTRL_REG_GET_TIME_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900613#define PALMAS_RTC_CTRL_REG_SET_32_COUNTER 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530614#define PALMAS_RTC_CTRL_REG_SET_32_COUNTER_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900615#define PALMAS_RTC_CTRL_REG_TEST_MODE 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530616#define PALMAS_RTC_CTRL_REG_TEST_MODE_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900617#define PALMAS_RTC_CTRL_REG_MODE_12_24 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530618#define PALMAS_RTC_CTRL_REG_MODE_12_24_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900619#define PALMAS_RTC_CTRL_REG_AUTO_COMP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530620#define PALMAS_RTC_CTRL_REG_AUTO_COMP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900621#define PALMAS_RTC_CTRL_REG_ROUND_30S 0x02
Keerthy45ac60c2014-05-22 14:48:30 +0530622#define PALMAS_RTC_CTRL_REG_ROUND_30S_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900623#define PALMAS_RTC_CTRL_REG_STOP_RTC 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530624#define PALMAS_RTC_CTRL_REG_STOP_RTC_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900625
626/* Bit definitions for RTC_STATUS_REG */
627#define PALMAS_RTC_STATUS_REG_POWER_UP 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530628#define PALMAS_RTC_STATUS_REG_POWER_UP_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900629#define PALMAS_RTC_STATUS_REG_ALARM 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530630#define PALMAS_RTC_STATUS_REG_ALARM_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900631#define PALMAS_RTC_STATUS_REG_EVENT_1D 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530632#define PALMAS_RTC_STATUS_REG_EVENT_1D_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900633#define PALMAS_RTC_STATUS_REG_EVENT_1H 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530634#define PALMAS_RTC_STATUS_REG_EVENT_1H_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900635#define PALMAS_RTC_STATUS_REG_EVENT_1M 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530636#define PALMAS_RTC_STATUS_REG_EVENT_1M_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900637#define PALMAS_RTC_STATUS_REG_EVENT_1S 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530638#define PALMAS_RTC_STATUS_REG_EVENT_1S_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900639#define PALMAS_RTC_STATUS_REG_RUN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +0530640#define PALMAS_RTC_STATUS_REG_RUN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900641
642/* Bit definitions for RTC_INTERRUPTS_REG */
643#define PALMAS_RTC_INTERRUPTS_REG_IT_SLEEP_MASK_EN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530644#define PALMAS_RTC_INTERRUPTS_REG_IT_SLEEP_MASK_EN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900645#define PALMAS_RTC_INTERRUPTS_REG_IT_ALARM 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530646#define PALMAS_RTC_INTERRUPTS_REG_IT_ALARM_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900647#define PALMAS_RTC_INTERRUPTS_REG_IT_TIMER 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530648#define PALMAS_RTC_INTERRUPTS_REG_IT_TIMER_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900649#define PALMAS_RTC_INTERRUPTS_REG_EVERY_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530650#define PALMAS_RTC_INTERRUPTS_REG_EVERY_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900651
652/* Bit definitions for RTC_COMP_LSB_REG */
Keerthy45ac60c2014-05-22 14:48:30 +0530653#define PALMAS_RTC_COMP_LSB_REG_RTC_COMP_LSB_MASK 0xFF
654#define PALMAS_RTC_COMP_LSB_REG_RTC_COMP_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900655
656/* Bit definitions for RTC_COMP_MSB_REG */
Keerthy45ac60c2014-05-22 14:48:30 +0530657#define PALMAS_RTC_COMP_MSB_REG_RTC_COMP_MSB_MASK 0xFF
658#define PALMAS_RTC_COMP_MSB_REG_RTC_COMP_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900659
660/* Bit definitions for RTC_RES_PROG_REG */
Keerthy45ac60c2014-05-22 14:48:30 +0530661#define PALMAS_RTC_RES_PROG_REG_SW_RES_PROG_MASK 0x3F
662#define PALMAS_RTC_RES_PROG_REG_SW_RES_PROG_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900663
664/* Bit definitions for RTC_RESET_STATUS_REG */
665#define PALMAS_RTC_RESET_STATUS_REG_RESET_STATUS 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530666#define PALMAS_RTC_RESET_STATUS_REG_RESET_STATUS_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900667
668/* Registers for function BACKUP */
Keerthy45ac60c2014-05-22 14:48:30 +0530669#define PALMAS_BACKUP0 0x00
670#define PALMAS_BACKUP1 0x01
671#define PALMAS_BACKUP2 0x02
672#define PALMAS_BACKUP3 0x03
673#define PALMAS_BACKUP4 0x04
674#define PALMAS_BACKUP5 0x05
675#define PALMAS_BACKUP6 0x06
676#define PALMAS_BACKUP7 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900677
678/* Bit definitions for BACKUP0 */
Keerthy45ac60c2014-05-22 14:48:30 +0530679#define PALMAS_BACKUP0_BACKUP_MASK 0xFF
680#define PALMAS_BACKUP0_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900681
682/* Bit definitions for BACKUP1 */
Keerthy45ac60c2014-05-22 14:48:30 +0530683#define PALMAS_BACKUP1_BACKUP_MASK 0xFF
684#define PALMAS_BACKUP1_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900685
686/* Bit definitions for BACKUP2 */
Keerthy45ac60c2014-05-22 14:48:30 +0530687#define PALMAS_BACKUP2_BACKUP_MASK 0xFF
688#define PALMAS_BACKUP2_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900689
690/* Bit definitions for BACKUP3 */
Keerthy45ac60c2014-05-22 14:48:30 +0530691#define PALMAS_BACKUP3_BACKUP_MASK 0xFF
692#define PALMAS_BACKUP3_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900693
694/* Bit definitions for BACKUP4 */
Keerthy45ac60c2014-05-22 14:48:30 +0530695#define PALMAS_BACKUP4_BACKUP_MASK 0xFF
696#define PALMAS_BACKUP4_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900697
698/* Bit definitions for BACKUP5 */
Keerthy45ac60c2014-05-22 14:48:30 +0530699#define PALMAS_BACKUP5_BACKUP_MASK 0xFF
700#define PALMAS_BACKUP5_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900701
702/* Bit definitions for BACKUP6 */
Keerthy45ac60c2014-05-22 14:48:30 +0530703#define PALMAS_BACKUP6_BACKUP_MASK 0xFF
704#define PALMAS_BACKUP6_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900705
706/* Bit definitions for BACKUP7 */
Keerthy45ac60c2014-05-22 14:48:30 +0530707#define PALMAS_BACKUP7_BACKUP_MASK 0xFF
708#define PALMAS_BACKUP7_BACKUP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900709
710/* Registers for function SMPS */
Keerthy45ac60c2014-05-22 14:48:30 +0530711#define PALMAS_SMPS12_CTRL 0x00
712#define PALMAS_SMPS12_TSTEP 0x01
713#define PALMAS_SMPS12_FORCE 0x02
714#define PALMAS_SMPS12_VOLTAGE 0x03
715#define PALMAS_SMPS3_CTRL 0x04
716#define PALMAS_SMPS3_VOLTAGE 0x07
717#define PALMAS_SMPS45_CTRL 0x08
718#define PALMAS_SMPS45_TSTEP 0x09
719#define PALMAS_SMPS45_FORCE 0x0A
720#define PALMAS_SMPS45_VOLTAGE 0x0B
721#define PALMAS_SMPS6_CTRL 0x0C
722#define PALMAS_SMPS6_TSTEP 0x0D
723#define PALMAS_SMPS6_FORCE 0x0E
724#define PALMAS_SMPS6_VOLTAGE 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900725#define PALMAS_SMPS7_CTRL 0x10
726#define PALMAS_SMPS7_VOLTAGE 0x13
727#define PALMAS_SMPS8_CTRL 0x14
728#define PALMAS_SMPS8_TSTEP 0x15
729#define PALMAS_SMPS8_FORCE 0x16
730#define PALMAS_SMPS8_VOLTAGE 0x17
731#define PALMAS_SMPS9_CTRL 0x18
732#define PALMAS_SMPS9_VOLTAGE 0x1B
733#define PALMAS_SMPS10_CTRL 0x1C
734#define PALMAS_SMPS10_STATUS 0x1F
735#define PALMAS_SMPS_CTRL 0x24
736#define PALMAS_SMPS_PD_CTRL 0x25
737#define PALMAS_SMPS_DITHER_EN 0x26
738#define PALMAS_SMPS_THERMAL_EN 0x27
739#define PALMAS_SMPS_THERMAL_STATUS 0x28
740#define PALMAS_SMPS_SHORT_STATUS 0x29
741#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN 0x2A
742#define PALMAS_SMPS_POWERGOOD_MASK1 0x2B
743#define PALMAS_SMPS_POWERGOOD_MASK2 0x2C
744
745/* Bit definitions for SMPS12_CTRL */
746#define PALMAS_SMPS12_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530747#define PALMAS_SMPS12_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900748#define PALMAS_SMPS12_CTRL_ROOF_FLOOR_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530749#define PALMAS_SMPS12_CTRL_ROOF_FLOOR_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900750#define PALMAS_SMPS12_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530751#define PALMAS_SMPS12_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900752#define PALMAS_SMPS12_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530753#define PALMAS_SMPS12_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900754#define PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530755#define PALMAS_SMPS12_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900756
757/* Bit definitions for SMPS12_TSTEP */
758#define PALMAS_SMPS12_TSTEP_TSTEP_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530759#define PALMAS_SMPS12_TSTEP_TSTEP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900760
761/* Bit definitions for SMPS12_FORCE */
762#define PALMAS_SMPS12_FORCE_CMD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530763#define PALMAS_SMPS12_FORCE_CMD_SHIFT 0x07
764#define PALMAS_SMPS12_FORCE_VSEL_MASK 0x7F
765#define PALMAS_SMPS12_FORCE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900766
767/* Bit definitions for SMPS12_VOLTAGE */
768#define PALMAS_SMPS12_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530769#define PALMAS_SMPS12_VOLTAGE_RANGE_SHIFT 0x07
770#define PALMAS_SMPS12_VOLTAGE_VSEL_MASK 0x7F
771#define PALMAS_SMPS12_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900772
773/* Bit definitions for SMPS3_CTRL */
774#define PALMAS_SMPS3_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530775#define PALMAS_SMPS3_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900776#define PALMAS_SMPS3_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530777#define PALMAS_SMPS3_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900778#define PALMAS_SMPS3_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530779#define PALMAS_SMPS3_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900780#define PALMAS_SMPS3_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530781#define PALMAS_SMPS3_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900782
783/* Bit definitions for SMPS3_VOLTAGE */
784#define PALMAS_SMPS3_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530785#define PALMAS_SMPS3_VOLTAGE_RANGE_SHIFT 0x07
786#define PALMAS_SMPS3_VOLTAGE_VSEL_MASK 0x7F
787#define PALMAS_SMPS3_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900788
789/* Bit definitions for SMPS45_CTRL */
790#define PALMAS_SMPS45_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530791#define PALMAS_SMPS45_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900792#define PALMAS_SMPS45_CTRL_ROOF_FLOOR_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530793#define PALMAS_SMPS45_CTRL_ROOF_FLOOR_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900794#define PALMAS_SMPS45_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530795#define PALMAS_SMPS45_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900796#define PALMAS_SMPS45_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530797#define PALMAS_SMPS45_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900798#define PALMAS_SMPS45_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530799#define PALMAS_SMPS45_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900800
801/* Bit definitions for SMPS45_TSTEP */
802#define PALMAS_SMPS45_TSTEP_TSTEP_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530803#define PALMAS_SMPS45_TSTEP_TSTEP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900804
805/* Bit definitions for SMPS45_FORCE */
806#define PALMAS_SMPS45_FORCE_CMD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530807#define PALMAS_SMPS45_FORCE_CMD_SHIFT 0x07
808#define PALMAS_SMPS45_FORCE_VSEL_MASK 0x7F
809#define PALMAS_SMPS45_FORCE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900810
811/* Bit definitions for SMPS45_VOLTAGE */
812#define PALMAS_SMPS45_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530813#define PALMAS_SMPS45_VOLTAGE_RANGE_SHIFT 0x07
814#define PALMAS_SMPS45_VOLTAGE_VSEL_MASK 0x7F
815#define PALMAS_SMPS45_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900816
817/* Bit definitions for SMPS6_CTRL */
818#define PALMAS_SMPS6_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530819#define PALMAS_SMPS6_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900820#define PALMAS_SMPS6_CTRL_ROOF_FLOOR_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530821#define PALMAS_SMPS6_CTRL_ROOF_FLOOR_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900822#define PALMAS_SMPS6_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530823#define PALMAS_SMPS6_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900824#define PALMAS_SMPS6_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530825#define PALMAS_SMPS6_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900826#define PALMAS_SMPS6_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530827#define PALMAS_SMPS6_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900828
829/* Bit definitions for SMPS6_TSTEP */
830#define PALMAS_SMPS6_TSTEP_TSTEP_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530831#define PALMAS_SMPS6_TSTEP_TSTEP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900832
833/* Bit definitions for SMPS6_FORCE */
834#define PALMAS_SMPS6_FORCE_CMD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530835#define PALMAS_SMPS6_FORCE_CMD_SHIFT 0x07
836#define PALMAS_SMPS6_FORCE_VSEL_MASK 0x7F
837#define PALMAS_SMPS6_FORCE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900838
839/* Bit definitions for SMPS6_VOLTAGE */
840#define PALMAS_SMPS6_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530841#define PALMAS_SMPS6_VOLTAGE_RANGE_SHIFT 0x07
842#define PALMAS_SMPS6_VOLTAGE_VSEL_MASK 0x7F
843#define PALMAS_SMPS6_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900844
845/* Bit definitions for SMPS7_CTRL */
846#define PALMAS_SMPS7_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530847#define PALMAS_SMPS7_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900848#define PALMAS_SMPS7_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530849#define PALMAS_SMPS7_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900850#define PALMAS_SMPS7_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530851#define PALMAS_SMPS7_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900852#define PALMAS_SMPS7_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530853#define PALMAS_SMPS7_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900854
855/* Bit definitions for SMPS7_VOLTAGE */
856#define PALMAS_SMPS7_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530857#define PALMAS_SMPS7_VOLTAGE_RANGE_SHIFT 0x07
858#define PALMAS_SMPS7_VOLTAGE_VSEL_MASK 0x7F
859#define PALMAS_SMPS7_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900860
861/* Bit definitions for SMPS8_CTRL */
862#define PALMAS_SMPS8_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530863#define PALMAS_SMPS8_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900864#define PALMAS_SMPS8_CTRL_ROOF_FLOOR_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530865#define PALMAS_SMPS8_CTRL_ROOF_FLOOR_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900866#define PALMAS_SMPS8_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530867#define PALMAS_SMPS8_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900868#define PALMAS_SMPS8_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530869#define PALMAS_SMPS8_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900870#define PALMAS_SMPS8_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530871#define PALMAS_SMPS8_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900872
873/* Bit definitions for SMPS8_TSTEP */
874#define PALMAS_SMPS8_TSTEP_TSTEP_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530875#define PALMAS_SMPS8_TSTEP_TSTEP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900876
877/* Bit definitions for SMPS8_FORCE */
878#define PALMAS_SMPS8_FORCE_CMD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530879#define PALMAS_SMPS8_FORCE_CMD_SHIFT 0x07
880#define PALMAS_SMPS8_FORCE_VSEL_MASK 0x7F
881#define PALMAS_SMPS8_FORCE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900882
883/* Bit definitions for SMPS8_VOLTAGE */
884#define PALMAS_SMPS8_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530885#define PALMAS_SMPS8_VOLTAGE_RANGE_SHIFT 0x07
886#define PALMAS_SMPS8_VOLTAGE_VSEL_MASK 0x7F
887#define PALMAS_SMPS8_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900888
889/* Bit definitions for SMPS9_CTRL */
890#define PALMAS_SMPS9_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530891#define PALMAS_SMPS9_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900892#define PALMAS_SMPS9_CTRL_STATUS_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +0530893#define PALMAS_SMPS9_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900894#define PALMAS_SMPS9_CTRL_MODE_SLEEP_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530895#define PALMAS_SMPS9_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900896#define PALMAS_SMPS9_CTRL_MODE_ACTIVE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530897#define PALMAS_SMPS9_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900898
899/* Bit definitions for SMPS9_VOLTAGE */
900#define PALMAS_SMPS9_VOLTAGE_RANGE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530901#define PALMAS_SMPS9_VOLTAGE_RANGE_SHIFT 0x07
902#define PALMAS_SMPS9_VOLTAGE_VSEL_MASK 0x7F
903#define PALMAS_SMPS9_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900904
905/* Bit definitions for SMPS10_CTRL */
906#define PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK 0xf0
Keerthy45ac60c2014-05-22 14:48:30 +0530907#define PALMAS_SMPS10_CTRL_MODE_SLEEP_SHIFT 0x04
908#define PALMAS_SMPS10_CTRL_MODE_ACTIVE_MASK 0x0F
909#define PALMAS_SMPS10_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900910
911/* Bit definitions for SMPS10_STATUS */
Keerthy45ac60c2014-05-22 14:48:30 +0530912#define PALMAS_SMPS10_STATUS_STATUS_MASK 0x0F
913#define PALMAS_SMPS10_STATUS_STATUS_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900914
915/* Bit definitions for SMPS_CTRL */
916#define PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530917#define PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900918#define PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530919#define PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900920#define PALMAS_SMPS_CTRL_SMPS45_PHASE_CTRL_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +0530921#define PALMAS_SMPS_CTRL_SMPS45_PHASE_CTRL_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900922#define PALMAS_SMPS_CTRL_SMPS123_PHASE_CTRL_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +0530923#define PALMAS_SMPS_CTRL_SMPS123_PHASE_CTRL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900924
925/* Bit definitions for SMPS_PD_CTRL */
926#define PALMAS_SMPS_PD_CTRL_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530927#define PALMAS_SMPS_PD_CTRL_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900928#define PALMAS_SMPS_PD_CTRL_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530929#define PALMAS_SMPS_PD_CTRL_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900930#define PALMAS_SMPS_PD_CTRL_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530931#define PALMAS_SMPS_PD_CTRL_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900932#define PALMAS_SMPS_PD_CTRL_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530933#define PALMAS_SMPS_PD_CTRL_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900934#define PALMAS_SMPS_PD_CTRL_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530935#define PALMAS_SMPS_PD_CTRL_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900936#define PALMAS_SMPS_PD_CTRL_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +0530937#define PALMAS_SMPS_PD_CTRL_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900938#define PALMAS_SMPS_PD_CTRL_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530939#define PALMAS_SMPS_PD_CTRL_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900940
941/* Bit definitions for SMPS_THERMAL_EN */
942#define PALMAS_SMPS_THERMAL_EN_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530943#define PALMAS_SMPS_THERMAL_EN_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900944#define PALMAS_SMPS_THERMAL_EN_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530945#define PALMAS_SMPS_THERMAL_EN_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900946#define PALMAS_SMPS_THERMAL_EN_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530947#define PALMAS_SMPS_THERMAL_EN_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900948#define PALMAS_SMPS_THERMAL_EN_SMPS457 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530949#define PALMAS_SMPS_THERMAL_EN_SMPS457_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900950#define PALMAS_SMPS_THERMAL_EN_SMPS123 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530951#define PALMAS_SMPS_THERMAL_EN_SMPS123_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900952
953/* Bit definitions for SMPS_THERMAL_STATUS */
954#define PALMAS_SMPS_THERMAL_STATUS_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530955#define PALMAS_SMPS_THERMAL_STATUS_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900956#define PALMAS_SMPS_THERMAL_STATUS_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530957#define PALMAS_SMPS_THERMAL_STATUS_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900958#define PALMAS_SMPS_THERMAL_STATUS_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530959#define PALMAS_SMPS_THERMAL_STATUS_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900960#define PALMAS_SMPS_THERMAL_STATUS_SMPS457 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530961#define PALMAS_SMPS_THERMAL_STATUS_SMPS457_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900962#define PALMAS_SMPS_THERMAL_STATUS_SMPS123 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530963#define PALMAS_SMPS_THERMAL_STATUS_SMPS123_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900964
965/* Bit definitions for SMPS_SHORT_STATUS */
966#define PALMAS_SMPS_SHORT_STATUS_SMPS10 0x80
Keerthy45ac60c2014-05-22 14:48:30 +0530967#define PALMAS_SMPS_SHORT_STATUS_SMPS10_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900968#define PALMAS_SMPS_SHORT_STATUS_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530969#define PALMAS_SMPS_SHORT_STATUS_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900970#define PALMAS_SMPS_SHORT_STATUS_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530971#define PALMAS_SMPS_SHORT_STATUS_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900972#define PALMAS_SMPS_SHORT_STATUS_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530973#define PALMAS_SMPS_SHORT_STATUS_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900974#define PALMAS_SMPS_SHORT_STATUS_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530975#define PALMAS_SMPS_SHORT_STATUS_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900976#define PALMAS_SMPS_SHORT_STATUS_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530977#define PALMAS_SMPS_SHORT_STATUS_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900978#define PALMAS_SMPS_SHORT_STATUS_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +0530979#define PALMAS_SMPS_SHORT_STATUS_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900980#define PALMAS_SMPS_SHORT_STATUS_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530981#define PALMAS_SMPS_SHORT_STATUS_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900982
983/* Bit definitions for SMPS_NEGATIVE_CURRENT_LIMIT_EN */
984#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +0530985#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900986#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +0530987#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900988#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +0530989#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900990#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +0530991#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900992#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +0530993#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900994#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +0530995#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900996#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +0530997#define PALMAS_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +0900998
999/* Bit definitions for SMPS_POWERGOOD_MASK1 */
1000#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS10 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301001#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS10_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001002#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301003#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001004#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301005#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001006#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301007#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001008#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301009#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001010#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301011#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001012#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301013#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001014#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301015#define PALMAS_SMPS_POWERGOOD_MASK1_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001016
1017/* Bit definitions for SMPS_POWERGOOD_MASK2 */
1018#define PALMAS_SMPS_POWERGOOD_MASK2_POWERGOOD_TYPE_SELECT 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301019#define PALMAS_SMPS_POWERGOOD_MASK2_POWERGOOD_TYPE_SELECT_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001020#define PALMAS_SMPS_POWERGOOD_MASK2_GPIO_7 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301021#define PALMAS_SMPS_POWERGOOD_MASK2_GPIO_7_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001022#define PALMAS_SMPS_POWERGOOD_MASK2_VBUS 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301023#define PALMAS_SMPS_POWERGOOD_MASK2_VBUS_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001024#define PALMAS_SMPS_POWERGOOD_MASK2_ACOK 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301025#define PALMAS_SMPS_POWERGOOD_MASK2_ACOK_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001026
1027/* Registers for function LDO */
Keerthy45ac60c2014-05-22 14:48:30 +05301028#define PALMAS_LDO1_CTRL 0x00
1029#define PALMAS_LDO1_VOLTAGE 0x01
1030#define PALMAS_LDO2_CTRL 0x02
1031#define PALMAS_LDO2_VOLTAGE 0x03
1032#define PALMAS_LDO3_CTRL 0x04
1033#define PALMAS_LDO3_VOLTAGE 0x05
1034#define PALMAS_LDO4_CTRL 0x06
1035#define PALMAS_LDO4_VOLTAGE 0x07
1036#define PALMAS_LDO5_CTRL 0x08
1037#define PALMAS_LDO5_VOLTAGE 0x09
1038#define PALMAS_LDO6_CTRL 0x0A
1039#define PALMAS_LDO6_VOLTAGE 0x0B
1040#define PALMAS_LDO7_CTRL 0x0C
1041#define PALMAS_LDO7_VOLTAGE 0x0D
1042#define PALMAS_LDO8_CTRL 0x0E
1043#define PALMAS_LDO8_VOLTAGE 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001044#define PALMAS_LDO9_CTRL 0x10
1045#define PALMAS_LDO9_VOLTAGE 0x11
1046#define PALMAS_LDOLN_CTRL 0x12
1047#define PALMAS_LDOLN_VOLTAGE 0x13
1048#define PALMAS_LDOUSB_CTRL 0x14
1049#define PALMAS_LDOUSB_VOLTAGE 0x15
1050#define PALMAS_LDO_CTRL 0x1A
1051#define PALMAS_LDO_PD_CTRL1 0x1B
1052#define PALMAS_LDO_PD_CTRL2 0x1C
1053#define PALMAS_LDO_SHORT_STATUS1 0x1D
1054#define PALMAS_LDO_SHORT_STATUS2 0x1E
1055
1056/* Bit definitions for LDO1_CTRL */
1057#define PALMAS_LDO1_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301058#define PALMAS_LDO1_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001059#define PALMAS_LDO1_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301060#define PALMAS_LDO1_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001061#define PALMAS_LDO1_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301062#define PALMAS_LDO1_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001063#define PALMAS_LDO1_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301064#define PALMAS_LDO1_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001065
1066/* Bit definitions for LDO1_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301067#define PALMAS_LDO1_VOLTAGE_VSEL_MASK 0x3F
1068#define PALMAS_LDO1_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001069
1070/* Bit definitions for LDO2_CTRL */
1071#define PALMAS_LDO2_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301072#define PALMAS_LDO2_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001073#define PALMAS_LDO2_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301074#define PALMAS_LDO2_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001075#define PALMAS_LDO2_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301076#define PALMAS_LDO2_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001077#define PALMAS_LDO2_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301078#define PALMAS_LDO2_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001079
1080/* Bit definitions for LDO2_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301081#define PALMAS_LDO2_VOLTAGE_VSEL_MASK 0x3F
1082#define PALMAS_LDO2_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001083
1084/* Bit definitions for LDO3_CTRL */
1085#define PALMAS_LDO3_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301086#define PALMAS_LDO3_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001087#define PALMAS_LDO3_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301088#define PALMAS_LDO3_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001089#define PALMAS_LDO3_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301090#define PALMAS_LDO3_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001091#define PALMAS_LDO3_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301092#define PALMAS_LDO3_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001093
1094/* Bit definitions for LDO3_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301095#define PALMAS_LDO3_VOLTAGE_VSEL_MASK 0x3F
1096#define PALMAS_LDO3_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001097
1098/* Bit definitions for LDO4_CTRL */
1099#define PALMAS_LDO4_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301100#define PALMAS_LDO4_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001101#define PALMAS_LDO4_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301102#define PALMAS_LDO4_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001103#define PALMAS_LDO4_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301104#define PALMAS_LDO4_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001105#define PALMAS_LDO4_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301106#define PALMAS_LDO4_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001107
1108/* Bit definitions for LDO4_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301109#define PALMAS_LDO4_VOLTAGE_VSEL_MASK 0x3F
1110#define PALMAS_LDO4_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001111
1112/* Bit definitions for LDO5_CTRL */
1113#define PALMAS_LDO5_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301114#define PALMAS_LDO5_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001115#define PALMAS_LDO5_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301116#define PALMAS_LDO5_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001117#define PALMAS_LDO5_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301118#define PALMAS_LDO5_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001119#define PALMAS_LDO5_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301120#define PALMAS_LDO5_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001121
1122/* Bit definitions for LDO5_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301123#define PALMAS_LDO5_VOLTAGE_VSEL_MASK 0x3F
1124#define PALMAS_LDO5_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001125
1126/* Bit definitions for LDO6_CTRL */
1127#define PALMAS_LDO6_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301128#define PALMAS_LDO6_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001129#define PALMAS_LDO6_CTRL_LDO_VIB_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301130#define PALMAS_LDO6_CTRL_LDO_VIB_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001131#define PALMAS_LDO6_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301132#define PALMAS_LDO6_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001133#define PALMAS_LDO6_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301134#define PALMAS_LDO6_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001135#define PALMAS_LDO6_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301136#define PALMAS_LDO6_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001137
1138/* Bit definitions for LDO6_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301139#define PALMAS_LDO6_VOLTAGE_VSEL_MASK 0x3F
1140#define PALMAS_LDO6_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001141
1142/* Bit definitions for LDO7_CTRL */
1143#define PALMAS_LDO7_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301144#define PALMAS_LDO7_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001145#define PALMAS_LDO7_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301146#define PALMAS_LDO7_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001147#define PALMAS_LDO7_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301148#define PALMAS_LDO7_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001149#define PALMAS_LDO7_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301150#define PALMAS_LDO7_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001151
1152/* Bit definitions for LDO7_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301153#define PALMAS_LDO7_VOLTAGE_VSEL_MASK 0x3F
1154#define PALMAS_LDO7_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001155
1156/* Bit definitions for LDO8_CTRL */
1157#define PALMAS_LDO8_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301158#define PALMAS_LDO8_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001159#define PALMAS_LDO8_CTRL_LDO_TRACKING_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301160#define PALMAS_LDO8_CTRL_LDO_TRACKING_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001161#define PALMAS_LDO8_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301162#define PALMAS_LDO8_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001163#define PALMAS_LDO8_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301164#define PALMAS_LDO8_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001165#define PALMAS_LDO8_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301166#define PALMAS_LDO8_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001167
1168/* Bit definitions for LDO8_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301169#define PALMAS_LDO8_VOLTAGE_VSEL_MASK 0x3F
1170#define PALMAS_LDO8_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001171
1172/* Bit definitions for LDO9_CTRL */
1173#define PALMAS_LDO9_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301174#define PALMAS_LDO9_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001175#define PALMAS_LDO9_CTRL_LDO_BYPASS_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301176#define PALMAS_LDO9_CTRL_LDO_BYPASS_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001177#define PALMAS_LDO9_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301178#define PALMAS_LDO9_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001179#define PALMAS_LDO9_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301180#define PALMAS_LDO9_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001181#define PALMAS_LDO9_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301182#define PALMAS_LDO9_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001183
1184/* Bit definitions for LDO9_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301185#define PALMAS_LDO9_VOLTAGE_VSEL_MASK 0x3F
1186#define PALMAS_LDO9_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001187
1188/* Bit definitions for LDOLN_CTRL */
1189#define PALMAS_LDOLN_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301190#define PALMAS_LDOLN_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001191#define PALMAS_LDOLN_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301192#define PALMAS_LDOLN_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001193#define PALMAS_LDOLN_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301194#define PALMAS_LDOLN_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001195#define PALMAS_LDOLN_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301196#define PALMAS_LDOLN_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001197
1198/* Bit definitions for LDOLN_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301199#define PALMAS_LDOLN_VOLTAGE_VSEL_MASK 0x3F
1200#define PALMAS_LDOLN_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001201
1202/* Bit definitions for LDOUSB_CTRL */
1203#define PALMAS_LDOUSB_CTRL_WR_S 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301204#define PALMAS_LDOUSB_CTRL_WR_S_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001205#define PALMAS_LDOUSB_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301206#define PALMAS_LDOUSB_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001207#define PALMAS_LDOUSB_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301208#define PALMAS_LDOUSB_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001209#define PALMAS_LDOUSB_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301210#define PALMAS_LDOUSB_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001211
1212/* Bit definitions for LDOUSB_VOLTAGE */
Keerthy45ac60c2014-05-22 14:48:30 +05301213#define PALMAS_LDOUSB_VOLTAGE_VSEL_MASK 0x3F
1214#define PALMAS_LDOUSB_VOLTAGE_VSEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001215
1216/* Bit definitions for LDO_CTRL */
1217#define PALMAS_LDO_CTRL_LDOUSB_ON_VBUS_VSYS 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301218#define PALMAS_LDO_CTRL_LDOUSB_ON_VBUS_VSYS_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001219
1220/* Bit definitions for LDO_PD_CTRL1 */
1221#define PALMAS_LDO_PD_CTRL1_LDO8 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301222#define PALMAS_LDO_PD_CTRL1_LDO8_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001223#define PALMAS_LDO_PD_CTRL1_LDO7 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301224#define PALMAS_LDO_PD_CTRL1_LDO7_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001225#define PALMAS_LDO_PD_CTRL1_LDO6 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301226#define PALMAS_LDO_PD_CTRL1_LDO6_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001227#define PALMAS_LDO_PD_CTRL1_LDO5 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301228#define PALMAS_LDO_PD_CTRL1_LDO5_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001229#define PALMAS_LDO_PD_CTRL1_LDO4 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301230#define PALMAS_LDO_PD_CTRL1_LDO4_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001231#define PALMAS_LDO_PD_CTRL1_LDO3 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301232#define PALMAS_LDO_PD_CTRL1_LDO3_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001233#define PALMAS_LDO_PD_CTRL1_LDO2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301234#define PALMAS_LDO_PD_CTRL1_LDO2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001235#define PALMAS_LDO_PD_CTRL1_LDO1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301236#define PALMAS_LDO_PD_CTRL1_LDO1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001237
1238/* Bit definitions for LDO_PD_CTRL2 */
1239#define PALMAS_LDO_PD_CTRL2_LDOUSB 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301240#define PALMAS_LDO_PD_CTRL2_LDOUSB_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001241#define PALMAS_LDO_PD_CTRL2_LDOLN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301242#define PALMAS_LDO_PD_CTRL2_LDOLN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001243#define PALMAS_LDO_PD_CTRL2_LDO9 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301244#define PALMAS_LDO_PD_CTRL2_LDO9_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001245
1246/* Bit definitions for LDO_SHORT_STATUS1 */
1247#define PALMAS_LDO_SHORT_STATUS1_LDO8 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301248#define PALMAS_LDO_SHORT_STATUS1_LDO8_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001249#define PALMAS_LDO_SHORT_STATUS1_LDO7 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301250#define PALMAS_LDO_SHORT_STATUS1_LDO7_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001251#define PALMAS_LDO_SHORT_STATUS1_LDO6 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301252#define PALMAS_LDO_SHORT_STATUS1_LDO6_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001253#define PALMAS_LDO_SHORT_STATUS1_LDO5 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301254#define PALMAS_LDO_SHORT_STATUS1_LDO5_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001255#define PALMAS_LDO_SHORT_STATUS1_LDO4 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301256#define PALMAS_LDO_SHORT_STATUS1_LDO4_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001257#define PALMAS_LDO_SHORT_STATUS1_LDO3 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301258#define PALMAS_LDO_SHORT_STATUS1_LDO3_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001259#define PALMAS_LDO_SHORT_STATUS1_LDO2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301260#define PALMAS_LDO_SHORT_STATUS1_LDO2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001261#define PALMAS_LDO_SHORT_STATUS1_LDO1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301262#define PALMAS_LDO_SHORT_STATUS1_LDO1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001263
1264/* Bit definitions for LDO_SHORT_STATUS2 */
1265#define PALMAS_LDO_SHORT_STATUS2_LDOVANA 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301266#define PALMAS_LDO_SHORT_STATUS2_LDOVANA_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001267#define PALMAS_LDO_SHORT_STATUS2_LDOUSB 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301268#define PALMAS_LDO_SHORT_STATUS2_LDOUSB_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001269#define PALMAS_LDO_SHORT_STATUS2_LDOLN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301270#define PALMAS_LDO_SHORT_STATUS2_LDOLN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001271#define PALMAS_LDO_SHORT_STATUS2_LDO9 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301272#define PALMAS_LDO_SHORT_STATUS2_LDO9_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001273
1274/* Registers for function PMU_CONTROL */
Keerthy45ac60c2014-05-22 14:48:30 +05301275#define PALMAS_DEV_CTRL 0x00
1276#define PALMAS_POWER_CTRL 0x01
1277#define PALMAS_VSYS_LO 0x02
1278#define PALMAS_VSYS_MON 0x03
1279#define PALMAS_VBAT_MON 0x04
1280#define PALMAS_WATCHDOG 0x05
1281#define PALMAS_BOOT_STATUS 0x06
1282#define PALMAS_BATTERY_BOUNCE 0x07
1283#define PALMAS_BACKUP_BATTERY_CTRL 0x08
1284#define PALMAS_LONG_PRESS_KEY 0x09
1285#define PALMAS_OSC_THERM_CTRL 0x0A
1286#define PALMAS_BATDEBOUNCING 0x0B
1287#define PALMAS_SWOFF_HWRST 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001288#define PALMAS_SWOFF_COLDRST 0x10
1289#define PALMAS_SWOFF_STATUS 0x11
1290#define PALMAS_PMU_CONFIG 0x12
1291#define PALMAS_SPARE 0x14
1292#define PALMAS_PMU_SECONDARY_INT 0x15
1293#define PALMAS_SW_REVISION 0x17
1294#define PALMAS_EXT_CHRG_CTRL 0x18
1295#define PALMAS_PMU_SECONDARY_INT2 0x19
1296
1297/* Bit definitions for DEV_CTRL */
1298#define PALMAS_DEV_CTRL_DEV_STATUS_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05301299#define PALMAS_DEV_CTRL_DEV_STATUS_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001300#define PALMAS_DEV_CTRL_SW_RST 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301301#define PALMAS_DEV_CTRL_SW_RST_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001302#define PALMAS_DEV_CTRL_DEV_ON 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301303#define PALMAS_DEV_CTRL_DEV_ON_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001304
1305/* Bit definitions for POWER_CTRL */
1306#define PALMAS_POWER_CTRL_ENABLE2_MASK 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301307#define PALMAS_POWER_CTRL_ENABLE2_MASK_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001308#define PALMAS_POWER_CTRL_ENABLE1_MASK 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301309#define PALMAS_POWER_CTRL_ENABLE1_MASK_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001310#define PALMAS_POWER_CTRL_NSLEEP_MASK 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301311#define PALMAS_POWER_CTRL_NSLEEP_MASK_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001312
1313/* Bit definitions for VSYS_LO */
Keerthy45ac60c2014-05-22 14:48:30 +05301314#define PALMAS_VSYS_LO_THRESHOLD_MASK 0x1F
1315#define PALMAS_VSYS_LO_THRESHOLD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001316
1317/* Bit definitions for VSYS_MON */
1318#define PALMAS_VSYS_MON_ENABLE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301319#define PALMAS_VSYS_MON_ENABLE_SHIFT 0x07
1320#define PALMAS_VSYS_MON_THRESHOLD_MASK 0x3F
1321#define PALMAS_VSYS_MON_THRESHOLD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001322
1323/* Bit definitions for VBAT_MON */
1324#define PALMAS_VBAT_MON_ENABLE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301325#define PALMAS_VBAT_MON_ENABLE_SHIFT 0x07
1326#define PALMAS_VBAT_MON_THRESHOLD_MASK 0x3F
1327#define PALMAS_VBAT_MON_THRESHOLD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001328
1329/* Bit definitions for WATCHDOG */
1330#define PALMAS_WATCHDOG_LOCK 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301331#define PALMAS_WATCHDOG_LOCK_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001332#define PALMAS_WATCHDOG_ENABLE 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301333#define PALMAS_WATCHDOG_ENABLE_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001334#define PALMAS_WATCHDOG_MODE 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301335#define PALMAS_WATCHDOG_MODE_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001336#define PALMAS_WATCHDOG_TIMER_MASK 0x07
Keerthy45ac60c2014-05-22 14:48:30 +05301337#define PALMAS_WATCHDOG_TIMER_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001338
1339/* Bit definitions for BOOT_STATUS */
1340#define PALMAS_BOOT_STATUS_BOOT1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301341#define PALMAS_BOOT_STATUS_BOOT1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001342#define PALMAS_BOOT_STATUS_BOOT0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301343#define PALMAS_BOOT_STATUS_BOOT0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001344
1345/* Bit definitions for BATTERY_BOUNCE */
Keerthy45ac60c2014-05-22 14:48:30 +05301346#define PALMAS_BATTERY_BOUNCE_BB_DELAY_MASK 0x3F
1347#define PALMAS_BATTERY_BOUNCE_BB_DELAY_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001348
1349/* Bit definitions for BACKUP_BATTERY_CTRL */
1350#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_18_15 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301351#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_18_15_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001352#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_EN_SLP 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301353#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_EN_SLP_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001354#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_EN_OFF 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301355#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_EN_OFF_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001356#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_PWEN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301357#define PALMAS_BACKUP_BATTERY_CTRL_VRTC_PWEN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001358#define PALMAS_BACKUP_BATTERY_CTRL_BBS_BBC_LOW_ICHRG 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301359#define PALMAS_BACKUP_BATTERY_CTRL_BBS_BBC_LOW_ICHRG_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001360#define PALMAS_BACKUP_BATTERY_CTRL_BB_SEL_MASK 0x06
Keerthy45ac60c2014-05-22 14:48:30 +05301361#define PALMAS_BACKUP_BATTERY_CTRL_BB_SEL_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001362#define PALMAS_BACKUP_BATTERY_CTRL_BB_CHG_EN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301363#define PALMAS_BACKUP_BATTERY_CTRL_BB_CHG_EN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001364
1365/* Bit definitions for LONG_PRESS_KEY */
1366#define PALMAS_LONG_PRESS_KEY_LPK_LOCK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301367#define PALMAS_LONG_PRESS_KEY_LPK_LOCK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001368#define PALMAS_LONG_PRESS_KEY_LPK_INT_CLR 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301369#define PALMAS_LONG_PRESS_KEY_LPK_INT_CLR_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001370#define PALMAS_LONG_PRESS_KEY_LPK_TIME_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05301371#define PALMAS_LONG_PRESS_KEY_LPK_TIME_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001372#define PALMAS_LONG_PRESS_KEY_PWRON_DEBOUNCE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +05301373#define PALMAS_LONG_PRESS_KEY_PWRON_DEBOUNCE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001374
1375/* Bit definitions for OSC_THERM_CTRL */
1376#define PALMAS_OSC_THERM_CTRL_VANA_ON_IN_SLEEP 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301377#define PALMAS_OSC_THERM_CTRL_VANA_ON_IN_SLEEP_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001378#define PALMAS_OSC_THERM_CTRL_INT_MASK_IN_SLEEP 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301379#define PALMAS_OSC_THERM_CTRL_INT_MASK_IN_SLEEP_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001380#define PALMAS_OSC_THERM_CTRL_RC15MHZ_ON_IN_SLEEP 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301381#define PALMAS_OSC_THERM_CTRL_RC15MHZ_ON_IN_SLEEP_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001382#define PALMAS_OSC_THERM_CTRL_THERM_OFF_IN_SLEEP 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301383#define PALMAS_OSC_THERM_CTRL_THERM_OFF_IN_SLEEP_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001384#define PALMAS_OSC_THERM_CTRL_THERM_HD_SEL_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05301385#define PALMAS_OSC_THERM_CTRL_THERM_HD_SEL_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001386#define PALMAS_OSC_THERM_CTRL_OSC_BYPASS 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301387#define PALMAS_OSC_THERM_CTRL_OSC_BYPASS_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001388#define PALMAS_OSC_THERM_CTRL_OSC_HPMODE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301389#define PALMAS_OSC_THERM_CTRL_OSC_HPMODE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001390
1391/* Bit definitions for BATDEBOUNCING */
1392#define PALMAS_BATDEBOUNCING_BAT_DEB_BYPASS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301393#define PALMAS_BATDEBOUNCING_BAT_DEB_BYPASS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001394#define PALMAS_BATDEBOUNCING_BINS_DEB_MASK 0x78
Keerthy45ac60c2014-05-22 14:48:30 +05301395#define PALMAS_BATDEBOUNCING_BINS_DEB_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001396#define PALMAS_BATDEBOUNCING_BEXT_DEB_MASK 0x07
Keerthy45ac60c2014-05-22 14:48:30 +05301397#define PALMAS_BATDEBOUNCING_BEXT_DEB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001398
1399/* Bit definitions for SWOFF_HWRST */
1400#define PALMAS_SWOFF_HWRST_PWRON_LPK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301401#define PALMAS_SWOFF_HWRST_PWRON_LPK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001402#define PALMAS_SWOFF_HWRST_PWRDOWN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301403#define PALMAS_SWOFF_HWRST_PWRDOWN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001404#define PALMAS_SWOFF_HWRST_WTD 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301405#define PALMAS_SWOFF_HWRST_WTD_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001406#define PALMAS_SWOFF_HWRST_TSHUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301407#define PALMAS_SWOFF_HWRST_TSHUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001408#define PALMAS_SWOFF_HWRST_RESET_IN 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301409#define PALMAS_SWOFF_HWRST_RESET_IN_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001410#define PALMAS_SWOFF_HWRST_SW_RST 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301411#define PALMAS_SWOFF_HWRST_SW_RST_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001412#define PALMAS_SWOFF_HWRST_VSYS_LO 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301413#define PALMAS_SWOFF_HWRST_VSYS_LO_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001414#define PALMAS_SWOFF_HWRST_GPADC_SHUTDOWN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301415#define PALMAS_SWOFF_HWRST_GPADC_SHUTDOWN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001416
1417/* Bit definitions for SWOFF_COLDRST */
1418#define PALMAS_SWOFF_COLDRST_PWRON_LPK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301419#define PALMAS_SWOFF_COLDRST_PWRON_LPK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001420#define PALMAS_SWOFF_COLDRST_PWRDOWN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301421#define PALMAS_SWOFF_COLDRST_PWRDOWN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001422#define PALMAS_SWOFF_COLDRST_WTD 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301423#define PALMAS_SWOFF_COLDRST_WTD_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001424#define PALMAS_SWOFF_COLDRST_TSHUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301425#define PALMAS_SWOFF_COLDRST_TSHUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001426#define PALMAS_SWOFF_COLDRST_RESET_IN 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301427#define PALMAS_SWOFF_COLDRST_RESET_IN_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001428#define PALMAS_SWOFF_COLDRST_SW_RST 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301429#define PALMAS_SWOFF_COLDRST_SW_RST_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001430#define PALMAS_SWOFF_COLDRST_VSYS_LO 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301431#define PALMAS_SWOFF_COLDRST_VSYS_LO_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001432#define PALMAS_SWOFF_COLDRST_GPADC_SHUTDOWN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301433#define PALMAS_SWOFF_COLDRST_GPADC_SHUTDOWN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001434
1435/* Bit definitions for SWOFF_STATUS */
1436#define PALMAS_SWOFF_STATUS_PWRON_LPK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301437#define PALMAS_SWOFF_STATUS_PWRON_LPK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001438#define PALMAS_SWOFF_STATUS_PWRDOWN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301439#define PALMAS_SWOFF_STATUS_PWRDOWN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001440#define PALMAS_SWOFF_STATUS_WTD 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301441#define PALMAS_SWOFF_STATUS_WTD_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001442#define PALMAS_SWOFF_STATUS_TSHUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301443#define PALMAS_SWOFF_STATUS_TSHUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001444#define PALMAS_SWOFF_STATUS_RESET_IN 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301445#define PALMAS_SWOFF_STATUS_RESET_IN_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001446#define PALMAS_SWOFF_STATUS_SW_RST 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301447#define PALMAS_SWOFF_STATUS_SW_RST_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001448#define PALMAS_SWOFF_STATUS_VSYS_LO 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301449#define PALMAS_SWOFF_STATUS_VSYS_LO_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001450#define PALMAS_SWOFF_STATUS_GPADC_SHUTDOWN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301451#define PALMAS_SWOFF_STATUS_GPADC_SHUTDOWN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001452
1453/* Bit definitions for PMU_CONFIG */
1454#define PALMAS_PMU_CONFIG_MULTI_CELL_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301455#define PALMAS_PMU_CONFIG_MULTI_CELL_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001456#define PALMAS_PMU_CONFIG_SPARE_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +05301457#define PALMAS_PMU_CONFIG_SPARE_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001458#define PALMAS_PMU_CONFIG_SWOFF_DLY_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05301459#define PALMAS_PMU_CONFIG_SWOFF_DLY_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001460#define PALMAS_PMU_CONFIG_GATE_RESET_OUT 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301461#define PALMAS_PMU_CONFIG_GATE_RESET_OUT_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001462#define PALMAS_PMU_CONFIG_AUTODEVON 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301463#define PALMAS_PMU_CONFIG_AUTODEVON_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001464
1465/* Bit definitions for SPARE */
1466#define PALMAS_SPARE_SPARE_MASK 0xf8
Keerthy45ac60c2014-05-22 14:48:30 +05301467#define PALMAS_SPARE_SPARE_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001468#define PALMAS_SPARE_REGEN3_OD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301469#define PALMAS_SPARE_REGEN3_OD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001470#define PALMAS_SPARE_REGEN2_OD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301471#define PALMAS_SPARE_REGEN2_OD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001472#define PALMAS_SPARE_REGEN1_OD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301473#define PALMAS_SPARE_REGEN1_OD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001474
1475/* Bit definitions for PMU_SECONDARY_INT */
1476#define PALMAS_PMU_SECONDARY_INT_VBUS_OVV_INT_SRC 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301477#define PALMAS_PMU_SECONDARY_INT_VBUS_OVV_INT_SRC_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001478#define PALMAS_PMU_SECONDARY_INT_CHARG_DET_N_INT_SRC 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301479#define PALMAS_PMU_SECONDARY_INT_CHARG_DET_N_INT_SRC_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001480#define PALMAS_PMU_SECONDARY_INT_BB_INT_SRC 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301481#define PALMAS_PMU_SECONDARY_INT_BB_INT_SRC_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001482#define PALMAS_PMU_SECONDARY_INT_FBI_INT_SRC 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301483#define PALMAS_PMU_SECONDARY_INT_FBI_INT_SRC_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001484#define PALMAS_PMU_SECONDARY_INT_VBUS_OVV_MASK 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301485#define PALMAS_PMU_SECONDARY_INT_VBUS_OVV_MASK_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001486#define PALMAS_PMU_SECONDARY_INT_CHARG_DET_N_MASK 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301487#define PALMAS_PMU_SECONDARY_INT_CHARG_DET_N_MASK_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001488#define PALMAS_PMU_SECONDARY_INT_BB_MASK 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301489#define PALMAS_PMU_SECONDARY_INT_BB_MASK_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001490#define PALMAS_PMU_SECONDARY_INT_FBI_MASK 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301491#define PALMAS_PMU_SECONDARY_INT_FBI_MASK_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001492
1493/* Bit definitions for SW_REVISION */
Keerthy45ac60c2014-05-22 14:48:30 +05301494#define PALMAS_SW_REVISION_SW_REVISION_MASK 0xFF
1495#define PALMAS_SW_REVISION_SW_REVISION_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001496
1497/* Bit definitions for EXT_CHRG_CTRL */
1498#define PALMAS_EXT_CHRG_CTRL_VBUS_OVV_STATUS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301499#define PALMAS_EXT_CHRG_CTRL_VBUS_OVV_STATUS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001500#define PALMAS_EXT_CHRG_CTRL_CHARG_DET_N_STATUS 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301501#define PALMAS_EXT_CHRG_CTRL_CHARG_DET_N_STATUS_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001502#define PALMAS_EXT_CHRG_CTRL_VSYS_DEBOUNCE_DELAY 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301503#define PALMAS_EXT_CHRG_CTRL_VSYS_DEBOUNCE_DELAY_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001504#define PALMAS_EXT_CHRG_CTRL_CHRG_DET_N 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301505#define PALMAS_EXT_CHRG_CTRL_CHRG_DET_N_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001506#define PALMAS_EXT_CHRG_CTRL_AUTO_ACA_EN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301507#define PALMAS_EXT_CHRG_CTRL_AUTO_ACA_EN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001508#define PALMAS_EXT_CHRG_CTRL_AUTO_LDOUSB_EN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301509#define PALMAS_EXT_CHRG_CTRL_AUTO_LDOUSB_EN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001510
1511/* Bit definitions for PMU_SECONDARY_INT2 */
1512#define PALMAS_PMU_SECONDARY_INT2_DVFS2_INT_SRC 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301513#define PALMAS_PMU_SECONDARY_INT2_DVFS2_INT_SRC_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001514#define PALMAS_PMU_SECONDARY_INT2_DVFS1_INT_SRC 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301515#define PALMAS_PMU_SECONDARY_INT2_DVFS1_INT_SRC_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001516#define PALMAS_PMU_SECONDARY_INT2_DVFS2_MASK 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301517#define PALMAS_PMU_SECONDARY_INT2_DVFS2_MASK_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001518#define PALMAS_PMU_SECONDARY_INT2_DVFS1_MASK 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301519#define PALMAS_PMU_SECONDARY_INT2_DVFS1_MASK_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001520
1521/* Registers for function RESOURCE */
Keerthy45ac60c2014-05-22 14:48:30 +05301522#define PALMAS_CLK32KG_CTRL 0x00
1523#define PALMAS_CLK32KGAUDIO_CTRL 0x01
1524#define PALMAS_REGEN1_CTRL 0x02
1525#define PALMAS_REGEN2_CTRL 0x03
1526#define PALMAS_SYSEN1_CTRL 0x04
1527#define PALMAS_SYSEN2_CTRL 0x05
1528#define PALMAS_NSLEEP_RES_ASSIGN 0x06
1529#define PALMAS_NSLEEP_SMPS_ASSIGN 0x07
1530#define PALMAS_NSLEEP_LDO_ASSIGN1 0x08
1531#define PALMAS_NSLEEP_LDO_ASSIGN2 0x09
1532#define PALMAS_ENABLE1_RES_ASSIGN 0x0A
1533#define PALMAS_ENABLE1_SMPS_ASSIGN 0x0B
1534#define PALMAS_ENABLE1_LDO_ASSIGN1 0x0C
1535#define PALMAS_ENABLE1_LDO_ASSIGN2 0x0D
1536#define PALMAS_ENABLE2_RES_ASSIGN 0x0E
1537#define PALMAS_ENABLE2_SMPS_ASSIGN 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001538#define PALMAS_ENABLE2_LDO_ASSIGN1 0x10
1539#define PALMAS_ENABLE2_LDO_ASSIGN2 0x11
1540#define PALMAS_REGEN3_CTRL 0x12
1541
1542/* Bit definitions for CLK32KG_CTRL */
1543#define PALMAS_CLK32KG_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301544#define PALMAS_CLK32KG_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001545#define PALMAS_CLK32KG_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301546#define PALMAS_CLK32KG_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001547#define PALMAS_CLK32KG_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301548#define PALMAS_CLK32KG_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001549
1550/* Bit definitions for CLK32KGAUDIO_CTRL */
1551#define PALMAS_CLK32KGAUDIO_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301552#define PALMAS_CLK32KGAUDIO_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001553#define PALMAS_CLK32KGAUDIO_CTRL_RESERVED3 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301554#define PALMAS_CLK32KGAUDIO_CTRL_RESERVED3_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001555#define PALMAS_CLK32KGAUDIO_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301556#define PALMAS_CLK32KGAUDIO_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001557#define PALMAS_CLK32KGAUDIO_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301558#define PALMAS_CLK32KGAUDIO_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001559
1560/* Bit definitions for REGEN1_CTRL */
1561#define PALMAS_REGEN1_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301562#define PALMAS_REGEN1_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001563#define PALMAS_REGEN1_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301564#define PALMAS_REGEN1_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001565#define PALMAS_REGEN1_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301566#define PALMAS_REGEN1_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001567
1568/* Bit definitions for REGEN2_CTRL */
1569#define PALMAS_REGEN2_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301570#define PALMAS_REGEN2_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001571#define PALMAS_REGEN2_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301572#define PALMAS_REGEN2_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001573#define PALMAS_REGEN2_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301574#define PALMAS_REGEN2_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001575
1576/* Bit definitions for SYSEN1_CTRL */
1577#define PALMAS_SYSEN1_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301578#define PALMAS_SYSEN1_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001579#define PALMAS_SYSEN1_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301580#define PALMAS_SYSEN1_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001581#define PALMAS_SYSEN1_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301582#define PALMAS_SYSEN1_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001583
1584/* Bit definitions for SYSEN2_CTRL */
1585#define PALMAS_SYSEN2_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301586#define PALMAS_SYSEN2_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001587#define PALMAS_SYSEN2_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301588#define PALMAS_SYSEN2_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001589#define PALMAS_SYSEN2_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301590#define PALMAS_SYSEN2_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001591
1592/* Bit definitions for NSLEEP_RES_ASSIGN */
1593#define PALMAS_NSLEEP_RES_ASSIGN_REGEN3 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301594#define PALMAS_NSLEEP_RES_ASSIGN_REGEN3_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001595#define PALMAS_NSLEEP_RES_ASSIGN_CLK32KGAUDIO 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301596#define PALMAS_NSLEEP_RES_ASSIGN_CLK32KGAUDIO_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001597#define PALMAS_NSLEEP_RES_ASSIGN_CLK32KG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301598#define PALMAS_NSLEEP_RES_ASSIGN_CLK32KG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001599#define PALMAS_NSLEEP_RES_ASSIGN_SYSEN2 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301600#define PALMAS_NSLEEP_RES_ASSIGN_SYSEN2_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001601#define PALMAS_NSLEEP_RES_ASSIGN_SYSEN1 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301602#define PALMAS_NSLEEP_RES_ASSIGN_SYSEN1_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001603#define PALMAS_NSLEEP_RES_ASSIGN_REGEN2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301604#define PALMAS_NSLEEP_RES_ASSIGN_REGEN2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001605#define PALMAS_NSLEEP_RES_ASSIGN_REGEN1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301606#define PALMAS_NSLEEP_RES_ASSIGN_REGEN1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001607
1608/* Bit definitions for NSLEEP_SMPS_ASSIGN */
1609#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS10 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301610#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS10_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001611#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301612#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001613#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301614#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001615#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301616#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001617#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301618#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001619#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301620#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001621#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301622#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001623#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301624#define PALMAS_NSLEEP_SMPS_ASSIGN_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001625
1626/* Bit definitions for NSLEEP_LDO_ASSIGN1 */
1627#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO8 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301628#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO8_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001629#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO7 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301630#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO7_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001631#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO6 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301632#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO6_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001633#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO5 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301634#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO5_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001635#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO4 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301636#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO4_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001637#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO3 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301638#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO3_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001639#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301640#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001641#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301642#define PALMAS_NSLEEP_LDO_ASSIGN1_LDO1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001643
1644/* Bit definitions for NSLEEP_LDO_ASSIGN2 */
1645#define PALMAS_NSLEEP_LDO_ASSIGN2_LDOUSB 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301646#define PALMAS_NSLEEP_LDO_ASSIGN2_LDOUSB_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001647#define PALMAS_NSLEEP_LDO_ASSIGN2_LDOLN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301648#define PALMAS_NSLEEP_LDO_ASSIGN2_LDOLN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001649#define PALMAS_NSLEEP_LDO_ASSIGN2_LDO9 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301650#define PALMAS_NSLEEP_LDO_ASSIGN2_LDO9_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001651
1652/* Bit definitions for ENABLE1_RES_ASSIGN */
1653#define PALMAS_ENABLE1_RES_ASSIGN_REGEN3 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301654#define PALMAS_ENABLE1_RES_ASSIGN_REGEN3_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001655#define PALMAS_ENABLE1_RES_ASSIGN_CLK32KGAUDIO 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301656#define PALMAS_ENABLE1_RES_ASSIGN_CLK32KGAUDIO_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001657#define PALMAS_ENABLE1_RES_ASSIGN_CLK32KG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301658#define PALMAS_ENABLE1_RES_ASSIGN_CLK32KG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001659#define PALMAS_ENABLE1_RES_ASSIGN_SYSEN2 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301660#define PALMAS_ENABLE1_RES_ASSIGN_SYSEN2_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001661#define PALMAS_ENABLE1_RES_ASSIGN_SYSEN1 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301662#define PALMAS_ENABLE1_RES_ASSIGN_SYSEN1_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001663#define PALMAS_ENABLE1_RES_ASSIGN_REGEN2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301664#define PALMAS_ENABLE1_RES_ASSIGN_REGEN2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001665#define PALMAS_ENABLE1_RES_ASSIGN_REGEN1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301666#define PALMAS_ENABLE1_RES_ASSIGN_REGEN1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001667
1668/* Bit definitions for ENABLE1_SMPS_ASSIGN */
1669#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS10 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301670#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS10_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001671#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301672#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001673#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301674#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001675#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301676#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001677#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301678#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001679#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301680#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001681#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301682#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001683#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301684#define PALMAS_ENABLE1_SMPS_ASSIGN_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001685
1686/* Bit definitions for ENABLE1_LDO_ASSIGN1 */
1687#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO8 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301688#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO8_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001689#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO7 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301690#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO7_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001691#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO6 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301692#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO6_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001693#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO5 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301694#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO5_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001695#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO4 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301696#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO4_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001697#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO3 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301698#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO3_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001699#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301700#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001701#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301702#define PALMAS_ENABLE1_LDO_ASSIGN1_LDO1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001703
1704/* Bit definitions for ENABLE1_LDO_ASSIGN2 */
1705#define PALMAS_ENABLE1_LDO_ASSIGN2_LDOUSB 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301706#define PALMAS_ENABLE1_LDO_ASSIGN2_LDOUSB_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001707#define PALMAS_ENABLE1_LDO_ASSIGN2_LDOLN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301708#define PALMAS_ENABLE1_LDO_ASSIGN2_LDOLN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001709#define PALMAS_ENABLE1_LDO_ASSIGN2_LDO9 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301710#define PALMAS_ENABLE1_LDO_ASSIGN2_LDO9_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001711
1712/* Bit definitions for ENABLE2_RES_ASSIGN */
1713#define PALMAS_ENABLE2_RES_ASSIGN_REGEN3 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301714#define PALMAS_ENABLE2_RES_ASSIGN_REGEN3_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001715#define PALMAS_ENABLE2_RES_ASSIGN_CLK32KGAUDIO 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301716#define PALMAS_ENABLE2_RES_ASSIGN_CLK32KGAUDIO_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001717#define PALMAS_ENABLE2_RES_ASSIGN_CLK32KG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301718#define PALMAS_ENABLE2_RES_ASSIGN_CLK32KG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001719#define PALMAS_ENABLE2_RES_ASSIGN_SYSEN2 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301720#define PALMAS_ENABLE2_RES_ASSIGN_SYSEN2_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001721#define PALMAS_ENABLE2_RES_ASSIGN_SYSEN1 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301722#define PALMAS_ENABLE2_RES_ASSIGN_SYSEN1_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001723#define PALMAS_ENABLE2_RES_ASSIGN_REGEN2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301724#define PALMAS_ENABLE2_RES_ASSIGN_REGEN2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001725#define PALMAS_ENABLE2_RES_ASSIGN_REGEN1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301726#define PALMAS_ENABLE2_RES_ASSIGN_REGEN1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001727
1728/* Bit definitions for ENABLE2_SMPS_ASSIGN */
1729#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS10 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301730#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS10_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001731#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS9 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301732#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS9_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001733#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS8 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301734#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS8_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001735#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS7 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301736#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001737#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301738#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001739#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS45 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301740#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS45_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001741#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS3 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301742#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS3_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001743#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS12 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301744#define PALMAS_ENABLE2_SMPS_ASSIGN_SMPS12_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001745
1746/* Bit definitions for ENABLE2_LDO_ASSIGN1 */
1747#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO8 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301748#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO8_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001749#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO7 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301750#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO7_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001751#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO6 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301752#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO6_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001753#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO5 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301754#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO5_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001755#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO4 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301756#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO4_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001757#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO3 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301758#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO3_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001759#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301760#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001761#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301762#define PALMAS_ENABLE2_LDO_ASSIGN1_LDO1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001763
1764/* Bit definitions for ENABLE2_LDO_ASSIGN2 */
1765#define PALMAS_ENABLE2_LDO_ASSIGN2_LDOUSB 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301766#define PALMAS_ENABLE2_LDO_ASSIGN2_LDOUSB_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001767#define PALMAS_ENABLE2_LDO_ASSIGN2_LDOLN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301768#define PALMAS_ENABLE2_LDO_ASSIGN2_LDOLN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001769#define PALMAS_ENABLE2_LDO_ASSIGN2_LDO9 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301770#define PALMAS_ENABLE2_LDO_ASSIGN2_LDO9_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001771
1772/* Bit definitions for REGEN3_CTRL */
1773#define PALMAS_REGEN3_CTRL_STATUS 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301774#define PALMAS_REGEN3_CTRL_STATUS_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001775#define PALMAS_REGEN3_CTRL_MODE_SLEEP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301776#define PALMAS_REGEN3_CTRL_MODE_SLEEP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001777#define PALMAS_REGEN3_CTRL_MODE_ACTIVE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301778#define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001779
1780/* Registers for function PAD_CONTROL */
Keerthy45ac60c2014-05-22 14:48:30 +05301781#define PALMAS_OD_OUTPUT_CTRL2 0x02
1782#define PALMAS_POLARITY_CTRL2 0x03
1783#define PALMAS_PU_PD_INPUT_CTRL1 0x04
1784#define PALMAS_PU_PD_INPUT_CTRL2 0x05
1785#define PALMAS_PU_PD_INPUT_CTRL3 0x06
1786#define PALMAS_PU_PD_INPUT_CTRL5 0x07
1787#define PALMAS_OD_OUTPUT_CTRL 0x08
1788#define PALMAS_POLARITY_CTRL 0x09
1789#define PALMAS_PRIMARY_SECONDARY_PAD1 0x0A
1790#define PALMAS_PRIMARY_SECONDARY_PAD2 0x0B
1791#define PALMAS_I2C_SPI 0x0C
1792#define PALMAS_PU_PD_INPUT_CTRL4 0x0D
1793#define PALMAS_PRIMARY_SECONDARY_PAD3 0x0E
1794#define PALMAS_PRIMARY_SECONDARY_PAD4 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001795
1796/* Bit definitions for PU_PD_INPUT_CTRL1 */
1797#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301798#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001799#define PALMAS_PU_PD_INPUT_CTRL1_GPADC_START_PU 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301800#define PALMAS_PU_PD_INPUT_CTRL1_GPADC_START_PU_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001801#define PALMAS_PU_PD_INPUT_CTRL1_GPADC_START_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301802#define PALMAS_PU_PD_INPUT_CTRL1_GPADC_START_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001803#define PALMAS_PU_PD_INPUT_CTRL1_PWRDOWN_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301804#define PALMAS_PU_PD_INPUT_CTRL1_PWRDOWN_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001805#define PALMAS_PU_PD_INPUT_CTRL1_NRESWARM_PU 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301806#define PALMAS_PU_PD_INPUT_CTRL1_NRESWARM_PU_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001807
1808/* Bit definitions for PU_PD_INPUT_CTRL2 */
1809#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE2_PU 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301810#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE2_PU_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001811#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE2_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301812#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE2_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001813#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE1_PU 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301814#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE1_PU_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001815#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE1_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301816#define PALMAS_PU_PD_INPUT_CTRL2_ENABLE1_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001817#define PALMAS_PU_PD_INPUT_CTRL2_NSLEEP_PU 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301818#define PALMAS_PU_PD_INPUT_CTRL2_NSLEEP_PU_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001819#define PALMAS_PU_PD_INPUT_CTRL2_NSLEEP_PD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301820#define PALMAS_PU_PD_INPUT_CTRL2_NSLEEP_PD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001821
1822/* Bit definitions for PU_PD_INPUT_CTRL3 */
1823#define PALMAS_PU_PD_INPUT_CTRL3_ACOK_PD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301824#define PALMAS_PU_PD_INPUT_CTRL3_ACOK_PD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001825#define PALMAS_PU_PD_INPUT_CTRL3_CHRG_DET_N_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301826#define PALMAS_PU_PD_INPUT_CTRL3_CHRG_DET_N_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001827#define PALMAS_PU_PD_INPUT_CTRL3_POWERHOLD_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301828#define PALMAS_PU_PD_INPUT_CTRL3_POWERHOLD_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001829#define PALMAS_PU_PD_INPUT_CTRL3_MSECURE_PD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301830#define PALMAS_PU_PD_INPUT_CTRL3_MSECURE_PD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001831
1832/* Bit definitions for OD_OUTPUT_CTRL */
1833#define PALMAS_OD_OUTPUT_CTRL_PWM_2_OD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301834#define PALMAS_OD_OUTPUT_CTRL_PWM_2_OD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001835#define PALMAS_OD_OUTPUT_CTRL_VBUSDET_OD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301836#define PALMAS_OD_OUTPUT_CTRL_VBUSDET_OD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001837#define PALMAS_OD_OUTPUT_CTRL_PWM_1_OD 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301838#define PALMAS_OD_OUTPUT_CTRL_PWM_1_OD_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001839#define PALMAS_OD_OUTPUT_CTRL_INT_OD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301840#define PALMAS_OD_OUTPUT_CTRL_INT_OD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001841
1842/* Bit definitions for POLARITY_CTRL */
1843#define PALMAS_POLARITY_CTRL_INT_POLARITY 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301844#define PALMAS_POLARITY_CTRL_INT_POLARITY_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001845#define PALMAS_POLARITY_CTRL_ENABLE2_POLARITY 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301846#define PALMAS_POLARITY_CTRL_ENABLE2_POLARITY_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001847#define PALMAS_POLARITY_CTRL_ENABLE1_POLARITY 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301848#define PALMAS_POLARITY_CTRL_ENABLE1_POLARITY_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001849#define PALMAS_POLARITY_CTRL_NSLEEP_POLARITY 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301850#define PALMAS_POLARITY_CTRL_NSLEEP_POLARITY_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001851#define PALMAS_POLARITY_CTRL_RESET_IN_POLARITY 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301852#define PALMAS_POLARITY_CTRL_RESET_IN_POLARITY_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001853#define PALMAS_POLARITY_CTRL_GPIO_3_CHRG_DET_N_POLARITY 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301854#define PALMAS_POLARITY_CTRL_GPIO_3_CHRG_DET_N_POLARITY_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001855#define PALMAS_POLARITY_CTRL_POWERGOOD_USB_PSEL_POLARITY 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301856#define PALMAS_POLARITY_CTRL_POWERGOOD_USB_PSEL_POLARITY_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001857#define PALMAS_POLARITY_CTRL_PWRDOWN_POLARITY 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301858#define PALMAS_POLARITY_CTRL_PWRDOWN_POLARITY_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001859
1860/* Bit definitions for PRIMARY_SECONDARY_PAD1 */
1861#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_3 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301862#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_3_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001863#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_2_MASK 0x60
Keerthy45ac60c2014-05-22 14:48:30 +05301864#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_2_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001865#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_MASK 0x18
Keerthy45ac60c2014-05-22 14:48:30 +05301866#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001867#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_0 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301868#define PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_0_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001869#define PALMAS_PRIMARY_SECONDARY_PAD1_VAC 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301870#define PALMAS_PRIMARY_SECONDARY_PAD1_VAC_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001871#define PALMAS_PRIMARY_SECONDARY_PAD1_POWERGOOD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301872#define PALMAS_PRIMARY_SECONDARY_PAD1_POWERGOOD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001873
1874/* Bit definitions for PRIMARY_SECONDARY_PAD2 */
1875#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +05301876#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001877#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_6 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301878#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_6_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001879#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_5_MASK 0x06
Keerthy45ac60c2014-05-22 14:48:30 +05301880#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_5_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001881#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_4 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301882#define PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_4_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001883
1884/* Bit definitions for I2C_SPI */
1885#define PALMAS_I2C_SPI_I2C2OTP_EN 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301886#define PALMAS_I2C_SPI_I2C2OTP_EN_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001887#define PALMAS_I2C_SPI_I2C2OTP_PAGESEL 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301888#define PALMAS_I2C_SPI_I2C2OTP_PAGESEL_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001889#define PALMAS_I2C_SPI_ID_I2C2 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301890#define PALMAS_I2C_SPI_ID_I2C2_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001891#define PALMAS_I2C_SPI_I2C_SPI 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301892#define PALMAS_I2C_SPI_I2C_SPI_SHIFT 0x04
1893#define PALMAS_I2C_SPI_ID_I2C1_MASK 0x0F
1894#define PALMAS_I2C_SPI_ID_I2C1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001895
1896/* Bit definitions for PU_PD_INPUT_CTRL4 */
1897#define PALMAS_PU_PD_INPUT_CTRL4_DVFS2_DAT_PD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301898#define PALMAS_PU_PD_INPUT_CTRL4_DVFS2_DAT_PD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001899#define PALMAS_PU_PD_INPUT_CTRL4_DVFS2_CLK_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301900#define PALMAS_PU_PD_INPUT_CTRL4_DVFS2_CLK_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001901#define PALMAS_PU_PD_INPUT_CTRL4_DVFS1_DAT_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301902#define PALMAS_PU_PD_INPUT_CTRL4_DVFS1_DAT_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001903#define PALMAS_PU_PD_INPUT_CTRL4_DVFS1_CLK_PD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301904#define PALMAS_PU_PD_INPUT_CTRL4_DVFS1_CLK_PD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001905
1906/* Bit definitions for PRIMARY_SECONDARY_PAD3 */
1907#define PALMAS_PRIMARY_SECONDARY_PAD3_DVFS2 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301908#define PALMAS_PRIMARY_SECONDARY_PAD3_DVFS2_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001909#define PALMAS_PRIMARY_SECONDARY_PAD3_DVFS1 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301910#define PALMAS_PRIMARY_SECONDARY_PAD3_DVFS1_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001911
1912/* Registers for function LED_PWM */
Keerthy45ac60c2014-05-22 14:48:30 +05301913#define PALMAS_LED_PERIOD_CTRL 0x00
1914#define PALMAS_LED_CTRL 0x01
1915#define PALMAS_PWM_CTRL1 0x02
1916#define PALMAS_PWM_CTRL2 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001917
1918/* Bit definitions for LED_PERIOD_CTRL */
1919#define PALMAS_LED_PERIOD_CTRL_LED_2_PERIOD_MASK 0x38
Keerthy45ac60c2014-05-22 14:48:30 +05301920#define PALMAS_LED_PERIOD_CTRL_LED_2_PERIOD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001921#define PALMAS_LED_PERIOD_CTRL_LED_1_PERIOD_MASK 0x07
Keerthy45ac60c2014-05-22 14:48:30 +05301922#define PALMAS_LED_PERIOD_CTRL_LED_1_PERIOD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001923
1924/* Bit definitions for LED_CTRL */
1925#define PALMAS_LED_CTRL_LED_2_SEQ 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301926#define PALMAS_LED_CTRL_LED_2_SEQ_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001927#define PALMAS_LED_CTRL_LED_1_SEQ 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301928#define PALMAS_LED_CTRL_LED_1_SEQ_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001929#define PALMAS_LED_CTRL_LED_2_ON_TIME_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05301930#define PALMAS_LED_CTRL_LED_2_ON_TIME_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001931#define PALMAS_LED_CTRL_LED_1_ON_TIME_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +05301932#define PALMAS_LED_CTRL_LED_1_ON_TIME_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001933
1934/* Bit definitions for PWM_CTRL1 */
1935#define PALMAS_PWM_CTRL1_PWM_FREQ_EN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301936#define PALMAS_PWM_CTRL1_PWM_FREQ_EN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001937#define PALMAS_PWM_CTRL1_PWM_FREQ_SEL 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301938#define PALMAS_PWM_CTRL1_PWM_FREQ_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001939
1940/* Bit definitions for PWM_CTRL2 */
Keerthy45ac60c2014-05-22 14:48:30 +05301941#define PALMAS_PWM_CTRL2_PWM_DUTY_SEL_MASK 0xFF
1942#define PALMAS_PWM_CTRL2_PWM_DUTY_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001943
1944/* Registers for function INTERRUPT */
Keerthy45ac60c2014-05-22 14:48:30 +05301945#define PALMAS_INT1_STATUS 0x00
1946#define PALMAS_INT1_MASK 0x01
1947#define PALMAS_INT1_LINE_STATE 0x02
1948#define PALMAS_INT1_EDGE_DETECT1_RESERVED 0x03
1949#define PALMAS_INT1_EDGE_DETECT2_RESERVED 0x04
1950#define PALMAS_INT2_STATUS 0x05
1951#define PALMAS_INT2_MASK 0x06
1952#define PALMAS_INT2_LINE_STATE 0x07
1953#define PALMAS_INT2_EDGE_DETECT1_RESERVED 0x08
1954#define PALMAS_INT2_EDGE_DETECT2_RESERVED 0x09
1955#define PALMAS_INT3_STATUS 0x0A
1956#define PALMAS_INT3_MASK 0x0B
1957#define PALMAS_INT3_LINE_STATE 0x0C
1958#define PALMAS_INT3_EDGE_DETECT1_RESERVED 0x0D
1959#define PALMAS_INT3_EDGE_DETECT2_RESERVED 0x0E
1960#define PALMAS_INT4_STATUS 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001961#define PALMAS_INT4_MASK 0x10
1962#define PALMAS_INT4_LINE_STATE 0x11
1963#define PALMAS_INT4_EDGE_DETECT1 0x12
1964#define PALMAS_INT4_EDGE_DETECT2 0x13
1965#define PALMAS_INT_CTRL 0x14
1966
1967/* Bit definitions for INT1_STATUS */
1968#define PALMAS_INT1_STATUS_VBAT_MON 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301969#define PALMAS_INT1_STATUS_VBAT_MON_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001970#define PALMAS_INT1_STATUS_VSYS_MON 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301971#define PALMAS_INT1_STATUS_VSYS_MON_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001972#define PALMAS_INT1_STATUS_HOTDIE 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301973#define PALMAS_INT1_STATUS_HOTDIE_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001974#define PALMAS_INT1_STATUS_PWRDOWN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301975#define PALMAS_INT1_STATUS_PWRDOWN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001976#define PALMAS_INT1_STATUS_RPWRON 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301977#define PALMAS_INT1_STATUS_RPWRON_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001978#define PALMAS_INT1_STATUS_LONG_PRESS_KEY 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301979#define PALMAS_INT1_STATUS_LONG_PRESS_KEY_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001980#define PALMAS_INT1_STATUS_PWRON 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301981#define PALMAS_INT1_STATUS_PWRON_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001982#define PALMAS_INT1_STATUS_CHARG_DET_N_VBUS_OVV 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05301983#define PALMAS_INT1_STATUS_CHARG_DET_N_VBUS_OVV_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001984
1985/* Bit definitions for INT1_MASK */
1986#define PALMAS_INT1_MASK_VBAT_MON 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05301987#define PALMAS_INT1_MASK_VBAT_MON_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001988#define PALMAS_INT1_MASK_VSYS_MON 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05301989#define PALMAS_INT1_MASK_VSYS_MON_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001990#define PALMAS_INT1_MASK_HOTDIE 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05301991#define PALMAS_INT1_MASK_HOTDIE_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001992#define PALMAS_INT1_MASK_PWRDOWN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05301993#define PALMAS_INT1_MASK_PWRDOWN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001994#define PALMAS_INT1_MASK_RPWRON 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05301995#define PALMAS_INT1_MASK_RPWRON_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001996#define PALMAS_INT1_MASK_LONG_PRESS_KEY 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05301997#define PALMAS_INT1_MASK_LONG_PRESS_KEY_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09001998#define PALMAS_INT1_MASK_PWRON 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05301999#define PALMAS_INT1_MASK_PWRON_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002000#define PALMAS_INT1_MASK_CHARG_DET_N_VBUS_OVV 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302001#define PALMAS_INT1_MASK_CHARG_DET_N_VBUS_OVV_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002002
2003/* Bit definitions for INT1_LINE_STATE */
2004#define PALMAS_INT1_LINE_STATE_VBAT_MON 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302005#define PALMAS_INT1_LINE_STATE_VBAT_MON_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002006#define PALMAS_INT1_LINE_STATE_VSYS_MON 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302007#define PALMAS_INT1_LINE_STATE_VSYS_MON_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002008#define PALMAS_INT1_LINE_STATE_HOTDIE 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302009#define PALMAS_INT1_LINE_STATE_HOTDIE_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002010#define PALMAS_INT1_LINE_STATE_PWRDOWN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302011#define PALMAS_INT1_LINE_STATE_PWRDOWN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002012#define PALMAS_INT1_LINE_STATE_RPWRON 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302013#define PALMAS_INT1_LINE_STATE_RPWRON_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002014#define PALMAS_INT1_LINE_STATE_LONG_PRESS_KEY 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302015#define PALMAS_INT1_LINE_STATE_LONG_PRESS_KEY_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002016#define PALMAS_INT1_LINE_STATE_PWRON 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302017#define PALMAS_INT1_LINE_STATE_PWRON_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002018#define PALMAS_INT1_LINE_STATE_CHARG_DET_N_VBUS_OVV 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302019#define PALMAS_INT1_LINE_STATE_CHARG_DET_N_VBUS_OVV_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002020
2021/* Bit definitions for INT2_STATUS */
2022#define PALMAS_INT2_STATUS_VAC_ACOK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302023#define PALMAS_INT2_STATUS_VAC_ACOK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002024#define PALMAS_INT2_STATUS_SHORT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302025#define PALMAS_INT2_STATUS_SHORT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002026#define PALMAS_INT2_STATUS_FBI_BB 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302027#define PALMAS_INT2_STATUS_FBI_BB_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002028#define PALMAS_INT2_STATUS_RESET_IN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302029#define PALMAS_INT2_STATUS_RESET_IN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002030#define PALMAS_INT2_STATUS_BATREMOVAL 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302031#define PALMAS_INT2_STATUS_BATREMOVAL_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002032#define PALMAS_INT2_STATUS_WDT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302033#define PALMAS_INT2_STATUS_WDT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002034#define PALMAS_INT2_STATUS_RTC_TIMER 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302035#define PALMAS_INT2_STATUS_RTC_TIMER_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002036#define PALMAS_INT2_STATUS_RTC_ALARM 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302037#define PALMAS_INT2_STATUS_RTC_ALARM_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002038
2039/* Bit definitions for INT2_MASK */
2040#define PALMAS_INT2_MASK_VAC_ACOK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302041#define PALMAS_INT2_MASK_VAC_ACOK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002042#define PALMAS_INT2_MASK_SHORT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302043#define PALMAS_INT2_MASK_SHORT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002044#define PALMAS_INT2_MASK_FBI_BB 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302045#define PALMAS_INT2_MASK_FBI_BB_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002046#define PALMAS_INT2_MASK_RESET_IN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302047#define PALMAS_INT2_MASK_RESET_IN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002048#define PALMAS_INT2_MASK_BATREMOVAL 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302049#define PALMAS_INT2_MASK_BATREMOVAL_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002050#define PALMAS_INT2_MASK_WDT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302051#define PALMAS_INT2_MASK_WDT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002052#define PALMAS_INT2_MASK_RTC_TIMER 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302053#define PALMAS_INT2_MASK_RTC_TIMER_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002054#define PALMAS_INT2_MASK_RTC_ALARM 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302055#define PALMAS_INT2_MASK_RTC_ALARM_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002056
2057/* Bit definitions for INT2_LINE_STATE */
2058#define PALMAS_INT2_LINE_STATE_VAC_ACOK 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302059#define PALMAS_INT2_LINE_STATE_VAC_ACOK_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002060#define PALMAS_INT2_LINE_STATE_SHORT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302061#define PALMAS_INT2_LINE_STATE_SHORT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002062#define PALMAS_INT2_LINE_STATE_FBI_BB 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302063#define PALMAS_INT2_LINE_STATE_FBI_BB_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002064#define PALMAS_INT2_LINE_STATE_RESET_IN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302065#define PALMAS_INT2_LINE_STATE_RESET_IN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002066#define PALMAS_INT2_LINE_STATE_BATREMOVAL 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302067#define PALMAS_INT2_LINE_STATE_BATREMOVAL_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002068#define PALMAS_INT2_LINE_STATE_WDT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302069#define PALMAS_INT2_LINE_STATE_WDT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002070#define PALMAS_INT2_LINE_STATE_RTC_TIMER 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302071#define PALMAS_INT2_LINE_STATE_RTC_TIMER_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002072#define PALMAS_INT2_LINE_STATE_RTC_ALARM 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302073#define PALMAS_INT2_LINE_STATE_RTC_ALARM_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002074
2075/* Bit definitions for INT3_STATUS */
2076#define PALMAS_INT3_STATUS_VBUS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302077#define PALMAS_INT3_STATUS_VBUS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002078#define PALMAS_INT3_STATUS_VBUS_OTG 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302079#define PALMAS_INT3_STATUS_VBUS_OTG_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002080#define PALMAS_INT3_STATUS_ID 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302081#define PALMAS_INT3_STATUS_ID_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002082#define PALMAS_INT3_STATUS_ID_OTG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302083#define PALMAS_INT3_STATUS_ID_OTG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002084#define PALMAS_INT3_STATUS_GPADC_EOC_RT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302085#define PALMAS_INT3_STATUS_GPADC_EOC_RT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002086#define PALMAS_INT3_STATUS_GPADC_EOC_SW 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302087#define PALMAS_INT3_STATUS_GPADC_EOC_SW_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002088#define PALMAS_INT3_STATUS_GPADC_AUTO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302089#define PALMAS_INT3_STATUS_GPADC_AUTO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002090#define PALMAS_INT3_STATUS_GPADC_AUTO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302091#define PALMAS_INT3_STATUS_GPADC_AUTO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002092
2093/* Bit definitions for INT3_MASK */
2094#define PALMAS_INT3_MASK_VBUS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302095#define PALMAS_INT3_MASK_VBUS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002096#define PALMAS_INT3_MASK_VBUS_OTG 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302097#define PALMAS_INT3_MASK_VBUS_OTG_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002098#define PALMAS_INT3_MASK_ID 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302099#define PALMAS_INT3_MASK_ID_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002100#define PALMAS_INT3_MASK_ID_OTG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302101#define PALMAS_INT3_MASK_ID_OTG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002102#define PALMAS_INT3_MASK_GPADC_EOC_RT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302103#define PALMAS_INT3_MASK_GPADC_EOC_RT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002104#define PALMAS_INT3_MASK_GPADC_EOC_SW 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302105#define PALMAS_INT3_MASK_GPADC_EOC_SW_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002106#define PALMAS_INT3_MASK_GPADC_AUTO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302107#define PALMAS_INT3_MASK_GPADC_AUTO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002108#define PALMAS_INT3_MASK_GPADC_AUTO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302109#define PALMAS_INT3_MASK_GPADC_AUTO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002110
2111/* Bit definitions for INT3_LINE_STATE */
2112#define PALMAS_INT3_LINE_STATE_VBUS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302113#define PALMAS_INT3_LINE_STATE_VBUS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002114#define PALMAS_INT3_LINE_STATE_VBUS_OTG 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302115#define PALMAS_INT3_LINE_STATE_VBUS_OTG_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002116#define PALMAS_INT3_LINE_STATE_ID 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302117#define PALMAS_INT3_LINE_STATE_ID_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002118#define PALMAS_INT3_LINE_STATE_ID_OTG 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302119#define PALMAS_INT3_LINE_STATE_ID_OTG_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002120#define PALMAS_INT3_LINE_STATE_GPADC_EOC_RT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302121#define PALMAS_INT3_LINE_STATE_GPADC_EOC_RT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002122#define PALMAS_INT3_LINE_STATE_GPADC_EOC_SW 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302123#define PALMAS_INT3_LINE_STATE_GPADC_EOC_SW_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002124#define PALMAS_INT3_LINE_STATE_GPADC_AUTO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302125#define PALMAS_INT3_LINE_STATE_GPADC_AUTO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002126#define PALMAS_INT3_LINE_STATE_GPADC_AUTO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302127#define PALMAS_INT3_LINE_STATE_GPADC_AUTO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002128
2129/* Bit definitions for INT4_STATUS */
2130#define PALMAS_INT4_STATUS_GPIO_7 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302131#define PALMAS_INT4_STATUS_GPIO_7_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002132#define PALMAS_INT4_STATUS_GPIO_6 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302133#define PALMAS_INT4_STATUS_GPIO_6_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002134#define PALMAS_INT4_STATUS_GPIO_5 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302135#define PALMAS_INT4_STATUS_GPIO_5_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002136#define PALMAS_INT4_STATUS_GPIO_4 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302137#define PALMAS_INT4_STATUS_GPIO_4_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002138#define PALMAS_INT4_STATUS_GPIO_3 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302139#define PALMAS_INT4_STATUS_GPIO_3_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002140#define PALMAS_INT4_STATUS_GPIO_2 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302141#define PALMAS_INT4_STATUS_GPIO_2_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002142#define PALMAS_INT4_STATUS_GPIO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302143#define PALMAS_INT4_STATUS_GPIO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002144#define PALMAS_INT4_STATUS_GPIO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302145#define PALMAS_INT4_STATUS_GPIO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002146
2147/* Bit definitions for INT4_MASK */
2148#define PALMAS_INT4_MASK_GPIO_7 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302149#define PALMAS_INT4_MASK_GPIO_7_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002150#define PALMAS_INT4_MASK_GPIO_6 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302151#define PALMAS_INT4_MASK_GPIO_6_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002152#define PALMAS_INT4_MASK_GPIO_5 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302153#define PALMAS_INT4_MASK_GPIO_5_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002154#define PALMAS_INT4_MASK_GPIO_4 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302155#define PALMAS_INT4_MASK_GPIO_4_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002156#define PALMAS_INT4_MASK_GPIO_3 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302157#define PALMAS_INT4_MASK_GPIO_3_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002158#define PALMAS_INT4_MASK_GPIO_2 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302159#define PALMAS_INT4_MASK_GPIO_2_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002160#define PALMAS_INT4_MASK_GPIO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302161#define PALMAS_INT4_MASK_GPIO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002162#define PALMAS_INT4_MASK_GPIO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302163#define PALMAS_INT4_MASK_GPIO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002164
2165/* Bit definitions for INT4_LINE_STATE */
2166#define PALMAS_INT4_LINE_STATE_GPIO_7 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302167#define PALMAS_INT4_LINE_STATE_GPIO_7_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002168#define PALMAS_INT4_LINE_STATE_GPIO_6 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302169#define PALMAS_INT4_LINE_STATE_GPIO_6_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002170#define PALMAS_INT4_LINE_STATE_GPIO_5 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302171#define PALMAS_INT4_LINE_STATE_GPIO_5_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002172#define PALMAS_INT4_LINE_STATE_GPIO_4 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302173#define PALMAS_INT4_LINE_STATE_GPIO_4_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002174#define PALMAS_INT4_LINE_STATE_GPIO_3 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302175#define PALMAS_INT4_LINE_STATE_GPIO_3_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002176#define PALMAS_INT4_LINE_STATE_GPIO_2 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302177#define PALMAS_INT4_LINE_STATE_GPIO_2_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002178#define PALMAS_INT4_LINE_STATE_GPIO_1 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302179#define PALMAS_INT4_LINE_STATE_GPIO_1_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002180#define PALMAS_INT4_LINE_STATE_GPIO_0 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302181#define PALMAS_INT4_LINE_STATE_GPIO_0_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002182
2183/* Bit definitions for INT4_EDGE_DETECT1 */
2184#define PALMAS_INT4_EDGE_DETECT1_GPIO_3_RISING 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302185#define PALMAS_INT4_EDGE_DETECT1_GPIO_3_RISING_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002186#define PALMAS_INT4_EDGE_DETECT1_GPIO_3_FALLING 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302187#define PALMAS_INT4_EDGE_DETECT1_GPIO_3_FALLING_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002188#define PALMAS_INT4_EDGE_DETECT1_GPIO_2_RISING 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302189#define PALMAS_INT4_EDGE_DETECT1_GPIO_2_RISING_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002190#define PALMAS_INT4_EDGE_DETECT1_GPIO_2_FALLING 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302191#define PALMAS_INT4_EDGE_DETECT1_GPIO_2_FALLING_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002192#define PALMAS_INT4_EDGE_DETECT1_GPIO_1_RISING 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302193#define PALMAS_INT4_EDGE_DETECT1_GPIO_1_RISING_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002194#define PALMAS_INT4_EDGE_DETECT1_GPIO_1_FALLING 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302195#define PALMAS_INT4_EDGE_DETECT1_GPIO_1_FALLING_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002196#define PALMAS_INT4_EDGE_DETECT1_GPIO_0_RISING 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302197#define PALMAS_INT4_EDGE_DETECT1_GPIO_0_RISING_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002198#define PALMAS_INT4_EDGE_DETECT1_GPIO_0_FALLING 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302199#define PALMAS_INT4_EDGE_DETECT1_GPIO_0_FALLING_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002200
2201/* Bit definitions for INT4_EDGE_DETECT2 */
2202#define PALMAS_INT4_EDGE_DETECT2_GPIO_7_RISING 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302203#define PALMAS_INT4_EDGE_DETECT2_GPIO_7_RISING_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002204#define PALMAS_INT4_EDGE_DETECT2_GPIO_7_FALLING 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302205#define PALMAS_INT4_EDGE_DETECT2_GPIO_7_FALLING_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002206#define PALMAS_INT4_EDGE_DETECT2_GPIO_6_RISING 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302207#define PALMAS_INT4_EDGE_DETECT2_GPIO_6_RISING_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002208#define PALMAS_INT4_EDGE_DETECT2_GPIO_6_FALLING 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302209#define PALMAS_INT4_EDGE_DETECT2_GPIO_6_FALLING_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002210#define PALMAS_INT4_EDGE_DETECT2_GPIO_5_RISING 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302211#define PALMAS_INT4_EDGE_DETECT2_GPIO_5_RISING_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002212#define PALMAS_INT4_EDGE_DETECT2_GPIO_5_FALLING 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302213#define PALMAS_INT4_EDGE_DETECT2_GPIO_5_FALLING_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002214#define PALMAS_INT4_EDGE_DETECT2_GPIO_4_RISING 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302215#define PALMAS_INT4_EDGE_DETECT2_GPIO_4_RISING_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002216#define PALMAS_INT4_EDGE_DETECT2_GPIO_4_FALLING 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302217#define PALMAS_INT4_EDGE_DETECT2_GPIO_4_FALLING_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002218
2219/* Bit definitions for INT_CTRL */
2220#define PALMAS_INT_CTRL_INT_PENDING 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302221#define PALMAS_INT_CTRL_INT_PENDING_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002222#define PALMAS_INT_CTRL_INT_CLEAR 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302223#define PALMAS_INT_CTRL_INT_CLEAR_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002224
2225/* Registers for function USB_OTG */
Keerthy45ac60c2014-05-22 14:48:30 +05302226#define PALMAS_USB_WAKEUP 0x03
2227#define PALMAS_USB_VBUS_CTRL_SET 0x04
2228#define PALMAS_USB_VBUS_CTRL_CLR 0x05
2229#define PALMAS_USB_ID_CTRL_SET 0x06
2230#define PALMAS_USB_ID_CTRL_CLEAR 0x07
2231#define PALMAS_USB_VBUS_INT_SRC 0x08
2232#define PALMAS_USB_VBUS_INT_LATCH_SET 0x09
2233#define PALMAS_USB_VBUS_INT_LATCH_CLR 0x0A
2234#define PALMAS_USB_VBUS_INT_EN_LO_SET 0x0B
2235#define PALMAS_USB_VBUS_INT_EN_LO_CLR 0x0C
2236#define PALMAS_USB_VBUS_INT_EN_HI_SET 0x0D
2237#define PALMAS_USB_VBUS_INT_EN_HI_CLR 0x0E
2238#define PALMAS_USB_ID_INT_SRC 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002239#define PALMAS_USB_ID_INT_LATCH_SET 0x10
2240#define PALMAS_USB_ID_INT_LATCH_CLR 0x11
2241#define PALMAS_USB_ID_INT_EN_LO_SET 0x12
2242#define PALMAS_USB_ID_INT_EN_LO_CLR 0x13
2243#define PALMAS_USB_ID_INT_EN_HI_SET 0x14
2244#define PALMAS_USB_ID_INT_EN_HI_CLR 0x15
2245#define PALMAS_USB_OTG_ADP_CTRL 0x16
2246#define PALMAS_USB_OTG_ADP_HIGH 0x17
2247#define PALMAS_USB_OTG_ADP_LOW 0x18
2248#define PALMAS_USB_OTG_ADP_RISE 0x19
2249#define PALMAS_USB_OTG_REVISION 0x1A
2250
2251/* Bit definitions for USB_WAKEUP */
2252#define PALMAS_USB_WAKEUP_ID_WK_UP_COMP 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302253#define PALMAS_USB_WAKEUP_ID_WK_UP_COMP_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002254
2255/* Bit definitions for USB_VBUS_CTRL_SET */
2256#define PALMAS_USB_VBUS_CTRL_SET_VBUS_CHRG_VSYS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302257#define PALMAS_USB_VBUS_CTRL_SET_VBUS_CHRG_VSYS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002258#define PALMAS_USB_VBUS_CTRL_SET_VBUS_DISCHRG 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302259#define PALMAS_USB_VBUS_CTRL_SET_VBUS_DISCHRG_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002260#define PALMAS_USB_VBUS_CTRL_SET_VBUS_IADP_SRC 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302261#define PALMAS_USB_VBUS_CTRL_SET_VBUS_IADP_SRC_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002262#define PALMAS_USB_VBUS_CTRL_SET_VBUS_IADP_SINK 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302263#define PALMAS_USB_VBUS_CTRL_SET_VBUS_IADP_SINK_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002264#define PALMAS_USB_VBUS_CTRL_SET_VBUS_ACT_COMP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302265#define PALMAS_USB_VBUS_CTRL_SET_VBUS_ACT_COMP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002266
2267/* Bit definitions for USB_VBUS_CTRL_CLR */
2268#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_CHRG_VSYS 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302269#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_CHRG_VSYS_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002270#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_DISCHRG 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302271#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_DISCHRG_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002272#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_IADP_SRC 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302273#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_IADP_SRC_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002274#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_IADP_SINK 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302275#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_IADP_SINK_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002276#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_ACT_COMP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302277#define PALMAS_USB_VBUS_CTRL_CLR_VBUS_ACT_COMP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002278
2279/* Bit definitions for USB_ID_CTRL_SET */
2280#define PALMAS_USB_ID_CTRL_SET_ID_PU_220K 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302281#define PALMAS_USB_ID_CTRL_SET_ID_PU_220K_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002282#define PALMAS_USB_ID_CTRL_SET_ID_PU_100K 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302283#define PALMAS_USB_ID_CTRL_SET_ID_PU_100K_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002284#define PALMAS_USB_ID_CTRL_SET_ID_GND_DRV 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302285#define PALMAS_USB_ID_CTRL_SET_ID_GND_DRV_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002286#define PALMAS_USB_ID_CTRL_SET_ID_SRC_16U 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302287#define PALMAS_USB_ID_CTRL_SET_ID_SRC_16U_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002288#define PALMAS_USB_ID_CTRL_SET_ID_SRC_5U 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302289#define PALMAS_USB_ID_CTRL_SET_ID_SRC_5U_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002290#define PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302291#define PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002292
2293/* Bit definitions for USB_ID_CTRL_CLEAR */
2294#define PALMAS_USB_ID_CTRL_CLEAR_ID_PU_220K 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302295#define PALMAS_USB_ID_CTRL_CLEAR_ID_PU_220K_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002296#define PALMAS_USB_ID_CTRL_CLEAR_ID_PU_100K 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302297#define PALMAS_USB_ID_CTRL_CLEAR_ID_PU_100K_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002298#define PALMAS_USB_ID_CTRL_CLEAR_ID_GND_DRV 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302299#define PALMAS_USB_ID_CTRL_CLEAR_ID_GND_DRV_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002300#define PALMAS_USB_ID_CTRL_CLEAR_ID_SRC_16U 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302301#define PALMAS_USB_ID_CTRL_CLEAR_ID_SRC_16U_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002302#define PALMAS_USB_ID_CTRL_CLEAR_ID_SRC_5U 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302303#define PALMAS_USB_ID_CTRL_CLEAR_ID_SRC_5U_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002304#define PALMAS_USB_ID_CTRL_CLEAR_ID_ACT_COMP 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302305#define PALMAS_USB_ID_CTRL_CLEAR_ID_ACT_COMP_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002306
2307/* Bit definitions for USB_VBUS_INT_SRC */
2308#define PALMAS_USB_VBUS_INT_SRC_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302309#define PALMAS_USB_VBUS_INT_SRC_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002310#define PALMAS_USB_VBUS_INT_SRC_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302311#define PALMAS_USB_VBUS_INT_SRC_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002312#define PALMAS_USB_VBUS_INT_SRC_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302313#define PALMAS_USB_VBUS_INT_SRC_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002314#define PALMAS_USB_VBUS_INT_SRC_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302315#define PALMAS_USB_VBUS_INT_SRC_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002316#define PALMAS_USB_VBUS_INT_SRC_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302317#define PALMAS_USB_VBUS_INT_SRC_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002318#define PALMAS_USB_VBUS_INT_SRC_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302319#define PALMAS_USB_VBUS_INT_SRC_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002320#define PALMAS_USB_VBUS_INT_SRC_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302321#define PALMAS_USB_VBUS_INT_SRC_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002322
2323/* Bit definitions for USB_VBUS_INT_LATCH_SET */
2324#define PALMAS_USB_VBUS_INT_LATCH_SET_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302325#define PALMAS_USB_VBUS_INT_LATCH_SET_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002326#define PALMAS_USB_VBUS_INT_LATCH_SET_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302327#define PALMAS_USB_VBUS_INT_LATCH_SET_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002328#define PALMAS_USB_VBUS_INT_LATCH_SET_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302329#define PALMAS_USB_VBUS_INT_LATCH_SET_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002330#define PALMAS_USB_VBUS_INT_LATCH_SET_ADP 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302331#define PALMAS_USB_VBUS_INT_LATCH_SET_ADP_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002332#define PALMAS_USB_VBUS_INT_LATCH_SET_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302333#define PALMAS_USB_VBUS_INT_LATCH_SET_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002334#define PALMAS_USB_VBUS_INT_LATCH_SET_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302335#define PALMAS_USB_VBUS_INT_LATCH_SET_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002336#define PALMAS_USB_VBUS_INT_LATCH_SET_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302337#define PALMAS_USB_VBUS_INT_LATCH_SET_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002338#define PALMAS_USB_VBUS_INT_LATCH_SET_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302339#define PALMAS_USB_VBUS_INT_LATCH_SET_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002340
2341/* Bit definitions for USB_VBUS_INT_LATCH_CLR */
2342#define PALMAS_USB_VBUS_INT_LATCH_CLR_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302343#define PALMAS_USB_VBUS_INT_LATCH_CLR_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002344#define PALMAS_USB_VBUS_INT_LATCH_CLR_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302345#define PALMAS_USB_VBUS_INT_LATCH_CLR_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002346#define PALMAS_USB_VBUS_INT_LATCH_CLR_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302347#define PALMAS_USB_VBUS_INT_LATCH_CLR_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002348#define PALMAS_USB_VBUS_INT_LATCH_CLR_ADP 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302349#define PALMAS_USB_VBUS_INT_LATCH_CLR_ADP_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002350#define PALMAS_USB_VBUS_INT_LATCH_CLR_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302351#define PALMAS_USB_VBUS_INT_LATCH_CLR_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002352#define PALMAS_USB_VBUS_INT_LATCH_CLR_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302353#define PALMAS_USB_VBUS_INT_LATCH_CLR_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002354#define PALMAS_USB_VBUS_INT_LATCH_CLR_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302355#define PALMAS_USB_VBUS_INT_LATCH_CLR_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002356#define PALMAS_USB_VBUS_INT_LATCH_CLR_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302357#define PALMAS_USB_VBUS_INT_LATCH_CLR_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002358
2359/* Bit definitions for USB_VBUS_INT_EN_LO_SET */
2360#define PALMAS_USB_VBUS_INT_EN_LO_SET_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302361#define PALMAS_USB_VBUS_INT_EN_LO_SET_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002362#define PALMAS_USB_VBUS_INT_EN_LO_SET_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302363#define PALMAS_USB_VBUS_INT_EN_LO_SET_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002364#define PALMAS_USB_VBUS_INT_EN_LO_SET_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302365#define PALMAS_USB_VBUS_INT_EN_LO_SET_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002366#define PALMAS_USB_VBUS_INT_EN_LO_SET_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302367#define PALMAS_USB_VBUS_INT_EN_LO_SET_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002368#define PALMAS_USB_VBUS_INT_EN_LO_SET_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302369#define PALMAS_USB_VBUS_INT_EN_LO_SET_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002370#define PALMAS_USB_VBUS_INT_EN_LO_SET_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302371#define PALMAS_USB_VBUS_INT_EN_LO_SET_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002372#define PALMAS_USB_VBUS_INT_EN_LO_SET_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302373#define PALMAS_USB_VBUS_INT_EN_LO_SET_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002374
2375/* Bit definitions for USB_VBUS_INT_EN_LO_CLR */
2376#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302377#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002378#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302379#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002380#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302381#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002382#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302383#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002384#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302385#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002386#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302387#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002388#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302389#define PALMAS_USB_VBUS_INT_EN_LO_CLR_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002390
2391/* Bit definitions for USB_VBUS_INT_EN_HI_SET */
2392#define PALMAS_USB_VBUS_INT_EN_HI_SET_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302393#define PALMAS_USB_VBUS_INT_EN_HI_SET_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002394#define PALMAS_USB_VBUS_INT_EN_HI_SET_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302395#define PALMAS_USB_VBUS_INT_EN_HI_SET_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002396#define PALMAS_USB_VBUS_INT_EN_HI_SET_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302397#define PALMAS_USB_VBUS_INT_EN_HI_SET_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002398#define PALMAS_USB_VBUS_INT_EN_HI_SET_ADP 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302399#define PALMAS_USB_VBUS_INT_EN_HI_SET_ADP_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002400#define PALMAS_USB_VBUS_INT_EN_HI_SET_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302401#define PALMAS_USB_VBUS_INT_EN_HI_SET_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002402#define PALMAS_USB_VBUS_INT_EN_HI_SET_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302403#define PALMAS_USB_VBUS_INT_EN_HI_SET_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002404#define PALMAS_USB_VBUS_INT_EN_HI_SET_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302405#define PALMAS_USB_VBUS_INT_EN_HI_SET_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002406#define PALMAS_USB_VBUS_INT_EN_HI_SET_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302407#define PALMAS_USB_VBUS_INT_EN_HI_SET_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002408
2409/* Bit definitions for USB_VBUS_INT_EN_HI_CLR */
2410#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VOTG_SESS_VLD 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302411#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VOTG_SESS_VLD_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002412#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VADP_PRB 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302413#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VADP_PRB_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002414#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VADP_SNS 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302415#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VADP_SNS_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002416#define PALMAS_USB_VBUS_INT_EN_HI_CLR_ADP 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302417#define PALMAS_USB_VBUS_INT_EN_HI_CLR_ADP_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002418#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VA_VBUS_VLD 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302419#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VA_VBUS_VLD_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002420#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VA_SESS_VLD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302421#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VA_SESS_VLD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002422#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VB_SESS_VLD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302423#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VB_SESS_VLD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002424#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VB_SESS_END 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302425#define PALMAS_USB_VBUS_INT_EN_HI_CLR_VB_SESS_END_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002426
2427/* Bit definitions for USB_ID_INT_SRC */
2428#define PALMAS_USB_ID_INT_SRC_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302429#define PALMAS_USB_ID_INT_SRC_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002430#define PALMAS_USB_ID_INT_SRC_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302431#define PALMAS_USB_ID_INT_SRC_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002432#define PALMAS_USB_ID_INT_SRC_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302433#define PALMAS_USB_ID_INT_SRC_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002434#define PALMAS_USB_ID_INT_SRC_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302435#define PALMAS_USB_ID_INT_SRC_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002436#define PALMAS_USB_ID_INT_SRC_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302437#define PALMAS_USB_ID_INT_SRC_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002438
2439/* Bit definitions for USB_ID_INT_LATCH_SET */
2440#define PALMAS_USB_ID_INT_LATCH_SET_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302441#define PALMAS_USB_ID_INT_LATCH_SET_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002442#define PALMAS_USB_ID_INT_LATCH_SET_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302443#define PALMAS_USB_ID_INT_LATCH_SET_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002444#define PALMAS_USB_ID_INT_LATCH_SET_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302445#define PALMAS_USB_ID_INT_LATCH_SET_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002446#define PALMAS_USB_ID_INT_LATCH_SET_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302447#define PALMAS_USB_ID_INT_LATCH_SET_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002448#define PALMAS_USB_ID_INT_LATCH_SET_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302449#define PALMAS_USB_ID_INT_LATCH_SET_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002450
2451/* Bit definitions for USB_ID_INT_LATCH_CLR */
2452#define PALMAS_USB_ID_INT_LATCH_CLR_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302453#define PALMAS_USB_ID_INT_LATCH_CLR_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002454#define PALMAS_USB_ID_INT_LATCH_CLR_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302455#define PALMAS_USB_ID_INT_LATCH_CLR_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002456#define PALMAS_USB_ID_INT_LATCH_CLR_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302457#define PALMAS_USB_ID_INT_LATCH_CLR_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002458#define PALMAS_USB_ID_INT_LATCH_CLR_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302459#define PALMAS_USB_ID_INT_LATCH_CLR_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002460#define PALMAS_USB_ID_INT_LATCH_CLR_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302461#define PALMAS_USB_ID_INT_LATCH_CLR_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002462
2463/* Bit definitions for USB_ID_INT_EN_LO_SET */
2464#define PALMAS_USB_ID_INT_EN_LO_SET_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302465#define PALMAS_USB_ID_INT_EN_LO_SET_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002466#define PALMAS_USB_ID_INT_EN_LO_SET_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302467#define PALMAS_USB_ID_INT_EN_LO_SET_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002468#define PALMAS_USB_ID_INT_EN_LO_SET_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302469#define PALMAS_USB_ID_INT_EN_LO_SET_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002470#define PALMAS_USB_ID_INT_EN_LO_SET_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302471#define PALMAS_USB_ID_INT_EN_LO_SET_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002472#define PALMAS_USB_ID_INT_EN_LO_SET_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302473#define PALMAS_USB_ID_INT_EN_LO_SET_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002474
2475/* Bit definitions for USB_ID_INT_EN_LO_CLR */
2476#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302477#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002478#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302479#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002480#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302481#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002482#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302483#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002484#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302485#define PALMAS_USB_ID_INT_EN_LO_CLR_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002486
2487/* Bit definitions for USB_ID_INT_EN_HI_SET */
2488#define PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302489#define PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002490#define PALMAS_USB_ID_INT_EN_HI_SET_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302491#define PALMAS_USB_ID_INT_EN_HI_SET_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002492#define PALMAS_USB_ID_INT_EN_HI_SET_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302493#define PALMAS_USB_ID_INT_EN_HI_SET_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002494#define PALMAS_USB_ID_INT_EN_HI_SET_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302495#define PALMAS_USB_ID_INT_EN_HI_SET_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002496#define PALMAS_USB_ID_INT_EN_HI_SET_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302497#define PALMAS_USB_ID_INT_EN_HI_SET_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002498
2499/* Bit definitions for USB_ID_INT_EN_HI_CLR */
2500#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_FLOAT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302501#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_FLOAT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002502#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_A 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302503#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_A_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002504#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_B 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302505#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_B_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002506#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_C 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302507#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_C_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002508#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_GND 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302509#define PALMAS_USB_ID_INT_EN_HI_CLR_ID_GND_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002510
2511/* Bit definitions for USB_OTG_ADP_CTRL */
2512#define PALMAS_USB_OTG_ADP_CTRL_ADP_EN 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302513#define PALMAS_USB_OTG_ADP_CTRL_ADP_EN_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002514#define PALMAS_USB_OTG_ADP_CTRL_ADP_MODE_MASK 0x03
Keerthy45ac60c2014-05-22 14:48:30 +05302515#define PALMAS_USB_OTG_ADP_CTRL_ADP_MODE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002516
2517/* Bit definitions for USB_OTG_ADP_HIGH */
Keerthy45ac60c2014-05-22 14:48:30 +05302518#define PALMAS_USB_OTG_ADP_HIGH_T_ADP_HIGH_MASK 0xFF
2519#define PALMAS_USB_OTG_ADP_HIGH_T_ADP_HIGH_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002520
2521/* Bit definitions for USB_OTG_ADP_LOW */
Keerthy45ac60c2014-05-22 14:48:30 +05302522#define PALMAS_USB_OTG_ADP_LOW_T_ADP_LOW_MASK 0xFF
2523#define PALMAS_USB_OTG_ADP_LOW_T_ADP_LOW_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002524
2525/* Bit definitions for USB_OTG_ADP_RISE */
Keerthy45ac60c2014-05-22 14:48:30 +05302526#define PALMAS_USB_OTG_ADP_RISE_T_ADP_RISE_MASK 0xFF
2527#define PALMAS_USB_OTG_ADP_RISE_T_ADP_RISE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002528
2529/* Bit definitions for USB_OTG_REVISION */
2530#define PALMAS_USB_OTG_REVISION_OTG_REV 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302531#define PALMAS_USB_OTG_REVISION_OTG_REV_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002532
2533/* Registers for function VIBRATOR */
Keerthy45ac60c2014-05-22 14:48:30 +05302534#define PALMAS_VIBRA_CTRL 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002535
2536/* Bit definitions for VIBRA_CTRL */
2537#define PALMAS_VIBRA_CTRL_PWM_DUTY_SEL_MASK 0x06
Keerthy45ac60c2014-05-22 14:48:30 +05302538#define PALMAS_VIBRA_CTRL_PWM_DUTY_SEL_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002539#define PALMAS_VIBRA_CTRL_PWM_FREQ_SEL 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302540#define PALMAS_VIBRA_CTRL_PWM_FREQ_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002541
2542/* Registers for function GPIO */
Keerthy45ac60c2014-05-22 14:48:30 +05302543#define PALMAS_GPIO_DATA_IN 0x00
2544#define PALMAS_GPIO_DATA_DIR 0x01
2545#define PALMAS_GPIO_DATA_OUT 0x02
2546#define PALMAS_GPIO_DEBOUNCE_EN 0x03
2547#define PALMAS_GPIO_CLEAR_DATA_OUT 0x04
2548#define PALMAS_GPIO_SET_DATA_OUT 0x05
2549#define PALMAS_PU_PD_GPIO_CTRL1 0x06
2550#define PALMAS_PU_PD_GPIO_CTRL2 0x07
2551#define PALMAS_OD_OUTPUT_GPIO_CTRL 0x08
2552#define PALMAS_GPIO_DATA_IN2 0x09
Laxman Dewangan0a8d3e22013-08-06 18:42:35 +05302553#define PALMAS_GPIO_DATA_DIR2 0x0A
2554#define PALMAS_GPIO_DATA_OUT2 0x0B
2555#define PALMAS_GPIO_DEBOUNCE_EN2 0x0C
2556#define PALMAS_GPIO_CLEAR_DATA_OUT2 0x0D
2557#define PALMAS_GPIO_SET_DATA_OUT2 0x0E
2558#define PALMAS_PU_PD_GPIO_CTRL3 0x0F
2559#define PALMAS_PU_PD_GPIO_CTRL4 0x10
2560#define PALMAS_OD_OUTPUT_GPIO_CTRL2 0x11
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002561
2562/* Bit definitions for GPIO_DATA_IN */
2563#define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302564#define PALMAS_GPIO_DATA_IN_GPIO_7_IN_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002565#define PALMAS_GPIO_DATA_IN_GPIO_6_IN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302566#define PALMAS_GPIO_DATA_IN_GPIO_6_IN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002567#define PALMAS_GPIO_DATA_IN_GPIO_5_IN 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302568#define PALMAS_GPIO_DATA_IN_GPIO_5_IN_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002569#define PALMAS_GPIO_DATA_IN_GPIO_4_IN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302570#define PALMAS_GPIO_DATA_IN_GPIO_4_IN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002571#define PALMAS_GPIO_DATA_IN_GPIO_3_IN 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302572#define PALMAS_GPIO_DATA_IN_GPIO_3_IN_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002573#define PALMAS_GPIO_DATA_IN_GPIO_2_IN 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302574#define PALMAS_GPIO_DATA_IN_GPIO_2_IN_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002575#define PALMAS_GPIO_DATA_IN_GPIO_1_IN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302576#define PALMAS_GPIO_DATA_IN_GPIO_1_IN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002577#define PALMAS_GPIO_DATA_IN_GPIO_0_IN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302578#define PALMAS_GPIO_DATA_IN_GPIO_0_IN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002579
2580/* Bit definitions for GPIO_DATA_DIR */
2581#define PALMAS_GPIO_DATA_DIR_GPIO_7_DIR 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302582#define PALMAS_GPIO_DATA_DIR_GPIO_7_DIR_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002583#define PALMAS_GPIO_DATA_DIR_GPIO_6_DIR 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302584#define PALMAS_GPIO_DATA_DIR_GPIO_6_DIR_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002585#define PALMAS_GPIO_DATA_DIR_GPIO_5_DIR 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302586#define PALMAS_GPIO_DATA_DIR_GPIO_5_DIR_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002587#define PALMAS_GPIO_DATA_DIR_GPIO_4_DIR 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302588#define PALMAS_GPIO_DATA_DIR_GPIO_4_DIR_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002589#define PALMAS_GPIO_DATA_DIR_GPIO_3_DIR 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302590#define PALMAS_GPIO_DATA_DIR_GPIO_3_DIR_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002591#define PALMAS_GPIO_DATA_DIR_GPIO_2_DIR 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302592#define PALMAS_GPIO_DATA_DIR_GPIO_2_DIR_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002593#define PALMAS_GPIO_DATA_DIR_GPIO_1_DIR 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302594#define PALMAS_GPIO_DATA_DIR_GPIO_1_DIR_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002595#define PALMAS_GPIO_DATA_DIR_GPIO_0_DIR 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302596#define PALMAS_GPIO_DATA_DIR_GPIO_0_DIR_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002597
2598/* Bit definitions for GPIO_DATA_OUT */
2599#define PALMAS_GPIO_DATA_OUT_GPIO_7_OUT 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302600#define PALMAS_GPIO_DATA_OUT_GPIO_7_OUT_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002601#define PALMAS_GPIO_DATA_OUT_GPIO_6_OUT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302602#define PALMAS_GPIO_DATA_OUT_GPIO_6_OUT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002603#define PALMAS_GPIO_DATA_OUT_GPIO_5_OUT 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302604#define PALMAS_GPIO_DATA_OUT_GPIO_5_OUT_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002605#define PALMAS_GPIO_DATA_OUT_GPIO_4_OUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302606#define PALMAS_GPIO_DATA_OUT_GPIO_4_OUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002607#define PALMAS_GPIO_DATA_OUT_GPIO_3_OUT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302608#define PALMAS_GPIO_DATA_OUT_GPIO_3_OUT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002609#define PALMAS_GPIO_DATA_OUT_GPIO_2_OUT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302610#define PALMAS_GPIO_DATA_OUT_GPIO_2_OUT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002611#define PALMAS_GPIO_DATA_OUT_GPIO_1_OUT 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302612#define PALMAS_GPIO_DATA_OUT_GPIO_1_OUT_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002613#define PALMAS_GPIO_DATA_OUT_GPIO_0_OUT 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302614#define PALMAS_GPIO_DATA_OUT_GPIO_0_OUT_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002615
2616/* Bit definitions for GPIO_DEBOUNCE_EN */
2617#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_7_DEBOUNCE_EN 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302618#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_7_DEBOUNCE_EN_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002619#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_6_DEBOUNCE_EN 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302620#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_6_DEBOUNCE_EN_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002621#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_5_DEBOUNCE_EN 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302622#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_5_DEBOUNCE_EN_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002623#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_4_DEBOUNCE_EN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302624#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_4_DEBOUNCE_EN_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002625#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_3_DEBOUNCE_EN 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302626#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_3_DEBOUNCE_EN_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002627#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_2_DEBOUNCE_EN 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302628#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_2_DEBOUNCE_EN_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002629#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_1_DEBOUNCE_EN 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302630#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_1_DEBOUNCE_EN_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002631#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_0_DEBOUNCE_EN 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302632#define PALMAS_GPIO_DEBOUNCE_EN_GPIO_0_DEBOUNCE_EN_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002633
2634/* Bit definitions for GPIO_CLEAR_DATA_OUT */
2635#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_7_CLEAR_DATA_OUT 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302636#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_7_CLEAR_DATA_OUT_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002637#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_6_CLEAR_DATA_OUT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302638#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_6_CLEAR_DATA_OUT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002639#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_5_CLEAR_DATA_OUT 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302640#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_5_CLEAR_DATA_OUT_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002641#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_4_CLEAR_DATA_OUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302642#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_4_CLEAR_DATA_OUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002643#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_3_CLEAR_DATA_OUT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302644#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_3_CLEAR_DATA_OUT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002645#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_2_CLEAR_DATA_OUT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302646#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_2_CLEAR_DATA_OUT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002647#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_1_CLEAR_DATA_OUT 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302648#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_1_CLEAR_DATA_OUT_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002649#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_0_CLEAR_DATA_OUT 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302650#define PALMAS_GPIO_CLEAR_DATA_OUT_GPIO_0_CLEAR_DATA_OUT_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002651
2652/* Bit definitions for GPIO_SET_DATA_OUT */
2653#define PALMAS_GPIO_SET_DATA_OUT_GPIO_7_SET_DATA_OUT 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302654#define PALMAS_GPIO_SET_DATA_OUT_GPIO_7_SET_DATA_OUT_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002655#define PALMAS_GPIO_SET_DATA_OUT_GPIO_6_SET_DATA_OUT 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302656#define PALMAS_GPIO_SET_DATA_OUT_GPIO_6_SET_DATA_OUT_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002657#define PALMAS_GPIO_SET_DATA_OUT_GPIO_5_SET_DATA_OUT 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302658#define PALMAS_GPIO_SET_DATA_OUT_GPIO_5_SET_DATA_OUT_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002659#define PALMAS_GPIO_SET_DATA_OUT_GPIO_4_SET_DATA_OUT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302660#define PALMAS_GPIO_SET_DATA_OUT_GPIO_4_SET_DATA_OUT_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002661#define PALMAS_GPIO_SET_DATA_OUT_GPIO_3_SET_DATA_OUT 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302662#define PALMAS_GPIO_SET_DATA_OUT_GPIO_3_SET_DATA_OUT_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002663#define PALMAS_GPIO_SET_DATA_OUT_GPIO_2_SET_DATA_OUT 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302664#define PALMAS_GPIO_SET_DATA_OUT_GPIO_2_SET_DATA_OUT_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002665#define PALMAS_GPIO_SET_DATA_OUT_GPIO_1_SET_DATA_OUT 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302666#define PALMAS_GPIO_SET_DATA_OUT_GPIO_1_SET_DATA_OUT_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002667#define PALMAS_GPIO_SET_DATA_OUT_GPIO_0_SET_DATA_OUT 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302668#define PALMAS_GPIO_SET_DATA_OUT_GPIO_0_SET_DATA_OUT_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002669
2670/* Bit definitions for PU_PD_GPIO_CTRL1 */
2671#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_3_PD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302672#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_3_PD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002673#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_2_PU 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302674#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_2_PU_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002675#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_2_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302676#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_2_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002677#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_1_PU 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302678#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_1_PU_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002679#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_1_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302680#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_1_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002681#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_0_PD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302682#define PALMAS_PU_PD_GPIO_CTRL1_GPIO_0_PD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002683
2684/* Bit definitions for PU_PD_GPIO_CTRL2 */
2685#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_7_PD 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302686#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_7_PD_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002687#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_6_PU 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302688#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_6_PU_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002689#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_6_PD 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302690#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_6_PD_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002691#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_5_PU 0x08
Keerthy45ac60c2014-05-22 14:48:30 +05302692#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_5_PU_SHIFT 0x03
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002693#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_5_PD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302694#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_5_PD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002695#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_4_PU 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302696#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_4_PU_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002697#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_4_PD 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302698#define PALMAS_PU_PD_GPIO_CTRL2_GPIO_4_PD_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002699
2700/* Bit definitions for OD_OUTPUT_GPIO_CTRL */
2701#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_5_OD 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302702#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_5_OD_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002703#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_2_OD 0x04
Keerthy45ac60c2014-05-22 14:48:30 +05302704#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_2_OD_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002705#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_1_OD 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302706#define PALMAS_OD_OUTPUT_GPIO_CTRL_GPIO_1_OD_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002707
2708/* Registers for function GPADC */
Keerthy45ac60c2014-05-22 14:48:30 +05302709#define PALMAS_GPADC_CTRL1 0x00
2710#define PALMAS_GPADC_CTRL2 0x01
2711#define PALMAS_GPADC_RT_CTRL 0x02
2712#define PALMAS_GPADC_AUTO_CTRL 0x03
2713#define PALMAS_GPADC_STATUS 0x04
2714#define PALMAS_GPADC_RT_SELECT 0x05
2715#define PALMAS_GPADC_RT_CONV0_LSB 0x06
2716#define PALMAS_GPADC_RT_CONV0_MSB 0x07
2717#define PALMAS_GPADC_AUTO_SELECT 0x08
2718#define PALMAS_GPADC_AUTO_CONV0_LSB 0x09
2719#define PALMAS_GPADC_AUTO_CONV0_MSB 0x0A
2720#define PALMAS_GPADC_AUTO_CONV1_LSB 0x0B
2721#define PALMAS_GPADC_AUTO_CONV1_MSB 0x0C
2722#define PALMAS_GPADC_SW_SELECT 0x0D
2723#define PALMAS_GPADC_SW_CONV0_LSB 0x0E
2724#define PALMAS_GPADC_SW_CONV0_MSB 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002725#define PALMAS_GPADC_THRES_CONV0_LSB 0x10
2726#define PALMAS_GPADC_THRES_CONV0_MSB 0x11
2727#define PALMAS_GPADC_THRES_CONV1_LSB 0x12
2728#define PALMAS_GPADC_THRES_CONV1_MSB 0x13
2729#define PALMAS_GPADC_SMPS_ILMONITOR_EN 0x14
2730#define PALMAS_GPADC_SMPS_VSEL_MONITORING 0x15
2731
2732/* Bit definitions for GPADC_CTRL1 */
2733#define PALMAS_GPADC_CTRL1_RESERVED_MASK 0xc0
Keerthy45ac60c2014-05-22 14:48:30 +05302734#define PALMAS_GPADC_CTRL1_RESERVED_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002735#define PALMAS_GPADC_CTRL1_CURRENT_SRC_CH3_MASK 0x30
Keerthy45ac60c2014-05-22 14:48:30 +05302736#define PALMAS_GPADC_CTRL1_CURRENT_SRC_CH3_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002737#define PALMAS_GPADC_CTRL1_CURRENT_SRC_CH0_MASK 0x0c
Keerthy45ac60c2014-05-22 14:48:30 +05302738#define PALMAS_GPADC_CTRL1_CURRENT_SRC_CH0_SHIFT 0x02
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002739#define PALMAS_GPADC_CTRL1_BAT_REMOVAL_DET 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302740#define PALMAS_GPADC_CTRL1_BAT_REMOVAL_DET_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002741#define PALMAS_GPADC_CTRL1_GPADC_FORCE 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302742#define PALMAS_GPADC_CTRL1_GPADC_FORCE_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002743
2744/* Bit definitions for GPADC_CTRL2 */
2745#define PALMAS_GPADC_CTRL2_RESERVED_MASK 0x06
Keerthy45ac60c2014-05-22 14:48:30 +05302746#define PALMAS_GPADC_CTRL2_RESERVED_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002747
2748/* Bit definitions for GPADC_RT_CTRL */
2749#define PALMAS_GPADC_RT_CTRL_EXTEND_DELAY 0x02
Keerthy45ac60c2014-05-22 14:48:30 +05302750#define PALMAS_GPADC_RT_CTRL_EXTEND_DELAY_SHIFT 0x01
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002751#define PALMAS_GPADC_RT_CTRL_START_POLARITY 0x01
Keerthy45ac60c2014-05-22 14:48:30 +05302752#define PALMAS_GPADC_RT_CTRL_START_POLARITY_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002753
2754/* Bit definitions for GPADC_AUTO_CTRL */
2755#define PALMAS_GPADC_AUTO_CTRL_SHUTDOWN_CONV1 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302756#define PALMAS_GPADC_AUTO_CTRL_SHUTDOWN_CONV1_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002757#define PALMAS_GPADC_AUTO_CTRL_SHUTDOWN_CONV0 0x40
Keerthy45ac60c2014-05-22 14:48:30 +05302758#define PALMAS_GPADC_AUTO_CTRL_SHUTDOWN_CONV0_SHIFT 0x06
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002759#define PALMAS_GPADC_AUTO_CTRL_AUTO_CONV1_EN 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302760#define PALMAS_GPADC_AUTO_CTRL_AUTO_CONV1_EN_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002761#define PALMAS_GPADC_AUTO_CTRL_AUTO_CONV0_EN 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302762#define PALMAS_GPADC_AUTO_CTRL_AUTO_CONV0_EN_SHIFT 0x04
2763#define PALMAS_GPADC_AUTO_CTRL_COUNTER_CONV_MASK 0x0F
2764#define PALMAS_GPADC_AUTO_CTRL_COUNTER_CONV_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002765
2766/* Bit definitions for GPADC_STATUS */
2767#define PALMAS_GPADC_STATUS_GPADC_AVAILABLE 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302768#define PALMAS_GPADC_STATUS_GPADC_AVAILABLE_SHIFT 0x04
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002769
2770/* Bit definitions for GPADC_RT_SELECT */
2771#define PALMAS_GPADC_RT_SELECT_RT_CONV_EN 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302772#define PALMAS_GPADC_RT_SELECT_RT_CONV_EN_SHIFT 0x07
2773#define PALMAS_GPADC_RT_SELECT_RT_CONV0_SEL_MASK 0x0F
2774#define PALMAS_GPADC_RT_SELECT_RT_CONV0_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002775
2776/* Bit definitions for GPADC_RT_CONV0_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302777#define PALMAS_GPADC_RT_CONV0_LSB_RT_CONV0_LSB_MASK 0xFF
2778#define PALMAS_GPADC_RT_CONV0_LSB_RT_CONV0_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002779
2780/* Bit definitions for GPADC_RT_CONV0_MSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302781#define PALMAS_GPADC_RT_CONV0_MSB_RT_CONV0_MSB_MASK 0x0F
2782#define PALMAS_GPADC_RT_CONV0_MSB_RT_CONV0_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002783
2784/* Bit definitions for GPADC_AUTO_SELECT */
Keerthy45ac60c2014-05-22 14:48:30 +05302785#define PALMAS_GPADC_AUTO_SELECT_AUTO_CONV1_SEL_MASK 0xF0
2786#define PALMAS_GPADC_AUTO_SELECT_AUTO_CONV1_SEL_SHIFT 0x04
2787#define PALMAS_GPADC_AUTO_SELECT_AUTO_CONV0_SEL_MASK 0x0F
2788#define PALMAS_GPADC_AUTO_SELECT_AUTO_CONV0_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002789
2790/* Bit definitions for GPADC_AUTO_CONV0_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302791#define PALMAS_GPADC_AUTO_CONV0_LSB_AUTO_CONV0_LSB_MASK 0xFF
2792#define PALMAS_GPADC_AUTO_CONV0_LSB_AUTO_CONV0_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002793
2794/* Bit definitions for GPADC_AUTO_CONV0_MSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302795#define PALMAS_GPADC_AUTO_CONV0_MSB_AUTO_CONV0_MSB_MASK 0x0F
2796#define PALMAS_GPADC_AUTO_CONV0_MSB_AUTO_CONV0_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002797
2798/* Bit definitions for GPADC_AUTO_CONV1_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302799#define PALMAS_GPADC_AUTO_CONV1_LSB_AUTO_CONV1_LSB_MASK 0xFF
2800#define PALMAS_GPADC_AUTO_CONV1_LSB_AUTO_CONV1_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002801
2802/* Bit definitions for GPADC_AUTO_CONV1_MSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302803#define PALMAS_GPADC_AUTO_CONV1_MSB_AUTO_CONV1_MSB_MASK 0x0F
2804#define PALMAS_GPADC_AUTO_CONV1_MSB_AUTO_CONV1_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002805
2806/* Bit definitions for GPADC_SW_SELECT */
2807#define PALMAS_GPADC_SW_SELECT_SW_CONV_EN 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302808#define PALMAS_GPADC_SW_SELECT_SW_CONV_EN_SHIFT 0x07
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002809#define PALMAS_GPADC_SW_SELECT_SW_START_CONV0 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302810#define PALMAS_GPADC_SW_SELECT_SW_START_CONV0_SHIFT 0x04
2811#define PALMAS_GPADC_SW_SELECT_SW_CONV0_SEL_MASK 0x0F
2812#define PALMAS_GPADC_SW_SELECT_SW_CONV0_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002813
2814/* Bit definitions for GPADC_SW_CONV0_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302815#define PALMAS_GPADC_SW_CONV0_LSB_SW_CONV0_LSB_MASK 0xFF
2816#define PALMAS_GPADC_SW_CONV0_LSB_SW_CONV0_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002817
2818/* Bit definitions for GPADC_SW_CONV0_MSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302819#define PALMAS_GPADC_SW_CONV0_MSB_SW_CONV0_MSB_MASK 0x0F
2820#define PALMAS_GPADC_SW_CONV0_MSB_SW_CONV0_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002821
2822/* Bit definitions for GPADC_THRES_CONV0_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302823#define PALMAS_GPADC_THRES_CONV0_LSB_THRES_CONV0_LSB_MASK 0xFF
2824#define PALMAS_GPADC_THRES_CONV0_LSB_THRES_CONV0_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002825
2826/* Bit definitions for GPADC_THRES_CONV0_MSB */
2827#define PALMAS_GPADC_THRES_CONV0_MSB_THRES_CONV0_POL 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302828#define PALMAS_GPADC_THRES_CONV0_MSB_THRES_CONV0_POL_SHIFT 0x07
2829#define PALMAS_GPADC_THRES_CONV0_MSB_THRES_CONV0_MSB_MASK 0x0F
2830#define PALMAS_GPADC_THRES_CONV0_MSB_THRES_CONV0_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002831
2832/* Bit definitions for GPADC_THRES_CONV1_LSB */
Keerthy45ac60c2014-05-22 14:48:30 +05302833#define PALMAS_GPADC_THRES_CONV1_LSB_THRES_CONV1_LSB_MASK 0xFF
2834#define PALMAS_GPADC_THRES_CONV1_LSB_THRES_CONV1_LSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002835
2836/* Bit definitions for GPADC_THRES_CONV1_MSB */
2837#define PALMAS_GPADC_THRES_CONV1_MSB_THRES_CONV1_POL 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302838#define PALMAS_GPADC_THRES_CONV1_MSB_THRES_CONV1_POL_SHIFT 0x07
2839#define PALMAS_GPADC_THRES_CONV1_MSB_THRES_CONV1_MSB_MASK 0x0F
2840#define PALMAS_GPADC_THRES_CONV1_MSB_THRES_CONV1_MSB_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002841
2842/* Bit definitions for GPADC_SMPS_ILMONITOR_EN */
2843#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_EN 0x20
Keerthy45ac60c2014-05-22 14:48:30 +05302844#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_EN_SHIFT 0x05
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002845#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_REXT 0x10
Keerthy45ac60c2014-05-22 14:48:30 +05302846#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_REXT_SHIFT 0x04
2847#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_SEL_MASK 0x0F
2848#define PALMAS_GPADC_SMPS_ILMONITOR_EN_SMPS_ILMON_SEL_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002849
2850/* Bit definitions for GPADC_SMPS_VSEL_MONITORING */
2851#define PALMAS_GPADC_SMPS_VSEL_MONITORING_ACTIVE_PHASE 0x80
Keerthy45ac60c2014-05-22 14:48:30 +05302852#define PALMAS_GPADC_SMPS_VSEL_MONITORING_ACTIVE_PHASE_SHIFT 0x07
2853#define PALMAS_GPADC_SMPS_VSEL_MONITORING_SMPS_VSEL_MONITORING_MASK 0x7F
2854#define PALMAS_GPADC_SMPS_VSEL_MONITORING_SMPS_VSEL_MONITORING_SHIFT 0x00
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002855
2856/* Registers for function GPADC */
Keerthy45ac60c2014-05-22 14:48:30 +05302857#define PALMAS_GPADC_TRIM1 0x00
2858#define PALMAS_GPADC_TRIM2 0x01
2859#define PALMAS_GPADC_TRIM3 0x02
2860#define PALMAS_GPADC_TRIM4 0x03
2861#define PALMAS_GPADC_TRIM5 0x04
2862#define PALMAS_GPADC_TRIM6 0x05
2863#define PALMAS_GPADC_TRIM7 0x06
2864#define PALMAS_GPADC_TRIM8 0x07
2865#define PALMAS_GPADC_TRIM9 0x08
2866#define PALMAS_GPADC_TRIM10 0x09
2867#define PALMAS_GPADC_TRIM11 0x0A
2868#define PALMAS_GPADC_TRIM12 0x0B
2869#define PALMAS_GPADC_TRIM13 0x0C
2870#define PALMAS_GPADC_TRIM14 0x0D
2871#define PALMAS_GPADC_TRIM15 0x0E
2872#define PALMAS_GPADC_TRIM16 0x0F
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002873
Laxman Dewangan60c185f2013-01-03 16:16:58 +05302874static inline int palmas_read(struct palmas *palmas, unsigned int base,
2875 unsigned int reg, unsigned int *val)
2876{
Keerthy45ac60c2014-05-22 14:48:30 +05302877 unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
Laxman Dewangan60c185f2013-01-03 16:16:58 +05302878 int slave_id = PALMAS_BASE_TO_SLAVE(base);
2879
2880 return regmap_read(palmas->regmap[slave_id], addr, val);
2881}
2882
2883static inline int palmas_write(struct palmas *palmas, unsigned int base,
2884 unsigned int reg, unsigned int value)
2885{
2886 unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
2887 int slave_id = PALMAS_BASE_TO_SLAVE(base);
2888
2889 return regmap_write(palmas->regmap[slave_id], addr, value);
2890}
2891
2892static inline int palmas_bulk_write(struct palmas *palmas, unsigned int base,
2893 unsigned int reg, const void *val, size_t val_count)
2894{
2895 unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
2896 int slave_id = PALMAS_BASE_TO_SLAVE(base);
2897
2898 return regmap_bulk_write(palmas->regmap[slave_id], addr,
2899 val, val_count);
2900}
2901
2902static inline int palmas_bulk_read(struct palmas *palmas, unsigned int base,
2903 unsigned int reg, void *val, size_t val_count)
2904{
2905 unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
2906 int slave_id = PALMAS_BASE_TO_SLAVE(base);
2907
2908 return regmap_bulk_read(palmas->regmap[slave_id], addr,
2909 val, val_count);
2910}
2911
2912static inline int palmas_update_bits(struct palmas *palmas, unsigned int base,
2913 unsigned int reg, unsigned int mask, unsigned int val)
2914{
2915 unsigned int addr = PALMAS_BASE_TO_REG(base, reg);
2916 int slave_id = PALMAS_BASE_TO_SLAVE(base);
2917
2918 return regmap_update_bits(palmas->regmap[slave_id], addr, mask, val);
2919}
2920
2921static inline int palmas_irq_get_virq(struct palmas *palmas, int irq)
2922{
2923 return regmap_irq_get_virq(palmas->irq_data, irq);
2924}
2925
Laxman Dewangancc01b462013-08-13 13:23:11 +05302926
2927int palmas_ext_control_req_config(struct palmas *palmas,
2928 enum palmas_external_requestor_id ext_control_req_id,
2929 int ext_ctrl, bool enable);
2930
Graeme Gregory2945fbc2012-05-15 15:48:56 +09002931#endif /* __LINUX_MFD_PALMAS_H */