/*
 * Copyright (C) 2012 Apple Inc. All rights reserved.
 *
 * This document is the property of Apple Inc.
 * It is considered confidential and proprietary.
 *
 * This document may not be reproduced or transmitted in any form,
 * in whole or in part, without the express written permission of
 * Apple Inc.
 */

#ifndef __DIALOG_D2045_H
#define __DIALOG_D2045_H

#define PMU_HAS_SWI		0
#define PMU_HAS_DWI		1
#define PMU_HAS_LCM_LDO		0
#define PMU_HAS_BIST_ADC	1
#define PMU_HAS_CHG_ABCC_FLAG	1
#define PMU_HAS_VIB		1
#define PMU_HAS_RAM		1
#define PMU_HAS_WLED		0
#define PMU_HAS_32K_RTC		1
#define PMU_HAS_ACCUMULATORS	1

enum {
	kDIALOG_ADDR_R		= 0xe9,
	kDIALOG_ADDR_W		= 0xe8,
	kDIALOG_REG_BYTES	= 2,
};

enum {
	kDIALOG_EVENT_COUNT		= 12,
	kDIALOG_STATUS_COUNT		= 13,
	kDIALOG_FAULTLOG_COUNT		= 2,
	kDIALOG_CHIPID_COUNT		= 4,
	kDIALOG_GPIO_COUNT		= 16,
};

#include "dCommon.h"

enum {
	kDIALOG_MASK_REV_CODE		= 0x0000,
	kDIALOG_TRIM_REL_CODE		= 0x0001,
	kDIALOG_PLATFORM_ID		= 0x0002,
	kDIALOG_DEVICE_ID1		= 0x0004,
	kDIALOG_DEVICE_ID2		= 0x0005,
	kDIALOG_DEVICE_ID3		= 0x0006,
	kDIALOG_DEVICE_ID4		= 0x0007,
	kDIALOG_DEVICE_ID5		= 0x0008,
	kDIALOG_CHIP_ID			= kDIALOG_MASK_REV_CODE,
	
	kDIALOG_SYS_CONTROL		= 0x0010,
	kDIALOG_SYS_CONTROL2		= 0x0011,
	
	kDIALOG_SYS_CONFIG		= 0x0020,
	kD2045_SYS_CONF_B		= 0x0021,
	kD2045_SYS_CONF_C		= 0x0022,
	kD2045_SYS_CONF_D		= 0x0023,
	kD2045_BG_TRIM			= 0x0024,
	kD2045_BG_TC_ADC		= 0x0025,
	kD2045_VREF_RTC_TRIM		= 0x0026,
	kD2045_VREF_AUX_TRIM		= 0x0027,
	kD2045_VDD_FAULT		= 0x0028,
	kD2045_RTC_CTRL0		= 0x0029,
	kD2045_RTC_CTRL1		= 0x002a,
	kD2045_OSC_CTRL0		= 0x002b,
	kD2045_INT_OSC_TRIM		= 0x002c,
	kD2045_CLK_REQ_FRC		= 0x002d,

	kDIALOG_FAULT_LOG		= 0x0040,
	kDIALOG_FAULT_LOG2		= 0x0041,
	
	kDIALOG_EVENT_A			= 0x0050,
	kDIALOG_EVENT_B			= 0x0051,
	kDIALOG_EVENT_C			= 0x0052,
	kDIALOG_EVENT_D			= 0x0053,
	kDIALOG_EVENT_E			= 0x0054,
	kDIALOG_EVENT_F			= 0x0055,
	kDIALOG_EVENT_G			= 0x0056,
	kDIALOG_EVENT_H			= 0x0057,
	kDIALOG_EVENT_I			= 0x0058,
	kDIALOG_EVENT_J			= 0x0059,
	kDIALOG_EVENT_K			= 0x005a,
	kDIALOG_EVENT_L			= 0x005b,

	kDIALOG_STATUS_A		= 0x0060,
	kDIALOG_STATUS_B		= 0x0061,
	kDIALOG_STATUS_C		= 0x0062,
	kDIALOG_STATUS_D		= 0x0063,
	kDIALOG_STATUS_E		= 0x0064,
	kDIALOG_STATUS_F		= 0x0065,
	kDIALOG_STATUS_G		= 0x0066,
	kDIALOG_STATUS_H		= 0x0067,
	kDIALOG_STATUS_I		= 0x0068,
	kDIALOG_STATUS_J		= 0x0069,
	kDIALOG_STATUS_K		= 0x006a,
	kDIALOG_STATUS_L		= 0x006b,
	kDIALOG_STATUS_M		= 0x006c,

	kDIALOG_IRQ_MASK_A		= 0x0070,
	kDIALOG_IRQ_MASK_B		= 0x0071,
	kDIALOG_IRQ_MASK_C		= 0x0072,
	kDIALOG_IRQ_MASK_D		= 0x0073,
	kDIALOG_IRQ_MASK_E		= 0x0074,
	kDIALOG_IRQ_MASK_F		= 0x0075,
	kDIALOG_IRQ_MASK_G		= 0x0076,
	kDIALOG_IRQ_MASK_H		= 0x0077,
	kDIALOG_IRQ_MASK_I		= 0x0078,
	kDIALOG_IRQ_MASK_J		= 0x0079,
	kDIALOG_IRQ_MASK_K		= 0x007A,
	kDIALOG_IRQ_MASK_L		= 0x007B,
	
	kD2045_ACTIVE1			= 0x0080,
	kD2045_ACTIVE2			= 0x0081,
	kD2045_ACTIVE3			= 0x0082,
	kD2045_ACTIVE4			= 0x0083,
	kD2045_ACTIVE5			= 0x0084,
	kD2045_ACTIVE6			= 0x0085,
	kD2045_ACTIVE7			= 0x0086,
	kD2045_STANDBY1			= 0x0088,
	kD2045_STANDBY3			= 0x008a,
	kD2045_STANDBY4			= 0x008b,
	kD2045_STANDBY6			= 0x008d,
	kD2045_STANDBY7			= 0x008e,
	kD2045_HIBERNATE1		= 0x0090,
	kD2045_HIBERNATE3		= 0x0092,
	kD2045_HIBERNATE4		= 0x0093,
	kD2045_HIBERNATE6		= 0x0095,
	kD2045_HIBERNATE7		= 0x0096,

	kD2045_SLOT_TIMINGS		= 0x00a0,
	kD2045_ACT_TO_HIB_DLY		= 0x00a1,
	kD2045_BUCK0_SLOT		= 0x00b0,
	kD2045_BUCK1_SLOT		= 0x00b1,
	kD2045_BUCK2_SLOT		= 0x00b2,
	kD2045_BUCK3_SLOT		= 0x00b3,
	kD2045_BUCK4_SLOT		= 0x00b4,
	kD2045_BUCK5_SLOT		= 0x00b5,
	kD2045_LDO1_SLOT		= 0x00c1,
	kD2045_LDO2_SLOT		= 0x00c2,
	kD2045_LDO3_SLOT		= 0x00c3,
	kD2045_LDO4_SLOT		= 0x00c4,
	kD2045_LDO5_SLOT		= 0x00c5,
	kD2045_LDO6_SLOT		= 0x00c6,
	kD2045_LDO7_SLOT		= 0x00c7,
	kD2045_LDO8_SLOT		= 0x00c8,
	kD2045_LDO9_SLOT		= 0x00c9,
	kD2045_LDO10_SLOT		= 0x00ca,
	kD2045_LDO11_SLOT		= 0x00cb,
	kD2045_LDO12_SLOT		= 0x00cc,
	kD2045_LDO13_SLOT		= 0x00cd,
	kD2045_CHARGE_PUMP_SLOT		= 0x00d8,
	kD2045_BUCK3_SW1_SLOT		= 0x00d9,
	kD2045_BUCK3_SW2_SLOT		= 0x00da,
	kD2045_BUCK3_SW3_SLOT		= 0x00db,
	kD2045_BUCK4_SW1_SLOT		= 0x00dc,
	kD2045_BUCK4_SW2_SLOT		= 0x00dd,

	kD2045_BUCK_DWI_CTRL0		= 0x00f0,
	kD2045_BUCK_DWI_TRIM0		= 0x00f2,
	kD2045_BUCK_FSM_TRIM0		= 0x00f4,
	kD2045_BUCK_FSM_TRIM1		= 0x00f5,
	kD2045_BUCK_CALIB_OFFSET_TRIM	= 0x00f6,

	kD2045_BUCK0_VSEL		= 0x0100,
	kD2045_BUCK0_VSEL_ACTUAL	= 0x0102,
	kD2045_BUCK0_MINV		= 0x0103,
	kD2045_BUCK0_MAXV		= 0x0104,
	kD2045_BUCK0_OFS_V		= 0x0105,
	kD2045_BUCK0_MODE		= 0x0106,
	kD2045_BUCK0_START_ILIMIT	= 0x0107,
	kD2045_BUCK0_SYNC_ILIMIT	= 0x0108,
	kD2045_BUCK0_SLEEP_ILIMIT	= 0x0109,
	kD2045_BUCK0_FSM_TRIM0		= 0x010a,
	kD2045_BUCK0_FSM_TRIM1		= 0x010b,
	kD2045_BUCK0_FSM_TRIM2		= 0x010c,
	kD2045_BUCK0_FSM_TRIM3		= 0x010d,
	kD2045_BUCK0_CLK_TRIM		= 0x010e,
	kD2045_BUCK0_CALIB0		= 0x0110,
	kD2045_BUCK0_CALIB1		= 0x0111,
	kD2045_BUCK0_ANA_TRIM0		= 0x0112,
	kD2045_BUCK0_ANA_TRIM1		= 0x0113,
	kD2045_BUCK0_ANA_TRIM2		= 0x0114,
	kD2045_BUCK0_ANA_TRIM3		= 0x0115,
	kD2045_BUCK0_ANA_TRIM4		= 0x0116,
	kD2045_BUCK0_ANA_TRIM5		= 0x0117,
	kD2045_BUCK0_ANA_TRIM6		= 0x0118,
	kD2045_BUCK0_ANA_TRIM7		= 0x0119,
	kD2045_BUCK0_ANA_TRIM8		= 0x011a,
	kD2045_BUCK0_ANA_TRIM9		= 0x011b,
	kD2045_BUCK1_VSEL		= 0x0120,
	kD2045_BUCK1_VSEL_ACTUAL	= 0x0122,
	kD2045_BUCK1_MINV		= 0x0123,
	kD2045_BUCK1_MAXV		= 0x0124,
	kD2045_BUCK1_OFS_V		= 0x0125,
	kD2045_BUCK1_MODE		= 0x0126,
	kD2045_BUCK1_START_ILIMIT	= 0x0127,
	kD2045_BUCK1_SYNC_ILIMIT	= 0x0128,
	kD2045_BUCK1_SLEEP_ILIMIT	= 0x0129,
	kD2045_BUCK1_FSM_TRIM0		= 0x012a,
	kD2045_BUCK1_FSM_TRIM1		= 0x012b,
	kD2045_BUCK1_FSM_TRIM2		= 0x012c,
	kD2045_BUCK1_FSM_TRIM3		= 0x012d,
	kD2045_BUCK1_CLK_TRIM		= 0x012e,
	kD2045_BUCK1_CALIB0		= 0x0130,
	kD2045_BUCK1_ANA_TRIM0		= 0x0132,
	kD2045_BUCK1_ANA_TRIM1		= 0x0133,
	kD2045_BUCK1_ANA_TRIM2		= 0x0134,
	kD2045_BUCK1_ANA_TRIM3		= 0x0135,
	kD2045_BUCK1_ANA_TRIM4		= 0x0136,
	kD2045_BUCK1_ANA_TRIM5		= 0x0137,
	kD2045_BUCK1_ANA_TRIM6		= 0x0138,
	kD2045_BUCK1_ANA_TRIM7		= 0x0139,
	kD2045_BUCK1_ANA_TRIM8		= 0x013a,
	kD2045_BUCK1_ANA_TRIM9		= 0x013b,
	kD2045_BUCK2_VSEL		= 0x0140,
	kD2045_BUCK2_VSEL_ACTUAL	= 0x0142,
	kD2045_BUCK2_MINV		= 0x0143,
	kD2045_BUCK2_MAXV		= 0x0144,
	kD2045_BUCK2_OFS_V		= 0x0145,
	kD2045_BUCK2_MODE		= 0x0146,
	kD2045_BUCK2_START_ILIMIT	= 0x0147,
	kD2045_BUCK2_SYNC_ILIMIT	= 0x0148,
	kD2045_BUCK2_SLEEP_ILIMIT	= 0x0149,
	kD2045_BUCK2_FSM_TRIM0		= 0x014a,
	kD2045_BUCK2_FSM_TRIM1		= 0x014b,
	kD2045_BUCK2_FSM_TRIM2		= 0x014c,
	kD2045_BUCK2_FSM_TRIM3		= 0x014d,
	kD2045_BUCK2_CLK_TRIM		= 0x014e,
	kD2045_BUCK2_CALIB0		= 0x0150,
	kD2045_BUCK2_ANA_TRIM0		= 0x0152,
	kD2045_BUCK2_ANA_TRIM1		= 0x0153,
	kD2045_BUCK2_ANA_TRIM2		= 0x0154,
	kD2045_BUCK2_ANA_TRIM3		= 0x0155,
	kD2045_BUCK2_ANA_TRIM4		= 0x0156,
	kD2045_BUCK2_ANA_TRIM5		= 0x0157,
	kD2045_BUCK2_ANA_TRIM6		= 0x0158,
	kD2045_BUCK2_ANA_TRIM7		= 0x0159,
	kD2045_BUCK2_ANA_TRIM8		= 0x015a,
	kD2045_BUCK2_ANA_TRIM9		= 0x015b,
	kD2045_BUCK3_VSEL		= 0x0160,
	kD2045_BUCK3_VSEL_ALT		= 0x0161,
	kD2045_BUCK3_VSEL_ACTUAL	= 0x0162,
	kD2045_BUCK3_MINV		= 0x0163,
	kD2045_BUCK3_MAXV		= 0x0164,
	kD2045_BUCK3_OFS_V		= 0x0165,
	kD2045_BUCK3_MODE		= 0x0166,
	kD2045_BUCK3_START_ILIMIT	= 0x0167,
	kD2045_BUCK3_SYNC_ILIMIT	= 0x0168,
	kD2045_BUCK3_SLEEP_ILIMIT	= 0x0169,
	kD2045_BUCK3_FSM_TRIM0		= 0x016a,
	kD2045_BUCK3_FSM_TRIM2		= 0x016c,
	kD2045_BUCK3_FSM_TRIM3		= 0x016d,
	kD2045_BUCK3_CLK_TRIM		= 0x016e,
	kD2045_BUCK3_CALIB0		= 0x0170,
	kD2045_BUCK3_ANA_TRIM0		= 0x0172,
	kD2045_BUCK3_ANA_TRIM1		= 0x0173,
	kD2045_BUCK3_ANA_TRIM2		= 0x0174,
	kD2045_BUCK3_ANA_TRIM3		= 0x0175,
	kD2045_BUCK3_ANA_TRIM4		= 0x0176,
	kD2045_BUCK3_ANA_TRIM5		= 0x0177,
	kD2045_BUCK3_ANA_TRIM6		= 0x0178,
	kD2045_BUCK3_ANA_TRIM7		= 0x0179,
	kD2045_BUCK3_ANA_TRIM8		= 0x017a,
	kD2045_BUCK3_ANA_TRIM9		= 0x017b,
	kD2045_BUCK4_VSEL		= 0x0180,
	kD2045_BUCK4_VSEL_ALT		= 0x0181,
	kD2045_BUCK4_VSEL_ACTUAL	= 0x0182,
	kD2045_BUCK4_MINV		= 0x0183,
	kD2045_BUCK4_MAXV		= 0x0184,
	kD2045_BUCK4_OFS_V		= 0x0185,
	kD2045_BUCK4_MODE		= 0x0186,
	kD2045_BUCK4_START_ILIMIT	= 0x0187,
	kD2045_BUCK4_SYNC_ILIMIT	= 0x0188,
	kD2045_BUCK4_SLEEP_ILIMIT	= 0x0189,
	kD2045_BUCK4_FSM_TRIM0		= 0x018a,
	kD2045_BUCK4_FSM_TRIM2		= 0x018c,
	kD2045_BUCK4_FSM_TRIM3		= 0x018d,
	kD2045_BUCK4_CLK_TRIM		= 0x018e,
	kD2045_BUCK4_CALIB0		= 0x0190,
	kD2045_BUCK4_ANA_TRIM0		= 0x0192,
	kD2045_BUCK4_ANA_TRIM1		= 0x0193,
	kD2045_BUCK4_ANA_TRIM2		= 0x0194,
	kD2045_BUCK4_ANA_TRIM3		= 0x0195,
	kD2045_BUCK4_ANA_TRIM4		= 0x0196,
	kD2045_BUCK4_ANA_TRIM5		= 0x0197,
	kD2045_BUCK4_ANA_TRIM6		= 0x0198,
	kD2045_BUCK4_ANA_TRIM7		= 0x0199,
	kD2045_BUCK4_ANA_TRIM8		= 0x019a,
	kD2045_BUCK4_ANA_TRIM9		= 0x019b,
	kD2045_BUCK5_VSEL		= 0x01a0,
	kD2045_BUCK5_VSEL_ACTUAL	= 0x01a2,
	kD2045_BUCK5_MINV		= 0x01a3,
	kD2045_BUCK5_MAXV		= 0x01a4,
	kD2045_BUCK5_OFS_V		= 0x01a5,
	kD2045_BUCK5_MODE		= 0x01a6,
	kD2045_BUCK5_START_ILIMIT	= 0x01a7,
	kD2045_BUCK5_SYNC_ILIMIT	= 0x01a8,
	kD2045_BUCK5_SLEEP_ILIMIT	= 0x01a9,
	kD2045_BUCK5_FSM_TRIM0		= 0x01aa,
	kD2045_BUCK5_FSM_TRIM2		= 0x01ac,
	kD2045_BUCK5_FSM_TRIM3		= 0x01ad,
	kD2045_BUCK5_CLK_TRIM		= 0x01ae,
	kD2045_BUCK5_CALIB_OFFSET_TRIM	= 0x01af,
	kD2045_BUCK5_CALIB0		= 0x01b0,
	kD2045_BUCK5_ANA_TRIM0		= 0x01b2,
	kD2045_BUCK5_ANA_TRIM1		= 0x01b3,
	kD2045_BUCK5_ANA_TRIM2		= 0x01b4,
	kD2045_BUCK5_ANA_TRIM3		= 0x01b5,
	kD2045_BUCK5_ANA_TRIM4		= 0x01b6,
	kD2045_BUCK5_ANA_TRIM5		= 0x01b7,
	kD2045_BUCK5_ANA_TRIM6		= 0x01b8,
	kD2045_BUCK5_ANA_TRIM7		= 0x01b9,
	kD2045_BUCK5_ANA_TRIM8		= 0x01ba,
	kD2045_BUCK5_ANA_TRIM9		= 0x01bb,
	
	kD2045_LDO1_VSEL		= 0x0308,
	kD2045_LDO1_VSEL_ACTUAL		= 0x0309,
	kD2045_LDO1_MINV		= 0x030a,
	kD2045_LDO1_MAXV		= 0x030b,
	kD2045_LDO2_VSEL		= 0x0310,
	kD2045_LDO2_VSEL_ACTUAL		= 0x0311,
	kD2045_LDO2_MINV		= 0x0312,
	kD2045_LDO2_MAXV		= 0x0313,
	kD2045_LDO2_TRIM		= 0x0314,
	kD2045_LDO3_VSEL		= 0x0318,
	kD2045_LDO3_VSEL_ACTUAL		= 0x0319,
	kD2045_LDO3_MINV		= 0x031a,
	kD2045_LDO3_MAXV		= 0x031b,
	kD2045_LDO4_VSEL		= 0x0320,
	kD2045_LDO4_VSEL_ACTUAL		= 0x0321,
	kD2045_LDO4_MINV		= 0x0322,
	kD2045_LDO4_MAXV		= 0x0323,
	kD2045_LDO5_VSEL		= 0x0328,
	kD2045_LDO5_VSEL_ACTUAL		= 0x0329,
	kD2045_LDO5_MINV		= 0x032a,
	kD2045_LDO5_MAXV		= 0x032b,
	kD2045_LDO5_TRIM		= 0x032c,
	kD2045_LDO6_VSEL		= 0x0330,
	kD2045_LDO6_VSEL_ACTUAL		= 0x0331,
	kD2045_LDO6_MINV		= 0x0332,
	kD2045_LDO6_MAXV		= 0x0333,
	kD2045_LDO6_TRIM		= 0x0334,
	kD2045_LDO7_VSEL		= 0x0338,
	kD2045_LDO7_VSEL_ACTUAL		= 0x0339,
	kD2045_LDO7_MINV		= 0x033a,
	kD2045_LDO7_MAXV		= 0x033b,
	kD2045_LDO7_TRIM		= 0x033c,
	kD2045_LDO8_VSEL		= 0x0340,
	kD2045_LDO8_VSEL_ACTUAL		= 0x0341,
	kD2045_LDO8_MINV		= 0x0342,
	kD2045_LDO8_MAXV		= 0x0343,
	kD2045_LDO8_TRIM		= 0x0344,
	kD2045_LDO9_VSEL		= 0x0348,
	kD2045_LDO9_VSEL_ACTUAL		= 0x0349,
	kD2045_LDO9_MINV		= 0x034a,
	kD2045_LDO9_MAXV		= 0x034b,
	kD2045_LDO9_TRIM		= 0x034c,
	kD2045_LDO10_VSEL		= 0x0350,
	kD2045_LDO10_VSEL_ACTUAL	= 0x0351,
	kD2045_LDO10_MINV		= 0x0352,
	kD2045_LDO10_MAXV		= 0x0353,
	kD2045_LDO11_VSEL		= 0x0358,
	kD2045_LDO11_VSEL_ACTUAL	= 0x0359,
	kD2045_LDO11_MINV		= 0x035a,
	kD2045_LDO11_MAXV		= 0x035b,
	kD2045_LDO11_TRIM		= 0x035c,
	kD2045_LDO12_TRIM		= 0x0364,
	kD2045_LDO13_VSEL		= 0x0368,
	kD2045_LDO13_VSEL_ACTUAL	= 0x0369,
	kD2045_LDO13_MINV		= 0x036a,
	kD2045_LDO13_MAXV		= 0x036b,
	kD2045_LDO13_TRIM		= 0x036c,
	kD2045_LDO_BYP1			= 0x0380,
	kDIALOG_LDO_CONTROL		= kD2045_LDO_BYP1,

	kD2045_HIB_SW_CTRL		= 0x03c0,
	
	kD2045_GPIO1			= 0x0400,
	kDIALOG_SYS_GPIO_REG_START	= kD2045_GPIO1,
	kD2045_GPIO2			= 0x0401,
	kD2045_GPIO3			= 0x0402,
	kD2045_GPIO4			= 0x0403,
	kD2045_GPIO5			= 0x0404,
	kD2045_GPIO6			= 0x0405,
	kD2045_GPIO7			= 0x0406,
	kD2045_GPIO8			= 0x0407,
	kD2045_GPIO9			= 0x0408,
	kD2045_GPIO10			= 0x0409,
	kD2045_GPIO11			= 0x040a,
	kD2045_GPIO12			= 0x040b,
	kD2045_GPIO13			= 0x040c,
	kD2045_GPIO14			= 0x040d,
	kD2045_GPIO15			= 0x040e,
	kD2045_GPIO16			= 0x040f,

	kD2045_GPIO_DEB1		= 0x0420,
	kD2045_GPIO_DEB2		= 0x0421,
	kD2045_GPIO_DEB3		= 0x0422,
	kD2045_GPIO_DEB4		= 0x0423,
	kD2045_GPIO_DEB5		= 0x0424,
	kD2045_GPIO_DEB6		= 0x0425,
	kD2045_GPIO_DEB7		= 0x0426,
	kD2045_GPIO_DEB8		= 0x0427,

	kD2045_OUT_32K			= 0x0430,
	
	kD2045_BUTTON1_CONF		= 0x0440,
	kD2045_BUTTON2_CONF		= 0x0441,
	kD2045_BUTTON3_CONF		= 0x0442,
	kD2045_BUTTON4_CONF		= 0x0443,
	kDIALOG_BUTTON_DBL		= 0x0444,
	kD2045_BUTTON_WAKE		= 0x0445,
	
	kD2045_RESET_IN1_CONF		= 0x0448,
	kD2045_RESET_IN2_CONF		= 0x0449,
	kD2045_RESET_IN3_CONF		= 0x044a,
    
	kD2045_TDEV1_RISE		= 0x0480,
	kD2045_TDEV1_FALL		= 0x0481,
	kD2045_TDEV2_RISE		= 0x0482,
	kD2045_TDEV2_FALL		= 0x0483,
	kD2045_TDEV3_RISE		= 0x0484,
	kD2045_TDEV3_FALL		= 0x0485,
	kD2045_TDEV4_RISE		= 0x0486,
	kD2045_TDEV4_FALL		= 0x0487,
	kD2045_TLDO5_RISE		= 0x04a0,
	kD2045_THIBSW_RISE		= 0x04a1,
	kD2045_TVCENTER_RISE		= 0x04a2,
	kD2045_TLINCHG_RISE		= 0x04a3,
	kD2045_TBUCK0_RISE		= 0x04a4,
	kD2045_TBUCK2_1_RISE		= 0x04a5,
	kD2045_TBUCK3_5_RISE		= 0x04a6,
	kD2045_TBUCK1_4_RISE		= 0x04a7,
	kD2045_TISENSE_HYST		= 0x04a8,
	kDIALOG_T_OFFSET_MSB		= 0x04a9,
	kDIALOG_T_OFFSET_LSB		= 0x04aa,
	
	kD2045_ISET_BUCK		= 0x04c0,
	kD2045_ISET_BUCK_SHADOW		= 0x04c1,
	kD2045_ISET_BUCK_ABSMAX		= 0x04c2,
	kD2045_ISET_BUCK_ACTUAL		= 0x04c3,
	kD2045_ISET_BUCK_ALT		= 0x04c4,
	kDIALOG_CHARGE_BUCK_CONTROL	= kD2045_ISET_BUCK,
	kDIALOG_CHARGE_BUCK_STATUS	= kD2045_ISET_BUCK_ACTUAL,
	kD2045_CHG_CTRL_A		= 0x04c5,
	kD2045_CHG_CTRL_B		= 0x04c6,
	kD2045_CHG_CTRL_C		= 0x04c7,
	kD2045_CHG_CTRL_D		= 0x04c8,
	kD2045_CHG_CTRL_E		= 0x04c9,
	kD2045_CHG_CTRL_F		= 0x04ca,
	kD2045_CHG_TIME			= 0x04cb,
	kDIALOG_CHARGE_CONTROL_ICHG_BAT = kD2045_CHG_CTRL_B,
	kDIALOG_CHARGE_CONTROL_HIB	= kD2045_CHG_CTRL_B,
	kDIALOG_CHARGE_CONTROL_TIME	= kD2045_CHG_CTRL_D,
	kDIALOG_CHARGE_CONTROL_EN	= kD2045_CHG_CTRL_A,
	kDIALOG_OTP_ISET_BAT		= kD2045_CHG_CTRL_C,
	kDIALOG_CHARGE_STATUS		= 0x04cc,
	kD2045_CHG_VSET_TRIM		= 0x04cd,
	kD2045_CHG_VSET_OFS		= 0x04ce,
	kD2045_IBUS_GAIN_TRIM		= 0x04cf,
	kD2045_IBUS100_OFS_TRIM		= 0x04d0,
	kD2045_IBUS500_OFS_TRIM		= 0x04d1,
	kD2045_CHG_TRIM1		= 0x04d2,
	kD2045_CHG_TRIM2		= 0x04d3,
	kD2045_CHG_TRIM3		= 0x04d4,
	kD2045_CHG_TRIM4		= 0x04d5,
	kD2045_ICHG_END			= 0x04d6,

	kDIALOG_TBAT_0			= 0x04d7,
	kDIALOG_TBAT_1			= 0x04d8,
	kDIALOG_TBAT_2			= 0x04d9,
	kDIALOG_TBAT_3			= 0x04da,
	kDIALOG_TBAT_4			= 0x04db,
	kDIALOG_TBAT_MAX		= 0x04dc,
	kDIALOG_ICHG_TBAT_0		= 0x04dd,
	kDIALOG_ICHG_TBAT_1		= 0x04de,
	kDIALOG_ICHG_TBAT_2		= 0x04df,
	kDIALOG_ICHG_TBAT_3		= 0x04e0,
	kDIALOG_ICHG_TBAT_4		= 0x04e1,

	kDIALOG_ICHG_AVG		= 0x04e2,

	kDIALOG_ADC_CONTROL		= 0x0500,
	kDIALOG_ADC_CONTROL2		= 0x0501,
	kDIALOG_ADC_LSB			= 0x0502,
	kDIALOG_ADC_MSB			= 0x0503,
	kD2045_ADC_TEMP_CTRL0		= 0x0504,
	kD2045_ADC_TEMP_CTRL1		= 0x0505,
	kD2045_ADC_FSM_TRIM0		= 0x0506,
	kD2045_ADC_FSM_TRIM1		= 0x0507,
	kD2045_ADC_FSM_TRIM2		= 0x0508,
	kD2045_ADC_FSM_TRIM3		= 0x0509,
	kD2045_ADC_ANA_TRIM0		= 0x050a,
	kD2045_VCC_MAIN_MON		= 0x050c,
	kDIALOG_IBUS_ACCUM1		= 0x050e,
	kDIALOG_IBUS_ACCUM2		= 0x050f,
	kDIALOG_IBUS_ACCUM3		= 0x0510,
	kDIALOG_VBUS_ACCUM1		= 0x0511,
	kDIALOG_VBUS_ACCUM2		= 0x0512,
	kDIALOG_VBUS_ACCUM3		= 0x0513,
	kDIALOG_TDIE_ACCUM1		= 0x0514,
	kDIALOG_TDIE_ACCUM2		= 0x0515,
	kDIALOG_TDIE_ACCUM3		= 0x0516,
	kDIALOG_IBUS_COUNT1		= 0x0517,
	kDIALOG_IBUS_COUNT2		= 0x0518,
	kD2045_IBUSCAL_1		= 0x0519,
	kD2045_IBUSCAL_2		= 0x051a,
	kD2045_IBUSCAL_3		= 0x051b,
	kD2045_IBUSCAL_4		= 0x051c,
	kD2045_IBUSCAL_5		= 0x051d,
	kD2045_IBUSCAL_6		= 0x051e,
	kD2045_IBUSCAL_7		= 0x051f,
	kD2045_IBUSCAL_8		= 0x0520,

	kDIALOG_APP_TMUX		= 0x0540,
	kDIALOG_BIST_ADC_CTRL		= 0x0541,
	kDIALOG_BIST_ADC_LSB		= 0x0542,
	kDIALOG_BIST_ADC_MSB		= 0x0543,
	kD2045_BIST_ADC_TRIM1		= 0x0545,
	kD2045_BIST_ADC_ANA_TRIM0	= 0x0546,
	
	kDIALOG_VIB_CTRL		= 0x0580,
	kDIALOG_VIB_VSET		= 0x0581,
	kD2045_VIB_TRIM			= 0x0582,
	kD2045_VIB_ILIMIT_PROG		= 0x0583,
	
	kDIALOG_RTC_ALARM_A		= 0x05c0,
	kDIALOG_RTC_ALARM_B		= 0x05c1,
	kDIALOG_RTC_ALARM_C		= 0x05c2,
	kDIALOG_RTC_ALARM_D		= 0x05c3,
	kDIALOG_RTC_CONTROL		= 0x05c4,
	kDIALOG_RTC_TIMEZONE		= 0x05c5,
	kDIALOG_RTC_SUB_SECOND_A	= 0x05c6,
	kDIALOG_RTC_SUB_SECOND_B	= 0x05c7,
	kDIALOG_RTC_SECOND_A		= 0x05c8,
	kDIALOG_RTC_SECOND_B		= 0x05c9,
	kDIALOG_RTC_SECOND_C		= 0x05ca,
	kDIALOG_RTC_SECOND_D		= 0x05cb,

	kD2045_SPARE_RW0		= 0x0680,
	kD2045_SPARE_RW_LAST		= 0x0687,
	kD2045_SPARE_RWTOTP0		= 0x06a0,
	kD2045_SPARE_RWTOTP_LAST	= 0x06a7,
	kD2045_SPARE_RWOTP0		= 0x06c0,
	kD2045_SPARE_RWOTP1		= 0x0610,

	kDIALOG_MEMBYTE0		= 0x4000,
	kDIALOG_MEMBYTE_LAST		= 0x4027,
	
	kDIALOG_RAM0			= 0x8000,
		kDIALOG_EXT_MEM_CAL0 = kDIALOG_RAM0,
			kDIALOG_EXT_MEM_CAL0_SIZE = 64,
		kDIALOG_DIAG_SCRATCH	= kDIALOG_EXT_MEM_CAL0+kDIALOG_EXT_MEM_CAL0_SIZE,	// <rdar://problem/13485884>
			kDIALOG_DIAG_SCRATCH_SIZE = 8,
		kDIALOG_EXT_MEM_CAL1= kDIALOG_DIAG_SCRATCH+kDIALOG_DIAG_SCRATCH_SIZE,
			kDIALOG_EXT_MEM_CAL1_SIZE= 336,

		kDIALOG_EXT_MEM_CAL_SIZE= kDIALOG_EXT_MEM_CAL0_SIZE+kDIALOG_EXT_MEM_CAL1_SIZE,
			
	kDIALOG_RAM_LAST		= 0x87ff,
};

// Synthetic Accumulator Registers 
enum {
	kDIALOG_ACCUMULATOR_SEL_COUNT   = 2,
	kDIALOG_IBUS_ACCUMULATOR	= 0,
	kDIALOG_VBUS_ACCUMULATOR	= 1,
};

enum {
	kD2045_EVENT_A_TBAT		= (1 << 7),
	kD2045_EVENT_A_VBUS_EXT_REM	= (1 << 6),
	kD2045_EVENT_A_VDD_LOW		= (1 << 5),
	kD2045_EVENT_A_VBUS_EXT_DET	= (1 << 3),
	kD2045_EVENT_A_ACC_DET		= (1 << 2),
	kD2045_EVENT_A_VCENTER_DET	= (1 << 0),
};

enum {
	kD2045_EVENT_B_BTN4_DBL		= (1 << 7),
	kD2045_EVENT_B_BTN3_DBL		= (1 << 6),
	kD2045_EVENT_B_BTN2_DBL		= (1 << 5),
	kD2045_EVENT_B_BTN1_DBL		= (1 << 4),
	kD2045_EVENT_B_BUTTON_4		= (1 << 3),
	kD2045_EVENT_B_BUTTON_3		= (1 << 2),
	kD2045_EVENT_B_BUTTON_2		= (1 << 1),
	kD2045_EVENT_B_BUTTON_1		= (1 << 0),
};

enum {
	kD2045_EVENT_C_CHG_BUCK_FLG	= (1 << 6),
	kD2045_EVENT_C_CHG_ABCC_ACT	= (1 << 5),
	kD2045_EVENT_C_CHG_TIMEOUT	= (1 << 4),
	kD2045_EVENT_C_CHG_PRECHG_TIMEOUT	= (1 << 3),
	kD2045_EVENT_C_CHG_END		= (1 << 2),
	kD2045_EVENT_C_CHG_FAST		= (1 << 1),
	kD2045_EVENT_C_CHG_PRE		= (1 << 0),
};

enum {
	kD2045_EVENT_D_GPIO8		= (1 << 7),
	kD2045_EVENT_D_GPIO7		= (1 << 6),
	kD2045_EVENT_D_GPIO6		= (1 << 5),
	kD2045_EVENT_D_GPIO5		= (1 << 4),
	kD2045_EVENT_D_GPIO4		= (1 << 3),
	kD2045_EVENT_D_GPIO3		= (1 << 2),
	kD2045_EVENT_D_GPIO2		= (1 << 1),
	kD2045_EVENT_D_GPIO1		= (1 << 0),
};

enum {
	kD2045_EVENT_E_GPIO16		= (1 << 7),
	kD2045_EVENT_E_GPIO15		= (1 << 6),
	kD2045_EVENT_E_GPIO14		= (1 << 5),
	kD2045_EVENT_E_GPIO13		= (1 << 4),
	kD2045_EVENT_E_GPIO12		= (1 << 3),
	kD2045_EVENT_E_GPIO11		= (1 << 2),
	kD2045_EVENT_E_GPIO10		= (1 << 1),
	kD2045_EVENT_E_GPIO9		= (1 << 0),
};

	// EVENT_F has no events

enum {
	kD2045_EVENT_G_T4_RISE		= (1 << 7),
	kD2045_EVENT_G_T4_FALL		= (1 << 6),
	kD2045_EVENT_G_T3_RISE		= (1 << 5),
	kD2045_EVENT_G_T3_FALL		= (1 << 4),
	kD2045_EVENT_G_T2_RISE		= (1 << 3),
	kD2045_EVENT_G_T2_FALL		= (1 << 2),
	kD2045_EVENT_G_T1_RISE		= (1 << 1),
	kD2045_EVENT_G_T1_FALL		= (1 << 0),
};

	// EVENT_H has no events

enum {
	kD2045_EVENT_I_TBUCK_1_4	= (1 << 7),
	kD2045_EVENT_I_TBUCK_3_5	= (1 << 6),
	kD2045_EVENT_I_TBUCK_2_1	= (1 << 5),
	kD2045_EVENT_I_TBUCK_0		= (1 << 4),
	kD2045_EVENT_I_TLINCHG		= (1 << 3),
	kD2045_EVENT_I_TVCENTER		= (1 << 2),
	kD2045_EVENT_I_THIBSW		= (1 << 1),
	kD2045_EVENT_I_TLDO5		= (1 << 0),
};

enum {
	kD2045_EVENT_J_HIGH_TEMP_WARNING	= (1 << 7),
};

enum {
	kD2045_EVENT_K_VBUS_OV		= (1 << 5),
	kD2045_EVENT_K_VBUS_OC		= (1 << 4),
	kD2045_EVENT_K_LDO6_OC		= (1 << 3),
};

// EVENT_L events are stored by LLB across sleep/wake
enum {
	kD2045_EVENT_L_VIB		= (1 << 7),
	kD2045_EVENT_L_IBUS_OVERFLOW	= (1 << 6),
	kD2045_EVENT_L_XTAL_ERROR	= (1 << 5),
	kD2045_EVENT_L_HIB		= (1 << 4),
	kD2045_EVENT_L_DWI_TO		= (1 << 3),
	kD2045_EVENT_L_EOMC_BIST	= (1 << 2),
	kD2045_EVENT_L_EOMC		= (1 << 1),
	kD2045_EVENT_L_ALARM		= (1 << 0),
};

enum {
	kD2045_STATUS_A_TBAT		= (1 << 7),
	kD2045_STATUS_A_VDD_LOW		= (1 << 5),
	kD2045_STATUS_A_VBUS_EXT_DET	= (1 << 3),
	kD2045_STATUS_A_ACC_DET		= (1 << 2),
	kD2045_STATUS_A_VCENTER_DET	= (1 << 0),
};

enum {
	kD2045_STATUS_B_BUTTON_4	= (1 << 3),
	kD2045_STATUS_B_BUTTON_3	= (1 << 2),
	kD2045_STATUS_B_BUTTON_2	= (1 << 1),
	kD2045_STATUS_B_BUTTON_1	= (1 << 0),
};

enum {
	kD2045_STATUS_C_CHG_BUCK_FLG	= (1 << 6),
	kD2045_STATUS_C_CHG_ABCC_ACT	= (1 << 5),
	kD2045_STATUS_C_CHG_TIMEOUT	= (1 << 4),
	kD2045_STATUS_C_CHG_PRECHG_TIMEOUT	= (1 << 3),
	kD2045_STATUS_C_CHG_END		= (1 << 2),
	kD2045_STATUS_C_CHG_FAST		= (1 << 1),
	kD2045_STATUS_C_CHG_PRE		= (1 << 0),
};

enum {
	kD2045_STATUS_D_GPIO8		= (1 << 7),
	kD2045_STATUS_D_GPIO7		= (1 << 6),
	kD2045_STATUS_D_GPIO6		= (1 << 5),
	kD2045_STATUS_D_GPIO5		= (1 << 4),
	kD2045_STATUS_D_GPIO4		= (1 << 3),
	kD2045_STATUS_D_GPIO3		= (1 << 2),
	kD2045_STATUS_D_GPIO2		= (1 << 1),
	kD2045_STATUS_D_GPIO1		= (1 << 0),
};

enum {
	kD2045_STATUS_E_GPIO16		= (1 << 7),
	kD2045_STATUS_E_GPIO15		= (1 << 6),
	kD2045_STATUS_E_GPIO14		= (1 << 5),
	kD2045_STATUS_E_GPIO13		= (1 << 4),
	kD2045_STATUS_E_GPIO12		= (1 << 3),
	kD2045_STATUS_E_GPIO11		= (1 << 2),
	kD2045_STATUS_E_GPIO10		= (1 << 1),
	kD2045_STATUS_E_GPIO9		= (1 << 0),
};

	// STATUS_F has no bits

enum {
	kD2045_STATUS_G_T4_RISE		= (1 << 7),
	kD2045_STATUS_G_T4_FALL		= (1 << 6),
	kD2045_STATUS_G_T3_RISE		= (1 << 5),
	kD2045_STATUS_G_T3_FALL		= (1 << 4),
	kD2045_STATUS_G_T2_RISE		= (1 << 3),
	kD2045_STATUS_G_T2_FALL		= (1 << 2),
	kD2045_STATUS_G_T1_RISE		= (1 << 1),
	kD2045_STATUS_G_T1_FALL		= (1 << 0),
};

	// STATUS_H has no bits

enum {
	kD2045_STATUS_I_TBUCK_1_4	= (1 << 7),
	kD2045_STATUS_I_TBUCK_3_5	= (1 << 6),
	kD2045_STATUS_I_TBUCK_2_1	= (1 << 5),
	kD2045_STATUS_I_TBUCK_0		= (1 << 4),
	kD2045_STATUS_I_TLINCHG		= (1 << 3),
	kD2045_STATUS_I_TVCENTER		= (1 << 2),
	kD2045_STATUS_I_THIBSW		= (1 << 1),
	kD2045_STATUS_I_TLDO5		= (1 << 0),
};

enum {
	kD2045_STATUS_J_HIGH_TEMP_WARNING	= (1 << 7),
};

enum {
	kD2045_STATUS_K_VBUS_OV		= (1 << 5),
	kD2045_STATUS_K_VBUS_OC		= (1 << 4),
};

enum {
	kD2045_STATUS_L_VIB_ILIM	= (1 << 7),
	kD2045_STATUS_L_IBUS_OVERFLOW	= (1 << 6),
	kD2045_STATUS_L_XTAL_ERROR	= (1 << 5),
};

enum {
	kD2045_STATUS_M_PROT_FET_ON	= (1 << 1),
	kD2045_STATUS_M_CHG_ATT		= (1 << 0),
};

enum {
	kDIALOG_EVENT_HOLD_BUTTON_MASK	= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BUTTON_2),
	kDIALOG_EVENT_MENU_BUTTON_MASK	= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BUTTON_1),
	kDIALOG_EVENT_RINGER_BUTTON_MASK= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BUTTON_3),
	kDIALOG_EVENT_BUTTON4_MASK= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BUTTON_4),
	kDIALOG_EVENT_BUTTONS		= (kD2045_EVENT_B_BUTTON_4 |
					   kD2045_EVENT_B_BUTTON_3 |
					   kD2045_EVENT_B_BUTTON_2 |
					   kD2045_EVENT_B_BUTTON_1),
	kDIALOG_EVENT_BUTTONS_MASK	= EVENT_FLAG_MAKE(1, kDIALOG_EVENT_BUTTONS),
	kDIALOG_EVENT_PWR_BUTTON_MASK	= kDIALOG_EVENT_HOLD_BUTTON_MASK,
	
	kDIALOG_EVENT_ALARM_MASK	= EVENT_FLAG_MAKE(11, kD2045_EVENT_L_ALARM),
	kDIALOG_EVENT_ACC_DET_MASK	= EVENT_FLAG_MAKE(0, kD2045_EVENT_A_ACC_DET),
	kDIALOG_EVENT_VBUS_DET_MASK	= EVENT_FLAG_MAKE(0, kD2045_EVENT_A_VBUS_EXT_DET),
	kDIALOG_EVENT_VBUS_EXT_REM_MASK	= EVENT_FLAG_MAKE(0, kD2045_EVENT_A_VBUS_EXT_REM),
	kDIALOG_EVENT_EOMC_MASK		= EVENT_FLAG_MAKE(11, kD2045_EVENT_L_EOMC),
	kDIALOG_EVENT_HIB_MASK		= EVENT_FLAG_MAKE(11, kD2045_EVENT_L_HIB),
	kDIALOG_EVENT_ABCC_MASK		= EVENT_FLAG_MAKE(2, kD2045_EVENT_C_CHG_ABCC_ACT),
	
	kDIALOG_EVENT_CHG_END_MASK	= EVENT_FLAG_MAKE(2, kD2045_EVENT_C_CHG_END),
	kDIALOG_EVENT_TBAT_MASK		= EVENT_FLAG_MAKE(0, kD2045_EVENT_A_TBAT),
	
	kDIALOG_EVENT_GPIO1_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO1),
	kDIALOG_EVENT_GPIO2_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO2),
	kDIALOG_EVENT_GPIO3_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO3),
	kDIALOG_EVENT_GPIO4_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO4),
	kDIALOG_EVENT_GPIO5_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO5),
	kDIALOG_EVENT_GPIO6_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO6),
	kDIALOG_EVENT_GPIO7_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO7),
	kDIALOG_EVENT_GPIO8_MASK	= EVENT_FLAG_MAKE(3, kD2045_EVENT_D_GPIO8),
	kDIALOG_EVENT_GPIO9_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO9),
	kDIALOG_EVENT_GPIO10_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO10),
	kDIALOG_EVENT_GPIO11_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO11),
	kDIALOG_EVENT_GPIO12_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO12),
	kDIALOG_EVENT_GPIO13_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO13),
	kDIALOG_EVENT_GPIO14_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO14),
	kDIALOG_EVENT_GPIO15_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO15),
	kDIALOG_EVENT_GPIO16_MASK	= EVENT_FLAG_MAKE(4, kD2045_EVENT_E_GPIO16),

	kDIALOG_EVENT_HOLD_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BTN2_DBL),
	kDIALOG_EVENT_MENU_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BTN1_DBL),
	kDIALOG_EVENT_RINGER_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2045_EVENT_B_BTN3_DBL),

	kDIALOG_EVENT_VHP_DET_MASK	= kDIALOG_NOTEXIST_MASK,
	kDIALOG_EVENT_ON_MASK		= kDIALOG_NOTEXIST_MASK,
	kDIALOG_EVENT_LDO2_EN_MASK	= kDIALOG_NOTEXIST_MASK,
	kDIALOG_EVENT_GPIO17_MASK	= kDIALOG_NOTEXIST_MASK,
	kDIALOG_EVENT_GPIO18_MASK	= kDIALOG_NOTEXIST_MASK,
};

enum {
	kDIALOG_STATUS_USB_MASK		= STATUS_FLAG_MAKE(0, kD2045_STATUS_A_VCENTER_DET),
	kDIALOG_STATUS_VBUS_MASK	= STATUS_FLAG_MAKE(0, kD2045_STATUS_A_VBUS_EXT_DET),
	kDIALOG_STATUS_FW_MASK		= kDIALOG_NOTEXIST_MASK,
	kDIALOG_STATUS_ACC_DET_MASK	= STATUS_FLAG_MAKE(0, kD2045_STATUS_A_ACC_DET),
	kDIALOG_STATUS_CHARGING_MASK	= STATUS_FLAG_MAKE(3, kD2045_STATUS_C_CHG_PRE | kD2045_STATUS_C_CHG_FAST),
	kDIALOG_STATUS_CHG_TO_MASK	= STATUS_FLAG_MAKE(2, kD2045_STATUS_C_CHG_TIMEOUT),
	kDIALOG_STATUS_CHG_END_MASK	= STATUS_FLAG_MAKE(2, kD2045_STATUS_C_CHG_END),
	kDIALOG_STATUS_TBAT_MASK	= STATUS_FLAG_MAKE(0, kD2045_STATUS_A_TBAT),
	kDIALOG_STATUS_CHG_ATT_MASK     = STATUS_FLAG_MAKE(12, kD2045_STATUS_M_CHG_ATT),
	kDIALOG_STATUS_ABCC_MASK	= STATUS_FLAG_MAKE(2, kD2045_STATUS_C_CHG_ABCC_ACT),
#define	kDIALOG_STATUS_GPIO_MASK(gpio)	  STATUS_FLAG_MAKE(3 + ((gpio)/8), (1 << ((gpio) % 8)))
};

static const statusRegisters kDialogStatusFWMask = {0, 0, 0, 0, 0, 0};
static const statusRegisters kDialogStatusChargingMask = {0, 0, kD2045_STATUS_C_CHG_PRE | kD2045_STATUS_C_CHG_FAST };

enum {
	kD2045_EVENT_A_WAKEMASK = (kD2045_EVENT_A_VBUS_EXT_DET |
				   kD2045_EVENT_A_VCENTER_DET |
				   kD2045_EVENT_A_ACC_DET),
	kD2045_EVENT_B_WAKEMASK = (kD2045_EVENT_B_BUTTON_1 |
				   kD2045_EVENT_B_BUTTON_2 |
				   kD2045_EVENT_B_BUTTON_3 |
				   kD2045_EVENT_B_BUTTON_4),
	kD2045_EVENT_C_WAKEMASK = 0,
	kD2045_EVENT_D_WAKEMASK = 0,
	kD2045_EVENT_E_WAKEMASK = 0,
	kD2045_EVENT_F_WAKEMASK = 0,
	kD2045_EVENT_G_WAKEMASK = 0,
	kD2045_EVENT_H_WAKEMASK = 0,
	kD2045_EVENT_I_WAKEMASK = 0,
	kD2045_EVENT_J_WAKEMASK = 0,
	kD2045_EVENT_K_WAKEMASK = 0,
	kD2045_EVENT_L_WAKEMASK = kD2045_EVENT_L_ALARM,
};

// All events that are masked during shutdown - inverse of the wake mask,
// events that wake up the system
static const eventRegisters kDialogEventIntMasks = {
	~kD2045_EVENT_A_WAKEMASK,
	~kD2045_EVENT_B_WAKEMASK,
	~kD2045_EVENT_C_WAKEMASK,
	~kD2045_EVENT_D_WAKEMASK,
	~kD2045_EVENT_E_WAKEMASK,
	~kD2045_EVENT_F_WAKEMASK,
	~kD2045_EVENT_G_WAKEMASK,
	~kD2045_EVENT_H_WAKEMASK,
	~kD2045_EVENT_I_WAKEMASK,
	~kD2045_EVENT_J_WAKEMASK,
	~kD2045_EVENT_K_WAKEMASK,
	~kD2045_EVENT_L_WAKEMASK,
};


// All wake events without the buttons
static const eventRegisters kDialogEventNotButtonMasks = {
	kD2045_EVENT_A_WAKEMASK,
	kD2045_EVENT_B_WAKEMASK & ~kDIALOG_EVENT_BUTTONS,
	kD2045_EVENT_C_WAKEMASK,
	kD2045_EVENT_D_WAKEMASK,
	kD2045_EVENT_E_WAKEMASK,
	kD2045_EVENT_F_WAKEMASK,
	kD2045_EVENT_G_WAKEMASK,
	kD2045_EVENT_H_WAKEMASK,
	kD2045_EVENT_I_WAKEMASK,
	kD2045_EVENT_J_WAKEMASK,
	kD2045_EVENT_K_WAKEMASK,
	kD2045_EVENT_L_WAKEMASK,
};

// All events indicating external power supply
static const eventRegisters kDialogEventPwrsupplyMask = {
	kD2045_EVENT_A_VBUS_EXT_DET | kD2045_EVENT_A_VCENTER_DET,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
};

static const eventRegisters kDialogEventUSBMask = {
	// only include VCENTER_DET; VBUS can come and go while charger still usable
	kD2045_EVENT_A_VCENTER_DET,
	0,
	kD2045_EVENT_C_CHG_ABCC_ACT,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
};

static const eventRegisters kDialogEventFWMask = {
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
};

enum {
	kDialogEventPwrsupplyCount = 2,
	kDialogEventUSBCount = 2,
	kDialogEventFWCount = 0,
};

enum {
	kDIALOG_SYS_CONTROL_STANDBY		= (1 << 0),
	kDIALOG_SYS_CONTROL_HIBERNATE		= (1 << 1),
	kDIALOG_SYS_CONTROL_BAT_PWR_SUSPEND	= (1 << 2),
	kDIALOG_SYS_CONTROL_HIB_CLK		= (1 << 4),
	kDIALOG_SYS_CONTROL_PROT_FET_DIS	= (1 << 5),
	kDIALOG_SYS_CONTROL_BUS_PWR_SUSPEND	= (1 << 6),
	kDIALOG_SYS_CONTROL_CHRG_CONTROLS	= kDIALOG_SYS_CONTROL_BAT_PWR_SUSPEND
						| kDIALOG_SYS_CONTROL_BUS_PWR_SUSPEND,
	kDIALOG_SYS_CONTROL_HIBERNATE_ALWAYS    = kDIALOG_SYS_CONTROL_HIBERNATE,
};

enum {
	kDIALOG_SYS_CONTROL2_DWI_EN		= (1 << 0),
	kDIALOG_SYS_CONTROL2_DWI_TEST_EN	= (1 << 1),
	kDIALOG_SYS_CONTROL2_HIB_32K		= (1 << 4),
};

enum {
	// FAULT_LOG1
	kDIALOG_FAULT_LOG_WDOG		= FAULTLOG_FLAG_MAKE(0, (1 << 7)),
	kDIALOG_FAULT_LOG_RESET_IN_3	= FAULTLOG_FLAG_MAKE(0, (1 << 6)),
	kDIALOG_FAULT_LOG_RESET_IN_2	= FAULTLOG_FLAG_MAKE(0, (1 << 5)),
	kDIALOG_FAULT_LOG_RESET_IN_1	= FAULTLOG_FLAG_MAKE(0, (1 << 4)),
	kDIALOG_FAULT_LOG_RST		= FAULTLOG_FLAG_MAKE(0, (1 << 3)),
	kDIALOG_FAULT_LOG_POR		= FAULTLOG_FLAG_MAKE(0, (1 << 2)),
	kDIALOG_FAULT_LOG_OVER_TEMP	= FAULTLOG_FLAG_MAKE(0, (1 << 1)),
	kDIALOG_FAULT_LOG_VDD_UNDER	= FAULTLOG_FLAG_MAKE(0, (1 << 0)),
	// FAULT_LOG2
	kDIALOG_FAULT_LOG_BTN_SHUTDOWN      = FAULTLOG_FLAG_MAKE(1, (1 << 2)),
	kDIALOG_FAULT_LOG_TWO_FINGER_RESET  = FAULTLOG_FLAG_MAKE(1, (1 << 1)),
	kDIALOG_FAULT_LOG_NTC_SHDN          = FAULTLOG_FLAG_MAKE(1, (1 << 0)),
};

enum {
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_MIN  = 0x00,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_100  = 0x03,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_200  = 0x0d,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_500  = 0x2b,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_1000 = 0x5d,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_2000 = 0xc1,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_MAX  = 0xff,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_MASK = 0xff,
};

enum {
	kDIALOG_CHARGE_BUCK_CONTROL_MIN		   = 70,
	kDIALOG_CHARGE_BUCK_CONTROL_STEP_PER_100MA = 10,
	kDIALOG_CHARGE_BUCK_CONTROL_MAX		   = 2620,
};


enum {
	kDIALOG_CHARGE_CONTROL_A_ISET_BAT_MASK	 = 0x3f,
	kDIALOG_CHARGE_CONTROL_A_ISET_BAT_SHIFT  = 0,
	kDIALOG_OTP_ISET_BAT_SHIFT		= kDIALOG_CHARGE_CONTROL_A_ISET_BAT_SHIFT,
	kDIALOG_CHARGE_CONTROL_B_CHG_SUSP	= (1 << 6),
	kDIALOG_CHARGE_CONTROL_B_CHG_HIB	= (1 << 7),
	kDIALOG_CHARGE_CONTROL_CHG_HIB		= kDIALOG_CHARGE_CONTROL_B_CHG_HIB,
};

enum {
	kDIALOG_CHARGE_CONTROL_STEP		= 30,
	kDIALOG_CHARGE_CONTROL_MAX		= kDIALOG_CHARGE_CONTROL_A_ISET_BAT_MASK * kDIALOG_CHARGE_CONTROL_STEP,
};

enum {
	kDIALOG_CHARGE_CONTROL_ALT_USB_DIS	= (1 << 6),
	kDIALOG_CHARGE_CONTROL_CHG_BUCK_EN	= (1 << 7),
};

enum {
	kDIALOG_CHARGE_CONTROL_TIME_TCTR_MASK	    = 0xF0,
	kDIALOG_CHARGE_CONTROL_TIME_TCTR_DISABLED   = 0x00,
	kDIALOG_CHARGE_CONTROL_TIME_PCTR_MASK	    = 0x07,
	kDIALOG_CHARGE_CONTROL_TIME_PCTR_DISABLED   = 0x00,
};

enum {
	kDIALOG_ADC_LSB_ADC_OVL			= (1 << 7),
	kDIALOG_ADC_LSB_MANADC_ERROR		= (1 << 6),
};

enum {
	kDIALOG_ADC_CONTROL_MUX_SEL_MASK	= (0x1f << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_VDD_OUT	= (0x0 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ICH		= (0x1 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_TBAT	= (0x2 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ACC_ID	= (0x3 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_VBAT	= (0x4 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_LG	= (0x5 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BRICK_ID	= (0x6 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IN7	= (0x7 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_TJUNC	= (0x8 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG	= (0x9 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_VIBUS	= kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG,
	kDIALOG_ADC_CONTROL_MUX_SEL_NTC0	= (0xa << 0),
	kDIALOG_ADC_CONTROL_MUX_NUM_NTC		= 5,
	kDIALOG_ADC_CONTROL_MUX_SEL_VBUS	= (0xf << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG_OFF	= (16 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_LG_OFF	= (17 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_LDO5_TEMP	= (18 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_LOADSW_TEMP	= (19 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_VCENTER_TEMP	= (20 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_CHG_TEMP	= (21 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK0_TEMP	= (22 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK2_TEMP	= (23 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK3_TEMP	= (24 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK4_TEMP	= (25 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_TINT_START	= kDIALOG_ADC_CONTROL_MUX_SEL_LDO5_TEMP,
	kDIALOG_ADC_CONTROL_MUX_SEL_TINT_END	= kDIALOG_ADC_CONTROL_MUX_SEL_BUCK4_TEMP,
	kDIALOG_ADC_CONTROL_MAN_CONV		= (1 << 7),
	kDIALOG_ADC_CONTROL2_IBUS_EN		= (1 << 0),
	kDIALOG_ADC_CONTROL2_ADC_REF_EN		= (1 << 6),
	kDIALOG_ADC_CONTROL2_AUTO_VDD_OUT_EN	= (1 << 7),
};

enum {
	kDIALOG_ADC_CONTROL_DEFAULTS	= 0,
	kDIALOG_ADC_CONTROL2_DEFAULTS	= 0,
};

enum {
	kDIALOG_ADC_RESOLUTION_BITS	= 12,
	kDIALOG_ADC_FULL_SCALE_MV	= 2500,
	kDIALOG_ADC_BRICK_ID_OFFSET_MV	= 40,
};

enum {
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_MASK	= (0x3f << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_APP_MUX_A	= (0 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_APP_MUX_B	= (2 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO1	= (4 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO1	= (5 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO2	= (6 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO2	= (7 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO3	= (8 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO3	= (9 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO4	= (10 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO4	= (11 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO5	= (12 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO5	= (13 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO6	= (14 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO6	= (15 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO7	= (16 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO7	= (17 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO8	= (18 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO8	= (19 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO9	= (20 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO9	= (21 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO10	= (22 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO10	= (23 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO11	= (24 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO11	= (25 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO12	= (26 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO12	= (27 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO13	= (28 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO13	= (29 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VRTC	= (36 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_IRTC	= (37 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK0	= (40 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK1	= (42 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK2	= (44 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK3	= (46 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK4	= (48 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK5	= (50 << 0),
	kDIALOG_BIST_ADC_CTRL_MAN_CONV		= (1 << 7),
};

enum {
	kDIALOG_APP_TMUX_SEL_MASK		= (7 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_0		= (0 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_1		= (1 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_2		= (2 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_3		= (3 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_4		= (4 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_5		= (5 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_6		= (6 << 0),
	kDIALOG_APP_TMUX_SEL_AMUX_7		= (7 << 0),
	KDIALOG_APP_TMUX_EN			= (1 << 7),
};

enum {
	kDIALOG_RTC_CONTROL_MONITOR		= (1 << 0),
	kDIALOG_RTC_CONTROL_ALARM_EN		= (1 << 6),
};

enum {
	kDIALOG_SYS_GPIO_OUTPUT_LEVEL_LOW		= (0 << 1),
	kDIALOG_SYS_GPIO_OUTPUT_LEVEL_HIGH		= (1 << 1),

	kDIALOG_SYS_GPIO_INPUT_WAKE			= (1 << 1),

	kDIALOG_SYS_GPIO_DIRECTION_MASK			= (7 << 5),
	kDIALOG_SYS_GPIO_DIRECTION_OUT			= (0 << 5),
	kDIALOG_SYS_GPIO_DIRECTION_OUT_32KHZ		= (2 << 5),
	kDIALOG_SYS_GPIO_DIRECTION_IN_LEVEL_HIGH	= (3 << 5),
	kDIALOG_SYS_GPIO_DIRECTION_IN_LEVEL_LOW		= (4 << 5),
};

#define IS_GPIO_OUTPUT(gpio) (((gpio)&kDIALOG_SYS_GPIO_DIRECTION_MASK) \
				< kDIALOG_SYS_GPIO_DIRECTION_IN_LEVEL_HIGH)

#define NUM_LDOS 19
// <rdar://problem/12375602> LDO settings for Amber-A1
static const struct ldo_params ldo_d2045[NUM_LDOS] = {
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO1_VSEL,	 kD2045_ACTIVE3, 0x02 },	// LDO1
	{ 1200, 5,  0xff, 0xff, 0x04, kD2045_LDO2_VSEL,	 kD2045_ACTIVE3, 0x04 },	// LDO2
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO3_VSEL,	 kD2045_ACTIVE3, 0x08 },	// LDO3
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO4_VSEL,	 kD2045_ACTIVE3, 0x10 },	// LDO4
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO5_VSEL,	 kD2045_ACTIVE3, 0x20 },	// LDO5
	{ 1200, 25, 0x7f, 0x7f, 0x40, kD2045_LDO6_VSEL,	 kD2045_ACTIVE3, 0x40 },	// LDO6
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO7_VSEL,	 kD2045_ACTIVE3, 0x80 },	// LDO7
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO8_VSEL,	 kD2045_ACTIVE4, 0x01 },	// LDO8
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO9_VSEL,	 kD2045_ACTIVE4, 0x02 },	// LDO9
	{ 600,  12, 0xff, 0xff, 0x00, kD2045_LDO10_VSEL, kD2045_ACTIVE4, 0x04 },	// LDO10 - actually 12.5mv steps (FIXME)
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO11_VSEL, kD2045_ACTIVE4, 0x08 },	// LDO11
	{ 0,	0,  0,	  0,	0x00, 0,		 kD2045_ACTIVE4, 0x00 },	// there is no LDO12
	{ 600, 25, 0x7f, 0x7f, 0x00, kD2045_LDO13_VSEL, kD2045_ACTIVE4, 0x20 },	// LDO13

	{ 0,    0,  0,    0,    0x00, 0,		kD2045_ACTIVE6, 0x01 },		// 14 - BUCK3_SW1_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2045_ACTIVE6, 0x02 },		// 15 - BUCK3_SW2_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2045_ACTIVE6, 0x04 },		// 16 - BUCK3_SW3_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2045_ACTIVE6, 0x10 },		// 17 - BUCK4_SW1_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2045_ACTIVE6, 0x20 },		// 18 - BUCK4_SW2_EN

	{ 0,    0,  0,    0,    0x00, 0,		kD2045_HIBERNATE3, 0x40 },	// 19 - set LDO6_EN in HIB
};
#define LDOP ldo_d2045

enum {
	kDIALOG_VIB_CTRL_PWM_EN			= (1 << 0),
	kDIALOG_VIB_CTRL_BRAKE			= (1 << 1),
	kDIALOG_VIB_CTRL_PWM_CLK_MASK		= (3 << 2),
	kDIALOG_VIB_CTRL_PWM_CLK_2MHZ		= (0 << 2),
	kDIALOG_VIB_CTRL_PWM_CLK_1MHZ		= (1 << 2),
	kDIALOG_VIB_CTRL_PWM_CLK_500KHZ		= (2 << 2),

	kDIALOG_VIB_VSET_MASK			= (0x3f << 0),
};

enum {
	kDIALOG_SYS_CONFIG_WDOG_EN		= (1 << 0),

	kDIALOG_SYS_CONFIG_WDOG_MODE_100MS	= (0 << 1),
	kDIALOG_SYS_CONFIG_WDOG_MODE_250MS	= (1 << 1),
	kDIALOG_SYS_CONFIG_WDOG_MODE_500MS	= (2 << 1),
	kDIALOG_SYS_CONFIG_WDOG_MODE_1000MS	= (3 << 1),

	kDIALOG_SYS_CONFIG_RESET_TIMER_MASK	= (3 << 3),
	kDIALOG_SYS_CONFIG_RESET_TIMER_4S	= (0 << 3),
	kDIALOG_SYS_CONFIG_RESET_TIMER_6S	= (1 << 3),
	kDIALOG_SYS_CONFIG_RESET_TIMER_8S	= (2 << 3),
	kDIALOG_SYS_CONFIG_RESET_TIMER_10S	= (3 << 3),
	
	kDIALOG_SYS_CONFIG_WDOG_ACTIVE		= (1 << 5),
};

enum {
	kDIALOG_BUTTON_DBL_CLICK_RATE_MASK	= (7 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_50MS	= (0 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_100MS	= (1 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_150MS	= (2 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_200MS	= (3 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_250MS	= (4 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_300MS	= (5 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_350MS	= (6 << 0),
	kDIALOG_BUTTON_DBL_CLICK_RATE_400MS	= (7 << 0),
	kD2045_BUTTON_DBL_BTN1_DBL_EN		= (1 << 3),
	kD2045_BUTTON_DBL_BTN2_DBL_EN		= (1 << 4),
	kD2045_BUTTON_DBL_BTN3_DBL_EN		= (1 << 5),
	kD2045_BUTTON_DBL_BTN4_DBL_EN		= (1 << 6),
	kDIALOG_BUTTON_DBL_HOLD_DBL_EN		= kD2045_BUTTON_DBL_BTN2_DBL_EN,
	kDIALOG_BUTTON_DBL_MENU_DBL_EN		= kD2045_BUTTON_DBL_BTN1_DBL_EN,
	kDIALOG_BUTTON_DBL_RINGER_DBL_EN	= kD2045_BUTTON_DBL_BTN3_DBL_EN,
};

#endif /* __DIALOG_D2045_H */
