/*
 * Copyright (C) 2013 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_D2207_H
#define __DIALOG_D2207_H

#define PMU_HAS_SWI		0
#define PMU_HAS_DWI		1
#define PMU_HAS_LCM_LDO		1
#define PMU_HAS_BIST_ADC	1
#define PMU_HAS_CHG_ABCC_FLAG	1
#define PMU_HAS_VIB		0
#define PMU_HAS_RAM		1
#define PMU_HAS_WLED		1
#define PMU_HAS_32K_RTC		1
// <rdar://problem/12671876>:
#define PMU_HAS_ACCUMULATORS	0
#define PMU_HAS_SYS		1
#define PMU_HAS_WDT		1
#define PMU_HAS_CHARGER		1

enum {
	kDIALOG_ADDR_R		= 0x79,
	kDIALOG_ADDR_W		= 0x78,
	kDIALOG_REG_BYTES	= 2,
};

enum {
	kDIALOG_EVENT_COUNT		= 14,
	kDIALOG_STATUS_COUNT		= 13,
	kDIALOG_FAULTLOG_COUNT		= 2,
	kDIALOG_CHIPID_COUNT		= 4,
	kDIALOG_GPIO_COUNT		= 21,
};

#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,
	kD2207_SYS_CONF_B		= 0x0021,
	kD2207_SYS_CONF_C		= 0x0022,
	kD2207_SYS_CONF_D		= 0x0023,
	kD2207_DWI_CONF			= 0x0024,
	kD2207_BG_TRIM			= 0x0025,
	KD2207_BG_TC_TRIM		= 0x0026,
	kD2207_VREF_AUX_TRIM		= 0x0027,
	kD2207_VRTC_BG_TRIM		= 0x0028,
	kD2207_VDD_FAULT		= 0x0029,
	kD2207_PRE_UVLO_ADJ		= 0x002a,
	kD2207_PRE_UVLO_ADJ_ACTUAL	= 0x002b,
	kD2207_PRE_UVLO_CONF		= 0x002c,
	kD2207_PRE_UVLO_CNT		= 0x002d,
	kD2207_RTC_CTRL0		= 0x002e,
	kD2207_RTC_CTRL1		= 0x002f,
	kD2207_OSC_CTRL0		= 0x0030,
	kD2207_OSC_TRIM			= 0x0031,
	kD2207_CLK_REQ_FRC		= 0x0032,
	kD2207_UOV_CONTROL		= 0x0033,
	kD2207_UOV_BLANK_CONTROL	= 0x0034,

	kDIALOG_FAULT_LOG		= 0x0040,
	kDIALOG_FAULT_LOG2		= 0x0041,
	kD2207_BUCK_0_3_OUV		= 0x0042,
	kD2207_BUCK_4_6_OUV		= 0x0043,
	kD2207_LDO_1_4_OUV		= 0x0044,
	kD2207_LDO_5_8_OUV		= 0x0045,
	kD2207_LDO_9_12_OUV		= 0x0046,
	kD2207_LDO_13_14_OUV		= 0x0047,
	
	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_EVENT_M			= 0x005c,
	kDIALOG_EVENT_N			= 0x005d,

	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,
	kDIALOG_IRQ_MASK_M		= 0x007C,
	kDIALOG_IRQ_MASK_N		= 0x007D,

	kD2207_ACTIVE1			= 0x0080,
	kD2207_ACTIVE2			= 0x0081,
	kD2207_ACTIVE3			= 0x0082,
	kD2207_ACTIVE4			= 0x0083,
	kD2207_ACTIVE5			= 0x0084,
	kDIALOG_LCM_ACTIVE		= kD2207_ACTIVE5,
	kD2207_ACTIVE6			= 0x0085,
	kD2207_ACTIVE7			= 0x0086,
	kD2207_STANDBY1			= 0x0088,
	kD2207_STANDBY3			= 0x008a,
	kD2207_STANDBY4			= 0x008b,
	kD2207_STANDBY6			= 0x008d,
	kD2207_STANDBY7			= 0x008e,
	kD2207_HIBERNATE1		= 0x0090,
	kD2207_HIBERNATE3		= 0x0092,
	kD2207_HIBERNATE4		= 0x0093,
	kD2207_HIBERNATE6		= 0x0095,
	kD2207_HIBERNATE7		= 0x0096,

//--
	
	kD2207_SLOT_TIMINGS_PWR_UP1	= 0x00a0,
	kD2207_SLOT_TIMINGS_PWR_DN1	= 0x00a1,
	kD2207_SLOT_TIMINGS_PWR_UP2	= 0x00a2,
	kD2207_SLOT_TIMINGS_PWR_DN2	= 0x00a3,
	kD2207_ACT_TO_HIB_DLY		= 0x00a4,
	kD2207_BUCK0_SLOT		= 0x00b0,
	kD2207_BUCK1_SLOT		= 0x00b1,
	kD2207_BUCK2_SLOT		= 0x00b2,
	kD2207_BUCK3_SLOT		= 0x00b3,
	kD2207_BUCK4_SLOT		= 0x00b4,
	kD2207_BUCK5_SLOT		= 0x00b5,
	kD2207_BUCK6_SLOT		= 0x00b6,

	kD2207_LDO1_SLOT		= 0x00c1,
	kD2207_LDO2_SLOT		= 0x00c2,
	kD2207_LDO3_SLOT		= 0x00c3,
	kD2207_LDO4_SLOT		= 0x00c4,
	kD2207_LDO5_SLOT		= 0x00c5,
	kD2207_LDO6_SLOT		= 0x00c6,
	kD2207_LDO7_SLOT		= 0x00c7,
	kD2207_LDO8_SLOT		= 0x00c8,
	kD2207_LDO9_SLOT		= 0x00c9,
	kD2207_LDO10_SLOT		= 0x00ca,
	kD2207_LDO11_SLOT		= 0x00cb,
	//kD2207_LDO12_SLOT		= 0x00cc, Does not exist
	kD2207_LDO13_SLOT		= 0x00cd,
	kD2207_LDO14_SLOT		= 0x00ce,
	
	kD2207_LCM_BOOST_SW_SLOT	= 0x00d0,
	kD2207_LCM_BOOST_SLOT		= 0x00d1,
	kD2207_LCM_LDO1_SLOT		= 0x00d2,
	kD2207_LCM_LDO2_SLOT		= 0x00d3,
	kD2207_LCM_LDO3_SLOT		= 0x00d4,
	
	kD2207_CHARGE_PUMP_SLOT		= 0x00d8,
	kD2207_BUCK3_SW1_SLOT		= 0x00d9,
	kD2207_BUCK3_SW2_SLOT		= 0x00da,
	kD2207_BUCK3_SW3_SLOT		= 0x00db,
	kD2207_BUCK4_SW1_SLOT		= 0x00dc,
	kD2207_BUCK4_SW2_SLOT		= 0x00dd,
	kD2207_GPIO_18_SLOT		= 0x00de,
	kD2207_GPIO_19_SLOT		= 0x00df,
	kD2207_GPIO_20_SLOT		= 0x00e0,
	kD2207_GPIO_21_SLOT		= 0x00e1,

	kD2207_BUCK_DWI_CTRL0		= 0x00f0,
	kD2207_BUCK_DWI_TRIM0		= 0x00f2,
	kD2207_BUCK_FSM_TRIM0		= 0x00f4,
	kD2207_BUCK_FSM_TRIM1		= 0x00f5,
	kD2207_BUCK_FSM_TRIM2		= 0x00f6,
	kD2207_BUCK_FSM_TRIM3		= 0x00f7,
	
	kD2207_BUCK_HIGHDVC_CALIB_OFFSET_TRIM	= 0x00f8,
	kD2207_BUCK_CPI_CLOCK_SEL	= 0x00f9,
	kD2207_BUCK_OFFSET_SEL		= 0x00fa,
	kD2207_BUCK_OFFSET_EN		= 0x00fb,

	kD2207_BUCK0_VSEL		= 0x0100,
	kD2207_BUCK0_VSEL_ACTUAL	= 0x0102,
	kD2207_BUCK0_DEBUG_OFFSET	= 0x0103,
	kD2207_BUCK0_MINV		= 0x0104,
	kD2207_BUCK0_MAXV		= 0x0105,
	kD2207_BUCK0_OFS_V		= 0x0106,
	kD2207_BUCK0_MODE		= 0x0107,
	kD2207_BUCK0_START_ILIMIT	= 0x0108,
	kD2207_BUCK0_SYNC_ILIMIT	= 0x0109,
	kD2207_BUCK0_SLEEP_ILIMIT	= 0x010a,
	kD2207_BUCK0_FSM_TRIM0		= 0x010b,
	kD2207_BUCK0_FSM_TRIM1		= 0x010c,
	kD2207_BUCK0_FSM_TRIM2		= 0x010d,
	kD2207_BUCK0_FSM_TRIM3		= 0x010e,
	kD2207_BUCK0_FSM_TRIM4		= 0x010f,
	kD2207_BUCK0_CLK_TRIM1		= 0x0110,
	kD2207_BUCK0_CLK_TRIM2		= 0x0111,
	kD2207_BUCK0_CLK_TRIM3		= 0x0112,
	kD2207_BUCK0_CALIB0		= 0x0115,
	kD2207_BUCK0_CALIB1		= 0x0116,
	kD2207_BUCK0_ANA_TRIM0		= 0x0117,
	kD2207_BUCK0_ANA_TRIM1		= 0x0118,
	kD2207_BUCK0_ANA_TRIM2		= 0x0119,
	kD2207_BUCK0_ANA_TRIM3		= 0x011a,
	kD2207_BUCK0_ANA_TRIM4		= 0x011b,
	kD2207_BUCK0_ANA_TRIM5		= 0x011c,
	kD2207_BUCK0_ANA_TRIM6		= 0x011d,
	kD2207_BUCK0_ANA_TRIM7		= 0x011e,
	kD2207_BUCK0_ANA_TRIM8		= 0x011f,
	kD2207_BUCK0_ANA_TRIM9		= 0x0120,
	kD2207_BUCK0_ANA_TRIM10		= 0x0121,
	
	kD2207_BUCK1_VSEL		= 0x0128,
	kD2207_BUCK1_VSEL_ACTUAL	= 0x012a,
	kD2207_BUCK1_DEBUG_OFFSET	= 0x012b,
	kD2207_BUCK1_MINV		= 0x012c,
	kD2207_BUCK1_MAXV		= 0x012d,
	kD2207_BUCK1_OFS_V		= 0x012e,
	kD2207_BUCK1_MODE		= 0x012f,
	kD2207_BUCK1_START_ILIMIT	= 0x0130,
	kD2207_BUCK1_SYNC_ILIMIT	= 0x0131,
	kD2207_BUCK1_SLEEP_ILIMIT	= 0x0132,
	kD2207_BUCK1_FSM_TRIM0		= 0x0133,
	kD2207_BUCK1_FSM_TRIM1		= 0x0134,
	kD2207_BUCK1_FSM_TRIM2		= 0x0135,
	kD2207_BUCK1_FSM_TRIM3		= 0x0136,
	kD2207_BUCK1_FSM_TRIM4		= 0x0137,
	kD2207_BUCK1_CLK_TRIM1		= 0x0138,
	kD2207_BUCK1_CLK_TRIM2		= 0x0139,
	kD2207_BUCK1_CLK_TRIM3		= 0x013a,
	kD2207_BUCK1_CALIB0		= 0x013d,
	kD2207_BUCK1_CALIB1		= 0x013e,
	kD2207_BUCK1_ANA_TRIM0		= 0x013f,
	kD2207_BUCK1_ANA_TRIM1		= 0x0140,
	kD2207_BUCK1_ANA_TRIM2		= 0x0141,
	kD2207_BUCK1_ANA_TRIM3		= 0x0142,
	kD2207_BUCK1_ANA_TRIM4		= 0x0143,
	kD2207_BUCK1_ANA_TRIM5		= 0x0144,
	kD2207_BUCK1_ANA_TRIM6		= 0x0145,
	kD2207_BUCK1_ANA_TRIM7		= 0x0146,
	kD2207_BUCK1_ANA_TRIM9		= 0x0148,
	
	kD2207_BUCK2_VSEL		= 0x0150,
	kD2207_BUCK2_VSEL_ACTUAL	= 0x0152,
	kD2207_BUCK2_DEBUG_OFFSET	= 0x0153,
	kD2207_BUCK2_MINV		= 0x0154,
	kD2207_BUCK2_MAXV		= 0x0155,
	kD2207_BUCK2_OFS_V		= 0x0156,
	kD2207_BUCK2_MODE		= 0x0157,
	kD2207_BUCK2_START_ILIMIT	= 0x0158,
	kD2207_BUCK2_SYNC_ILIMIT	= 0x0159,
	kD2207_BUCK2_SLEEP_ILIMIT	= 0x015a,
	kD2207_BUCK2_FSM_TRIM0		= 0x015b,
	kD2207_BUCK2_FSM_TRIM1		= 0x015c,
	kD2207_BUCK2_FSM_TRIM2		= 0x015d,
	kD2207_BUCK2_FSM_TRIM3		= 0x015e,
	kD2207_BUCK2_FSM_TRIM4		= 0x015f,
	kD2207_BUCK2_CLK_TRIM		= 0x0160,
	kD2207_BUCK2_CALIB0		= 0x0163,
	kD2207_BUCK2_ANA_TRIM0		= 0x0165,
	kD2207_BUCK2_ANA_TRIM1		= 0x0166,
	kD2207_BUCK2_ANA_TRIM2		= 0x0167,
	kD2207_BUCK2_ANA_TRIM3		= 0x0168,
	kD2207_BUCK2_ANA_TRIM4		= 0x0169,
	kD2207_BUCK2_ANA_TRIM5		= 0x016a,
	kD2207_BUCK2_ANA_TRIM6		= 0x016b,

	kD2207_BUCK3_VSEL		= 0x0178,
	kD2207_BUCK3_VSEL_ALT		= 0x0179,
	kD2207_BUCK3_VSEL_ACTUAL	= 0x017a,
	kD2207_BUCK3_DEBUG_OFFSET	= 0x017b,
	kD2207_BUCK3_MINV		= 0x017c,
	kD2207_BUCK3_MAXV		= 0x017d,
	kD2207_BUCK3_OFS_V		= 0x017e,
	kD2207_BUCK3_MODE		= 0x017f,
	kD2207_BUCK3_START_ILIMIT	= 0x0180,
	kD2207_BUCK3_SYNC_ILIMIT	= 0x0181,
	kD2207_BUCK3_SLEEP_ILIMIT	= 0x0182,
	kD2207_BUCK3_FSM_TRIM0		= 0x0183,
	kD2207_BUCK3_FSM_TRIM1		= 0x0184,
	kD2207_BUCK3_FSM_TRIM3		= 0x0186,
	kD2207_BUCK3_FSM_TRIM4		= 0x0187,
	kD2207_BUCK3_CLK_TRIM		= 0x0188,
	kD2207_BUCK3_HIGHDVC_CALIB_OFFSET_TRIM	= 0x0189,
	kD2207_BUCK3_CALIB0		= 0x018b,
	kD2207_BUCK3_ANA_TRIM0		= 0x018d,
	kD2207_BUCK3_ANA_TRIM1		= 0x018e,
	kD2207_BUCK3_ANA_TRIM2		= 0x018f,
	kD2207_BUCK3_ANA_TRIM3		= 0x0190,
	kD2207_BUCK3_ANA_TRIM4		= 0x0191,
	kD2207_BUCK3_ANA_TRIM6		= 0x0193,
	
	kD2207_BUCK4_VSEL		= 0x01a0,
	kD2207_BUCK4_VSEL_ALT		= 0x01a1,
	kD2207_BUCK4_VSEL_ACTUAL	= 0x01a2,
	kD2207_BUCK4_DEBUG_OFFSET	= 0x01a3,
	kD2207_BUCK4_MINV		= 0x01a4,
	kD2207_BUCK4_MAXV		= 0x01a5,
	kD2207_BUCK4_OFS_V		= 0x01a6,
	kD2207_BUCK4_MODE		= 0x01a7,
	kD2207_BUCK4_START_ILIMIT	= 0x01a8,
	kD2207_BUCK4_SYNC_ILIMIT	= 0x01a9,
	kD2207_BUCK4_SLEEP_ILIMIT	= 0x01aa,
	kD2207_BUCK4_FSM_TRIM0		= 0x01ab,
	kD2207_BUCK4_FSM_TRIM1		= 0x01ac,
	kD2207_BUCK4_FSM_TRIM3		= 0x01ae,
	kD2207_BUCK4_FSM_TRIM4		= 0x01af,
	kD2207_BUCK4_CLK_TRIM		= 0x01b0,
	kD2207_BUCK4_CALIB0		= 0x01b3,
	kD2207_BUCK4_ANA_TRIM0		= 0x01b5,
	kD2207_BUCK4_ANA_TRIM1		= 0x01b6,
	kD2207_BUCK4_ANA_TRIM2		= 0x01b7,
	kD2207_BUCK4_ANA_TRIM3		= 0x01b8,
	kD2207_BUCK4_ANA_TRIM4		= 0x01b9,
	kD2207_BUCK4_ANA_TRIM5		= 0x01ba,
	kD2207_BUCK4_ANA_TRIM6		= 0x01bb,
	
	kD2207_BUCK5_VSEL		= 0x01c8,
	kD2207_BUCK5_VSEL_ACTUAL	= 0x01ca,
	kD2207_BUCK5_DEBUG_OFFSET	= 0x01cb,
	kD2207_BUCK5_MINV		= 0x01cc,
	kD2207_BUCK5_MAXV		= 0x01cd,
	kD2207_BUCK5_OFS_V		= 0x01ce,
	kD2207_BUCK5_MODE		= 0x01cf,
	kD2207_BUCK5_START_ILIMIT	= 0x01d0,
	kD2207_BUCK5_SYNC_ILIMIT	= 0x01d1,
	kD2207_BUCK5_SLEEP_ILIMIT	= 0x01d2,
	kD2207_BUCK5_FSM_TRIM0		= 0x01d3,
	kD2207_BUCK5_FSM_TRIM1		= 0x01d4,
	kD2207_BUCK5_FSM_TRIM3		= 0x01d6,
	kD2207_BUCK5_FSM_TRIM4		= 0x01d7,
	kD2207_BUCK5_CLK_TRIM		= 0x01d8,
	kD2207_BUCK5_HIGHDVC_CALIB_OFFSET_TRIM	= 0x01d9,
	kD2207_BUCK5_CALIB0		= 0x01db,
	kD2207_BUCK5_ANA_TRIM0		= 0x01dd,
	kD2207_BUCK5_ANA_TRIM1		= 0x01de,
	kD2207_BUCK5_ANA_TRIM2		= 0x01df,
	kD2207_BUCK5_ANA_TRIM3		= 0x01e0,
	kD2207_BUCK5_ANA_TRIM4		= 0x01e1,
	kD2207_BUCK5_ANA_TRIM5		= 0x01e2,
	
	kD2207_BUCK6_VSEL		= 0x01f0,
	kD2207_BUCK6_VSEL_ACTUAL	= 0x01f2,
	kD2207_BUCK6_DEBUG_OFFSET	= 0x01f3,
	kD2207_BUCK6_MINV		= 0x01f4,
	kD2207_BUCK6_MAXV		= 0x01f5,
	kD2207_BUCK6_OFS_V		= 0x01f6,
	kD2207_BUCK6_MODE		= 0x01f7,
	kD2207_BUCK6_ILIMIT		= 0x01f8,
	kD2207_BUCK6_FSM_TRIM0		= 0x01f9,
	kD2207_BUCK6_FSM_TRIM2		= 0x01fb,
	kD2207_BUCK6_FSM_TRIM3		= 0x01fc,
	kD2207_BUCK6_FSM_TRIM4		= 0x01fd,
	kD2207_BUCK6_CLK_TRIM		= 0x01fe,
	kD2207_BUCK6_HIGHDVC_CALIB_OFFSET_TRIM	= 0x01ff,
	kD2207_BUCK6_CALIB0		= 0x0201,
	kD2207_BUCK6_ANA_TRIM0		= 0x0203,
	kD2207_BUCK6_ANA_TRIM1		= 0x0204,
	kD2207_BUCK6_ANA_TRIM2		= 0x0205,

// LDO Control
	
	kD2207_LDO_RTC_TRIM		= 0x0304,
	kD2207_LDO1_VSEL		= 0x0308,
	kD2207_LDO1_VSEL_ACTUAL		= 0x0309,
	kD2207_LDO1_MINV		= 0x030a,
	kD2207_LDO1_MAXV		= 0x030b,
	kD2207_LDO1_UOV_LIM		= 0x030d,
	kD2207_LDO2_VSEL		= 0x0310,
	kD2207_LDO2_VSEL_ACTUAL		= 0x0311,
	kD2207_LDO2_MINV		= 0x0312,
	kD2207_LDO2_MAXV		= 0x0313,
	kD2207_LDO2_UOV_LIM		= 0x0315,
	kD2207_LDO3_VSEL		= 0x0318,
	kD2207_LDO3_VSEL_ACTUAL		= 0x0319,
	kD2207_LDO3_MINV		= 0x031a,
	kD2207_LDO3_MAXV		= 0x031b,
	kD2207_LDO3_UOV_LIM		= 0x031d,
	kD2207_LDO4_VSEL		= 0x0320,
	kD2207_LDO4_VSEL_ACTUAL		= 0x0321,
	kD2207_LDO4_MINV		= 0x0322,
	kD2207_LDO4_MAXV		= 0x0323,
	kD2207_LDO4_UOV_LIM		= 0x0325,
	kD2207_LDO5_VSEL		= 0x0328,
	kD2207_LDO5_VSEL_ACTUAL		= 0x0329,
	kD2207_LDO5_MINV		= 0x032a,
	kD2207_LDO5_MAXV		= 0x032b,
	kD2207_LDO5_TRIM		= 0x032c,
	kD2207_LDO5_UOV_LIM		= 0x032d,
	kD2207_LDO6_VSEL		= 0x0330,
	kD2207_LDO6_VSEL_ACTUAL		= 0x0331,
	kD2207_LDO6_MINV		= 0x0332,
	kD2207_LDO6_MAXV		= 0x0333,
	kD2207_LDO6_TRIM		= 0x0334,
	kD2207_LDO6_UOV_LIM		= 0x0335,
	kD2207_LDO7_VSEL		= 0x0338,
	kD2207_LDO7_VSEL_ACTUAL		= 0x0339,
	kD2207_LDO7_MINV		= 0x033a,
	kD2207_LDO7_MAXV		= 0x033b,
	kD2207_LDO7_UOV_LIM		= 0x033d,
	kD2207_LDO8_VSEL		= 0x0340,
	kD2207_LDO8_VSEL_ACTUAL		= 0x0341,
	kD2207_LDO8_MINV		= 0x0342,
	kD2207_LDO8_MAXV		= 0x0343,
	kD2207_LDO8_UOV_LIM		= 0x0345,
	kD2207_LDO9_VSEL		= 0x0348,
	kD2207_LDO9_VSEL_ACTUAL		= 0x0349,
	kD2207_LDO9_MINV		= 0x034a,
	kD2207_LDO9_MAXV		= 0x034b,
	kD2207_LDO9_UOV_LIM		= 0x034d,
	kD2207_LDO10_VSEL		= 0x0350,
	kD2207_LDO10_VSEL_ACTUAL	= 0x0351,
	kD2207_LDO10_MINV		= 0x0352,
	kD2207_LDO10_MAXV		= 0x0353,
	kD2207_LDO10_UOV_LIM		= 0x0355,
	kD2207_LDO11_VSEL		= 0x0358,
	kD2207_LDO11_VSEL_ACTUAL	= 0x0359,
	kD2207_LDO11_MINV		= 0x035a,
	kD2207_LDO11_MAXV		= 0x035b,
	kD2207_LDO11_UOV_LIM		= 0x035d,
	kD2207_LDO12_TRIM		= 0x0364,
	kD2207_LDO13_VSEL		= 0x0368,
	kD2207_LDO13_VSEL_ACTUAL	= 0x0369,
	kD2207_LDO13_MINV		= 0x036a,
	kD2207_LDO13_MAXV		= 0x036b,
	kD2207_LDO13_UOV_LIM		= 0x036d,
	kD2207_LDO14_VSEL		= 0x0370,
	kD2207_LDO14_VSEL_ACTUAL	= 0x0371,
	kD2207_LDO14_MINV		= 0x0372,
	kD2207_LDO14_MAXV		= 0x0373,
	kD2207_LDO14_UOV_LIM		= 0x0375,

	kD2207_LCM_LDO1			= 0x0378,
	kD2207_LCM_LDO1_VSEL_ACTUAL = 0x0379,
	kD2207_LCM_LDO1_MINV	= 0x037a,
	kD2207_LCM_LDO1_MAXV	= 0x037b,
	kD2207_LCM_LDO1_TRIM	= 0x037c,
	kD2207_LCM_LDO2			= 0x0380,
	kD2207_LCM_LDO2_VSEL_ACTUAL = 0x0381,
	kD2207_LCM_LDO2_MINV	= 0x0382,
	kD2207_LCM_LDO2_MAXV	= 0x0383,
	kD2207_LCM_LDO3			= 0x0388,
	kD2207_LCM_LDO3_VSEL_ACTUAL = 0x0389,
	kD2207_LCM_LDO3_MINV	= 0x038a,
	kD2207_LCM_LDO3_MAXV	= 0x038b,
	kD2207_LDO_BYP1			= 0x0390,
	kD2207_LDO_BYP2			= 0x0391,
	kDIALOG_LDO_CONTROL		= kD2207_LDO_BYP2,

//	LCM Boost Control

	kD2207_LCM_BOOST_VSEL		=	0x0398,
	kD2207_LCM_BOOST_VSEL_ACTUAL =	0x0399,
	kD2207_LCM_BOOST_MINV		=	0x039a,
	kD2207_LCM_BOOST_MAXV		=	0x039b,
	kD2207_LCM_BOOST_CONF		=	0x039c,
	kD2207_LCM_BOOST_TRIM		=	0x039d,

//	Hibernate Switches

	kD2207_HIB_SW_CTRL		= 0x03c0,
	kD2207_HIB_SW_CTRL_2	= 0x03c1,

//	GPIO Control

	kD2207_GPIO1			= 0x0400,
	kDIALOG_SYS_GPIO_REG_START	= kD2207_GPIO1,
	kD2207_GPIO2			= 0x0401,
	kD2207_GPIO3			= 0x0402,
	kD2207_GPIO4			= 0x0403,
	kD2207_GPIO5			= 0x0404,
	kD2207_GPIO6			= 0x0405,
	kD2207_GPIO7			= 0x0406,
	kD2207_GPIO8			= 0x0407,
	kD2207_GPIO9			= 0x0408,
	kD2207_GPIO10			= 0x0409,
	kD2207_GPIO11			= 0x040a,
	kD2207_GPIO12			= 0x040b,
	kD2207_GPIO13			= 0x040c,
	kD2207_GPIO14			= 0x040d,
	kD2207_GPIO15			= 0x040e,
	kD2207_GPIO16			= 0x040f,
	kD2207_GPIO17			= 0x0410,
	kD2207_GPIO18_HIB		= 0x0411,
	kD2207_GPIO18_SBY		= 0x0412,
	kD2207_GPIO18			= 0x0413,
	kD2207_GPIO19_HIB		= 0x0414,
	kD2207_GPIO19_SBY		= 0x0415,
	kD2207_GPIO19			= 0x0416,
	kD2207_GPIO20_HIB		= 0x0417,
	kD2207_GPIO20_SBY		= 0x0418,
	kD2207_GPIO20			= 0x0419,
	kD2207_GPIO21_HIB		= 0x041a,
	kD2207_GPIO21_SBY		= 0x041b,
	kD2207_GPIO21			= 0x041c,

	kD2207_GPIO_DEB1		= 0x0420,
	kD2207_GPIO_DEB2		= 0x0421,
	kD2207_GPIO_DEB3		= 0x0422,
	kD2207_GPIO_DEB4		= 0x0423,
	kD2207_GPIO_DEB5		= 0x0424,
	kD2207_GPIO_DEB6		= 0x0425,
	kD2207_GPIO_DEB7		= 0x0426,
	kD2207_GPIO_DEB8		= 0x0427,
	kD2207_GPIO_DEB9		= 0x0428,
	kD2207_GPIO_DEB10		= 0x0429,
	kD2207_GPIO_DEB11		= 0x042a,

	kD2207_OUT_32K			= 0x0430,

//	GPI Control
	
	kD2207_BUTTON1_CONF		= 0x0440,
	kD2207_BUTTON2_CONF		= 0x0441,
	kD2207_BUTTON3_CONF		= 0x0442,
	kD2207_BUTTON4_CONF		= 0x0443,
	kDIALOG_BUTTON_DBL		= 0x0444,
	kD2207_BUTTON_WAKE		= 0x0445,
	
	kD2207_RESET_IN1_CONF		= 0x0448,
	kD2207_RESET_IN2_CONF		= 0x0449,
	kD2207_RESET_IN3_CONF		= 0x044a,
		kD2207_RIN_STD_DIS	= (0<<7),
		kD2207_RIN_HIB_DIS	= (0<<6),
		kD2207_RIN_ACT_DIS	= (0<<5),
		kD2207_RIN_POL_RISE	= (0<<4),
		kD2207_RIN_POL_FALL	= (1<<4),
		kD2207_RIN_NO_PUPD	= (0<<2),
		kD2207_RIN_PU		= (1<<2),
		kD2207_RIN_PD		= (2<<2),
		kD2207_RIN_T_DEB_10MS	= (0<<1),
		kD2207_RIN_T_DEB_100MS	= (1<<1),
		kD2207_RIN_ENABLED	= (0<<0),
		kD2207_RIN_DISABLED	= (1<<0),

//	Temperature Sensor Control

	kD2207_TDEV1_RISE		= 0x0480,
	kD2207_TDEV1_FALL		= 0x0481,
	kD2207_TDEV2_RISE		= 0x0482,
	kD2207_TDEV2_FALL		= 0x0483,
	kD2207_TDEV3_RISE		= 0x0484,
	kD2207_TDEV3_FALL		= 0x0485,
	kD2207_TDEV4_RISE		= 0x0486,
	kD2207_TDEV4_FALL		= 0x0487,
	kD2207_TDEV5_RISE		= 0x0488,
	kD2207_TDEV5_FALL		= 0x0489,
	kD2207_TDEV6_RISE		= 0x048a,
	kD2207_TDEV6_FALL		= 0x048b,
	kD2207_TDEV7_RISE		= 0x048c,
	kD2207_TDEV7_FALL		= 0x048d,
	kD2207_TDEV8_RISE		= 0x048e,
	kD2207_TDEV8_FALL		= 0x048f,
	kD2207_TLDO5_RISE		= 0x04a0,
	kD2207_TCBUCK_A_RISE	= 0x04a2,
	kD2207_TCBUCK_B_RISE	= 0x04a3,
	kD2207_TLINCHG_RISE		= 0x04a4,
	kD2207_TBUCK0_RISE		= 0x04a5,
	kD2207_TBUCK4_RISE		= 0x04a6,
	kD2207_TBUCK23_RISE		= 0x04a7,
	kD2207_TBUCK1_RISE		= 0x04a8,
	kD2207_TBUCK56_RISE		= 0x04a9,
	kD2207_TISENSE_HYST		= 0x04aa,
	kDIALOG_T_OFFSET_MSB	= 0x04ab,
	kDIALOG_T_OFFSET_LSB	= 0x04ac,

//	Charging Control
	
	kD2207_ISET_BUCK		= 0x04c0,
	kD2207_ISET_BUCK_SHADOW		= 0x04c1,
	kD2207_ISET_BUCK_ABSMAX		= 0x04c2,
	kD2207_ISET_BUCK_ACTUAL		= 0x04c3,
	kD2207_ISET_BUCK_ALT		= 0x04c4,
	kDIALOG_CHARGE_BUCK_CONTROL	= kD2207_ISET_BUCK,
	kDIALOG_CHARGE_BUCK_STATUS	= kD2207_ISET_BUCK_ACTUAL,
	kD2207_CHG_CTRL_A		= 0x04c5,
	kD2207_CHG_CTRL_B		= 0x04c6,
	kD2207_CHG_CTRL_C		= 0x04c7,
	kD2207_CHG_CTRL_D		= 0x04c8,
	kD2207_CHG_CTRL_E		= 0x04c9,
	kD2207_CHG_CTRL_F		= 0x04ca,
	kD2207_CHG_CTRL_G		= 0x04cb,
	kD2207_CHG_CTRL_H		= 0x04cc,
	kD2207_CHG_TIME			= 0x04cd,
	kD2207_CHG_TIME_PRE		= 0x04ce,
	kDIALOG_CHARGE_CONTROL_ICHG_BAT = kD2207_CHG_CTRL_B,
	kDIALOG_CHARGE_CONTROL_HIB	= kD2207_CHG_CTRL_B,
	kDIALOG_CHARGE_CONTROL_TIME	= kD2207_CHG_CTRL_D,
	kDIALOG_CHARGE_CONTROL_EN	= kD2207_CHG_CTRL_H,
	kDIALOG_OTP_ISET_BAT		= kD2207_CHG_CTRL_C,
	kDIALOG_CHARGE_STATUS	= 0x04cf,
	kD2207_CHG_VSET_TRIM	= 0x04d0,
	kD2207_IBUS_GAIN_TRIM	= 0x04d2,
	kD2207_IBUS100_OFS_TRIM	= 0x04d3,
	kD2207_IBUS500_OFS_TRIM	= 0x04d4,
	kD2207_IBUS1500_GAIN_TRIM= 0x04d5,
	kD2207_IBUS1500_OFS_TRIM= 0x04d6,
	
	kD2207_CHG_TRIM1		= 0x04d7,
	kD2207_CHG_TRIM2		= 0x04d8,
	kD2207_CHG_TRIM3		= 0x04d9,
	kD2207_CHG_TRIM4		= 0x04da,
	kD2207_CHG_TRIM5		= 0x04db,
	kD2207_ICHG_END			= 0x04dc,

	kDIALOG_TBAT_0			= 0x04dd,
	kDIALOG_TBAT_1			= 0x04de,
	kDIALOG_TBAT_2			= 0x04df,
	kDIALOG_TBAT_3			= 0x04e0,
	kDIALOG_TBAT_4			= 0x04e1,
	kDIALOG_TBAT_MAX		= 0x04e2,
	kDIALOG_ICHG_TBAT_0		= 0x04e3,
	kDIALOG_ICHG_TBAT_1		= 0x04e4,
	kDIALOG_ICHG_TBAT_2		= 0x04e5,
	kDIALOG_ICHG_TBAT_3		= 0x04e6,
	kDIALOG_ICHG_TBAT_4		= 0x04e7,
	kDIALOG_ICHG_AVG		= 0x04e8,

// GPADC Control and Results

	kDIALOG_ADC_CONTROL		= 0x0500,
	kDIALOG_ADC_CONTROL2	= 0x0501,
	kDIALOG_ADC_LSB			= 0x0502,
	kDIALOG_ADC_MSB			= 0x0503,
	kD2207_ADC_TEMP_CTRL0	= 0x0504,
	kD2207_ADC_TEMP_CTRL1	= 0x0505,
	kD2207_ADC_FSM_TRIM0	= 0x0506,
	kD2207_ADC_FSM_TRIM1	= 0x0507,
	kD2207_ADC_FSM_TRIM2	= 0x0508,
	kD2207_ADC_FSM_TRIM3	= 0x0509,
	kD2207_ADC_ANA_TRIM0	= 0x050a,
	kD2207_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,
	kD2207_IBUSCAL_1		= 0x0519,
	kD2207_IBUSCAL_2		= 0x051a,
	kD2207_IBUSCAL_3		= 0x051b,
	kD2207_IBUSCAL_4		= 0x051c,
	kD2207_IBUSCAL_5		= 0x051d,
	kD2207_IBUSCAL_6		= 0x051e,
	kD2207_IBUSCAL_7		= 0x051f,
	kD2207_IBUSCAL_8		= 0x0520,
	kD2207_IBUCK0_ACCUM1	= 0x0522,
	kD2207_IBUCK0_ACCUM2	= 0x0523,
	kD2207_IBUCK0_ACCUM3	= 0x0524,
	kD2207_IBUCK1_ACCUM1	= 0x0525,
	kD2207_IBUCK1_ACCUM2	= 0x0526,
	kD2207_IBUCK1_ACCUM3	= 0x0527,
	kDIALOG_IBUCK0_COUNT1	= 0x0528,
	kDIALOG_IBUCK0_COUNT2	= 0x0529,
	kDIALOG_IBUCK1_COUNT1	= 0x052a,
	kDIALOG_IBUCK1_COUNT2	= 0x052b,

//	BIST ADC Control and Results

	kDIALOG_APP_TMUX		= 0x0540,
	kDIALOG_BIST_ADC_CTRL		= 0x0541,
	kDIALOG_BIST_ADC_LSB		= 0x0542,
	kDIALOG_BIST_ADC_MSB		= 0x0543,
	kD2207_BIST_ADC_TRIM1		= 0x0545,
	kD2207_BIST_ADC_ANA_TRIM0	= 0x0546,

//	RTC Calendar and Alarm
	
	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,

//	WLED

	kD2207_WLED_ISET_MSB	= 0x0600,
	kD2207_WLED_ISET_LSB	= 0x0601,
	kD2207_WLED_PWM_MSB		= 0x0602,
	kD2207_WLED_PWM_LSB		= 0x0603,
	kD2207_WLED_CTRL1		= 0x0604,
	kD2207_WLED_CTRL2		= 0x0605,
	kD2207_WLED_CTRL3		= 0x0606,
	kD2207_WLED_CTRL4		= 0x0607,
	kD2207_WLED_CTRL5		= 0x0608,
	kD2207_WLED_CTRL6		= 0x0609,
	kD2207_WLED_CTRL7		= 0x060a,
	kD2207_WLED_ERR_STAT_A	= 0x060b,
	kD2207_WLED_ERR_STAT_B	= 0x060c,
	kD2207_WLED_CONF1		= 0x060d,
	kD2207_WLED_CONF2		= 0x060e,
	kD2207_WLED_CONF3		= 0x060f,
	kD2207_WLED_TRIM1		= 0x0610,
	kD2207_WLED_TRIM2		= 0x0611,
	kD2207_WLED_TRIM3		= 0x0612,
	kD2207_WLED_TRIM4		= 0x0613,
	kD2207_WLED_TRIM5		= 0x0614,
	kD2207_WLED_TRIM6		= 0x0615,
	kD2207_WLED_TRIM7		= 0x0616,
	kD2207_WLED_TRIM8		= 0x0617,
	kD2207_WLED_TRIM9		= 0x0618,
	kD2207_WLED_TRIM10		= 0x0619,
	kD2207_WLED_TRIM11		= 0x061a,
	kD2207_WLED_TRIM12		= 0x061b,
	kD2207_WLED_TRIM13		= 0x061c,
	kD2207_WLED_TRIM14		= 0x061d,

    kDIALOG_WLED_ISET       = kD2207_WLED_ISET_MSB,
    kDIALOG_WLED_ISET2      = kD2207_WLED_ISET_LSB,
    kDIALOG_WLED_CONTROL	= kD2207_WLED_CTRL1,
    kDIALOG_WLED_DWI_CONTROL= kD2207_WLED_CTRL2,
    kDIALOG_WLED_OPTIONS	= kD2207_WLED_CTRL2,

//	Reserved Spare Registers

	kD2207_SPARE_RW0		= 0x0680,
	kD2207_SPARE_RW_LAST	= 0x0687,
	kD2207_SPARE_RWTOTP0	= 0x06a0,
	kD2207_SPARE_RWTOTP_LAST= 0x06a7,
	kD2207_SPARE_RWOTP0		= 0x06c0,
	kD2207_SPARE_RWOTP1		= 0x06c1,

//	Legacy Scratch Pads

	kDIALOG_MEMBYTE0		= 0x4000,
	kDIALOG_MEMBYTE_LAST	= 0x4027,

//	Scratch Pad RAM

	kDIALOG_TEST_ACCESS		= 0x7000,
		kDIALOG_TEST_ACCESS_ENA	= 0x1D,
		kDIALOG_TEST_ACCESS_DIS	= 0x00,

	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_VOLTAGE_KNOBS = kDIALOG_EXT_MEM_CAL1+kDIALOG_EXT_MEM_CAL1_SIZE,
			kDIALOG_VOLTAGE_KNOBS_SIZE=32,

		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   = 4,
	kDIALOG_IBUS_ACCUMULATOR	= 0,
	kDIALOG_VBUS_ACCUMULATOR	= 1,
	kDIALOG_IBUCK0_ACCUMULATOR	= 2,
	kDIALOG_IBUCK1_ACCUMULATOR	= 3,
};

enum {
	kD2207_EVENT_A_TBAT		= (1 << 7),
	kD2207_EVENT_A_VBUS_EXT_REM	= (1 << 6),
	kD2207_EVENT_A_VDD_LOW		= (1 << 5),
	kD2207_EVENT_A_CHG_HV_ATT	= (1 << 4),
	kD2207_EVENT_A_VBUS_EXT_DET	= (1 << 3),
	kD2207_EVENT_A_ACC_DET		= (1 << 2),
	kD2207_EVENT_A_VDD_PRE_UVLO	= (1 << 1),
	kD2207_EVENT_A_VCENTER_DET	= (1 << 0),
};

enum {
	kD2207_EVENT_B_BTN4_DBL		= (1 << 7),
	kD2207_EVENT_B_BTN3_DBL		= (1 << 6),
	kD2207_EVENT_B_BTN2_DBL		= (1 << 5),
	kD2207_EVENT_B_BTN1_DBL		= (1 << 4),
	kD2207_EVENT_B_BUTTON_4		= (1 << 3),
	kD2207_EVENT_B_BUTTON_3		= (1 << 2),
	kD2207_EVENT_B_BUTTON_2		= (1 << 1),
	kD2207_EVENT_B_BUTTON_1		= (1 << 0),
};

enum {
	kD2207_EVENT_C_CHG_BUCK_FLG	= (1 << 6),
	kD2207_EVENT_C_CHG_ABCC_ACT	= (1 << 5),
	kD2207_EVENT_C_CHG_TIMEOUT	= (1 << 4),
	kD2207_EVENT_C_CHG_PRECHG_TIMEOUT	= (1 << 3),
	kD2207_EVENT_C_CHG_END		= (1 << 2),
	kD2207_EVENT_C_CHG_FAST		= (1 << 1),
	kD2207_EVENT_C_CHG_PRE		= (1 << 0),
};

enum {
	kD2207_EVENT_D_GPIO8		= (1 << 7),
	kD2207_EVENT_D_GPIO7		= (1 << 6),
	kD2207_EVENT_D_GPIO6		= (1 << 5),
	kD2207_EVENT_D_GPIO5		= (1 << 4),
	kD2207_EVENT_D_GPIO4		= (1 << 3),
	kD2207_EVENT_D_GPIO3		= (1 << 2),
	kD2207_EVENT_D_GPIO2		= (1 << 1),
	kD2207_EVENT_D_GPIO1		= (1 << 0),
};

enum {
	kD2207_EVENT_E_GPIO16		= (1 << 7),
	kD2207_EVENT_E_GPIO15		= (1 << 6),
	kD2207_EVENT_E_GPIO14		= (1 << 5),
	kD2207_EVENT_E_GPIO13		= (1 << 4),
	kD2207_EVENT_E_GPIO12		= (1 << 3),
	kD2207_EVENT_E_GPIO11		= (1 << 2),
	kD2207_EVENT_E_GPIO10		= (1 << 1),
	kD2207_EVENT_E_GPIO9		= (1 << 0),
};

enum {
	kD2207_EVENT_F_GPIO21		= (1 << 4),
	kD2207_EVENT_F_GPIO20		= (1 << 3),
	kD2207_EVENT_F_GPIO19		= (1 << 2),
	kD2207_EVENT_F_GPIO18		= (1 << 1),
	kD2207_EVENT_F_GPIO17		= (1 << 0),
};

enum {
	kD2207_EVENT_G_T4_RISE		= (1 << 7),
	kD2207_EVENT_G_T4_FALL		= (1 << 6),
	kD2207_EVENT_G_T3_RISE		= (1 << 5),
	kD2207_EVENT_G_T3_FALL		= (1 << 4),
	kD2207_EVENT_G_T2_RISE		= (1 << 3),
	kD2207_EVENT_G_T2_FALL		= (1 << 2),
	kD2207_EVENT_G_T1_RISE		= (1 << 1),
	kD2207_EVENT_G_T1_FALL		= (1 << 0),
};

enum {
	kD2207_EVENT_H_T8_RISE		= (1 << 7),
	kD2207_EVENT_H_T8_FALL		= (1 << 6),
	kD2207_EVENT_H_T7_RISE		= (1 << 5),
	kD2207_EVENT_H_T7_FALL		= (1 << 4),
	kD2207_EVENT_H_T6_RISE		= (1 << 3),
	kD2207_EVENT_H_T6_FALL		= (1 << 2),
	kD2207_EVENT_H_T5_RISE		= (1 << 1),
	kD2207_EVENT_H_T5_FALL		= (1 << 0),
};

enum {
	kD2207_EVENT_I_TLDO5		= (1 << 7),
	kD2207_EVENT_I_TBUCK_5_6	= (1 << 4),
	kD2207_EVENT_I_TBUCK_1		= (1 << 3),
	kD2207_EVENT_I_TBUCK_2_3	= (1 << 2),
	kD2207_EVENT_I_TBUCK4		= (1 << 1),
	kD2207_EVENT_I_TBUCK0		= (1 << 0),
};

enum {
	kD2207_EVENT_J_HIGH_TEMP_WARNING	= (1 << 7),
	kD2207_EVENT_J_WLEDB_SHORT	= (1 << 6),
	kD2207_EVENT_J_WLEDB_OPEN	= (1 << 5),
	kD2207_EVENT_J_WLEDA_SHORT	= (1 << 4),
	kD2207_EVENT_J_WLEDA_OPEN	= (1 << 3),
	kD2207_EVENT_J_TLINCHG		= (1 << 2),
	kD2207_EVENT_J_TCBUCK_B		= (1 << 1),
	kD2207_EVENT_J_TCBUCK_A		= (1 << 0),
};

enum {
	kD2207_EVENT_K_BUCK_LDO_UOV	= (1 << 7),
	kD2207_EVENT_K_XTAL_ERROR 	= (1 << 6),
	kD2207_EVENT_K_VBUS_OV		= (1 << 5),
	kD2207_EVENT_K_VBUS_OC		= (1 << 4),
	kD2207_EVENT_K_LDO6_OC		= (1 << 0),
};

enum {
	kD2207_EVENT_L_IBUCK1_OVERFLOW	= (1 << 7),
	kD2207_EVENT_L_IBUCK0_OVERFLOW	= (1 << 6),
	kD2207_EVENT_L_IBUS_OVERFLOW	= (1 << 5),
	kD2207_EVENT_L_HIB			= (1 << 4),
	kD2207_EVENT_L_DWI_TO		= (1 << 3),
	kD2207_EVENT_L_EOMC_BIST	= (1 << 2),
	kD2207_EVENT_L_EOMC			= (1 << 1),
	kD2207_EVENT_L_ALARM		= (1 << 0),
};

enum {
	kD2207_EVENT_M_BUCK2_POS_ILIM_MON	= (1 << 7),
	kD2207_EVENT_M_BUCK2_NEG_ILIM_MON	= (1 << 6),
	kD2207_EVENT_M_BUCK1_POS_ILIM_MON	= (1 << 5),
	kD2207_EVENT_M_BUCK1_NEG_ILIM_MON	= (1 << 4),
	kD2207_EVENT_M_BUCK0_POS_ILIM_MON	= (1 << 3),
	kD2207_EVENT_M_BUCK0_NEG_ILIM_MON	= (1 << 2),
};

enum {
	kD2207_EVENT_N_BUCK6_POS_ILIM_MON	= (1 << 7),
	kD2207_EVENT_N_BUCK6_NEG_ILIM_MON	= (1 << 6),
	kD2207_EVENT_N_BUCK5_POS_ILIM_MON	= (1 << 5),
	kD2207_EVENT_N_BUCK5_NEG_ILIM_MON	= (1 << 4),
	kD2207_EVENT_N_BUCK4_POS_ILIM_MON	= (1 << 3),
	kD2207_EVENT_N_BUCK4_NEG_ILIM_MON	= (1 << 2),
	kD2207_EVENT_N_BUCK3_POS_ILIM_MON	= (1 << 1),
	kD2207_EVENT_N_BUCK3_NEG_ILIM_MON	= (1 << 0),
};

enum {
	kD2207_STATUS_A_TBAT		= (1 << 7),
	kD2207_STATUS_A_VDD_LOW		= (1 << 5),
	kD2207_STATUS_A_CHG_HV_ATT	= (1 << 4),
	kD2207_STATUS_A_VBUS_EXT_DET	= (1 << 3),
	kD2207_STATUS_A_ACC_DET		= (1 << 2),
	kD2207_STATUS_A_VDD_PRE_UVLO	= (1 << 1),
	kD2207_STATUS_A_VCENTER_DET	= (1 << 0),
};

enum {
	kD2207_STATUS_B_BUTTON_4	= (1 << 3),
	kD2207_STATUS_B_BUTTON_3	= (1 << 2),
	kD2207_STATUS_B_BUTTON_2	= (1 << 1),
	kD2207_STATUS_B_BUTTON_1	= (1 << 0),
};

enum {
	kD2207_STATUS_C_CHG_HV_EN	= (1 << 7),
	kD2207_STATUS_C_CHG_BUCK_FLG	= (1 << 6),
	kD2207_STATUS_C_CHG_ABCC_ACT	= (1 << 5),
	kD2207_STATUS_C_CHG_TIMEOUT	= (1 << 4),
	kD2207_STATUS_C_CHG_PRECHG_TIMEOUT	= (1 << 3),
	kD2207_STATUS_C_CHG_END		= (1 << 2),
	kD2207_STATUS_C_CHG_FAST	= (1 << 1),
	kD2207_STATUS_C_CHG_PRE		= (1 << 0),
};

enum {
	kD2207_STATUS_D_GPIO8		= (1 << 7),
	kD2207_STATUS_D_GPIO7		= (1 << 6),
	kD2207_STATUS_D_GPIO6		= (1 << 5),
	kD2207_STATUS_D_GPIO5		= (1 << 4),
	kD2207_STATUS_D_GPIO4		= (1 << 3),
	kD2207_STATUS_D_GPIO3		= (1 << 2),
	kD2207_STATUS_D_GPIO2		= (1 << 1),
	kD2207_STATUS_D_GPIO1		= (1 << 0),
};

enum {
	kD2207_STATUS_E_GPIO16		= (1 << 7),
	kD2207_STATUS_E_GPIO15		= (1 << 6),
	kD2207_STATUS_E_GPIO14		= (1 << 5),
	kD2207_STATUS_E_GPIO13		= (1 << 4),
	kD2207_STATUS_E_GPIO12		= (1 << 3),
	kD2207_STATUS_E_GPIO11		= (1 << 2),
	kD2207_STATUS_E_GPIO10		= (1 << 1),
	kD2207_STATUS_E_GPIO9		= (1 << 0),
};

enum {
	kD2207_STATUS_F_GPIO21		= (1 << 4),
	kD2207_STATUS_F_GPIO20		= (1 << 3),
	kD2207_STATUS_F_GPIO19		= (1 << 2),
	kD2207_STATUS_F_GPIO18		= (1 << 1),
	kD2207_STATUS_F_GPIO17		= (1 << 0),
};

enum {
	kD2207_STATUS_G_T4_RISE		= (1 << 7),
	kD2207_STATUS_G_T4_FALL		= (1 << 6),
	kD2207_STATUS_G_T3_RISE		= (1 << 5),
	kD2207_STATUS_G_T3_FALL		= (1 << 4),
	kD2207_STATUS_G_T2_RISE		= (1 << 3),
	kD2207_STATUS_G_T2_FALL		= (1 << 2),
	kD2207_STATUS_G_T1_RISE		= (1 << 1),
	kD2207_STATUS_G_T1_FALL		= (1 << 0),
};

enum {
	kD2207_STATUS_H_T8_RISE		= (1 << 7),
	kD2207_STATUS_H_T8_FALL		= (1 << 6),
	kD2207_STATUS_H_T7_RISE		= (1 << 5),
	kD2207_STATUS_H_T7_FALL		= (1 << 4),
	kD2207_STATUS_H_T6_RISE		= (1 << 3),
	kD2207_STATUS_H_T6_FALL		= (1 << 2),
	kD2207_STATUS_H_T5_RISE		= (1 << 1),
	kD2207_STATUS_H_T5_FALL		= (1 << 0),
};

enum {
	kD2207_STATUS_I_TLDO5		= (1 << 7),
	kD2207_STATUS_I_TBUCK_5_6	= (1 << 4),
	kD2207_STATUS_I_TBUCK_1		= (1 << 3),
	kD2207_STATUS_I_TBUCK_2_3	= (1 << 2),
	kD2207_STATUS_I_TBUCK4		= (1 << 1),
	kD2207_STATUS_I_TBUCK0		= (1 << 0),
};

enum {
	kD2207_STATUS_J_HIGH_TEMP_WARNING	= (1 << 7),
	kD2207_STATUS_J_TLINCHG		= (1 << 2),
	kD2207_STATUS_J_TCBUCK_B	= (1 << 1),
	kD2207_STATUS_J_TCBUCK_A	= (1 << 0),
};

enum {
	kD2207_STATUS_K_BUCK_LDO_UOV	= (1 << 7),
	kD2207_STATUS_K_XTAL_ERROR	= (1 << 6),
	kD2207_STATUS_K_VBUS_OV		= (1 << 5),
	kD2207_STATUS_K_VBUS_OC		= (1 << 4),
};

enum {
	kD2207_STATUS_L_IBUCK1_OVERFLOW	= (1 << 7),
	kD2207_STATUS_L_IBUCK0_OVERFLOW	= (1 << 6),
	kD2207_STATUS_L_IBUS_OVERFLOW	= (1 << 5),
	kD2207_STATUS_L_DWI_TO		= (1 << 3),
};

enum {
	kD2207_STATUS_M_PROT_FET_ON	= (1 << 1),
	kD2207_STATUS_M_CHG_ATT		= (1 << 0),
};

enum {
	kD2207_BUCK_MODE_FSLEEP = 0,
	kD2207_BUCK_MODE_AUTO = 1,
	kD2207_BUCK_MODE_FSYNC = 2,
	kD2207_BUCK_MODE_MASK = 0x3,
};

enum {
	kD2207_BUCK_UOV_CMP_EN = ( 1<<2 ),
	kD2207_LDO_UOV_CMP_EN = ( 1<<1 ),
	kD2207_MAIN_UOV_CMP_EN = ( 1<<0 ),
        kD2207_UOV_CMP_MASK  = ( kD2207_BUCK_UOV_CMP_EN | kD2207_MAIN_UOV_CMP_EN ),

        kD2207_BUCK_OV_TRIM_SHIFT = 2,
        kD2207_BUCK_OV_TRIM_MASK = (0x3<<kD2207_BUCK_OV_TRIM_SHIFT),
        kD2207_BUCK_SYNC_ILIMIT_MASK = 0xff,

	kD2207_FLT_BUCK1_MASK	= (0x3<<2),
};

enum {
	kDIALOG_EVENT_HOLD_BUTTON_MASK	= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BUTTON_2),
	kDIALOG_EVENT_MENU_BUTTON_MASK	= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BUTTON_1),
	kDIALOG_EVENT_RINGER_BUTTON_MASK= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BUTTON_3),
	kDIALOG_EVENT_BUTTON4_MASK= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BUTTON_4),
	kDIALOG_EVENT_BUTTONS		= (kD2207_EVENT_B_BUTTON_4 |
					   kD2207_EVENT_B_BUTTON_3 |
					   kD2207_EVENT_B_BUTTON_2 |
					   kD2207_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, kD2207_EVENT_L_ALARM),
	kDIALOG_EVENT_ACC_DET_MASK	= EVENT_FLAG_MAKE(0, kD2207_EVENT_A_ACC_DET),
	kDIALOG_EVENT_VBUS_DET_MASK	= EVENT_FLAG_MAKE(0, kD2207_EVENT_A_VBUS_EXT_DET),
	kDIALOG_EVENT_VBUS_EXT_REM_MASK	= EVENT_FLAG_MAKE(0, kD2207_EVENT_A_VBUS_EXT_REM),
	kDIALOG_EVENT_EOMC_MASK		= EVENT_FLAG_MAKE(11, kD2207_EVENT_L_EOMC),
	kDIALOG_EVENT_HIB_MASK		= EVENT_FLAG_MAKE(11, kD2207_EVENT_L_HIB),
	kDIALOG_EVENT_ABCC_MASK		= EVENT_FLAG_MAKE(2, kD2207_EVENT_C_CHG_ABCC_ACT),
	
	kDIALOG_EVENT_CHG_END_MASK	= EVENT_FLAG_MAKE(2, kD2207_EVENT_C_CHG_END),
	kDIALOG_EVENT_TBAT_MASK		= EVENT_FLAG_MAKE(0, kD2207_EVENT_A_TBAT),
	
	kDIALOG_EVENT_GPIO1_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO1),
	kDIALOG_EVENT_GPIO2_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO2),
	kDIALOG_EVENT_GPIO3_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO3),
	kDIALOG_EVENT_GPIO4_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO4),
	kDIALOG_EVENT_GPIO5_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO5),
	kDIALOG_EVENT_GPIO6_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO6),
	kDIALOG_EVENT_GPIO7_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO7),
	kDIALOG_EVENT_GPIO8_MASK	= EVENT_FLAG_MAKE(3, kD2207_EVENT_D_GPIO8),
	kDIALOG_EVENT_GPIO9_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO9),
	kDIALOG_EVENT_GPIO10_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO10),
	kDIALOG_EVENT_GPIO11_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO11),
	kDIALOG_EVENT_GPIO12_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO12),
	kDIALOG_EVENT_GPIO13_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO13),
	kDIALOG_EVENT_GPIO14_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO14),
	kDIALOG_EVENT_GPIO15_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO15),
	kDIALOG_EVENT_GPIO16_MASK	= EVENT_FLAG_MAKE(4, kD2207_EVENT_E_GPIO16),
	kDIALOG_EVENT_GPIO17_MASK	= EVENT_FLAG_MAKE(5, kD2207_EVENT_F_GPIO17),
	kDIALOG_EVENT_GPIO18_MASK	= EVENT_FLAG_MAKE(5, kD2207_EVENT_F_GPIO18),
	kDIALOG_EVENT_GPIO19_MASK	= EVENT_FLAG_MAKE(5, kD2207_EVENT_F_GPIO19),
	kDIALOG_EVENT_GPIO20_MASK	= EVENT_FLAG_MAKE(5, kD2207_EVENT_F_GPIO20),
	kDIALOG_EVENT_GPIO21_MASK	= EVENT_FLAG_MAKE(5, kD2207_EVENT_F_GPIO21),

	kDIALOG_EVENT_HOLD_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BTN2_DBL),
	kDIALOG_EVENT_MENU_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2207_EVENT_B_BTN1_DBL),
	kDIALOG_EVENT_RINGER_DBL_MASK	= EVENT_FLAG_MAKE(1, kD2207_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,
};

// FIX ME
enum {
	kDIALOG_STATUS_USB_MASK		= STATUS_FLAG_MAKE(0, kD2207_STATUS_A_VCENTER_DET),
	kDIALOG_STATUS_VBUS_MASK	= STATUS_FLAG_MAKE(0, kD2207_STATUS_A_VBUS_EXT_DET),
	kDIALOG_STATUS_FW_MASK		= kDIALOG_NOTEXIST_MASK,
	kDIALOG_STATUS_ACC_DET_MASK	= STATUS_FLAG_MAKE(0, kD2207_STATUS_A_ACC_DET),
	kDIALOG_STATUS_CHARGING_MASK	= STATUS_FLAG_MAKE(3, kD2207_STATUS_C_CHG_PRE | kD2207_STATUS_C_CHG_FAST),
	kDIALOG_STATUS_CHG_TO_MASK	= STATUS_FLAG_MAKE(2, kD2207_STATUS_C_CHG_TIMEOUT),
	kDIALOG_STATUS_CHG_END_MASK	= STATUS_FLAG_MAKE(2, kD2207_STATUS_C_CHG_END),
	kDIALOG_STATUS_TBAT_MASK	= STATUS_FLAG_MAKE(0, kD2207_STATUS_A_TBAT),
	kDIALOG_STATUS_CHG_ATT_MASK     = STATUS_FLAG_MAKE(12, kD2207_STATUS_M_CHG_ATT),
	kDIALOG_STATUS_ABCC_MASK	= STATUS_FLAG_MAKE(2, kD2207_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, kD2207_STATUS_C_CHG_PRE | kD2207_STATUS_C_CHG_FAST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

enum {
	kD2207_EVENT_A_WAKEMASK = (kD2207_EVENT_A_VBUS_EXT_DET |
				   kD2207_EVENT_A_VCENTER_DET |
				   kD2207_EVENT_A_ACC_DET),
	kD2207_EVENT_B_WAKEMASK = (kD2207_EVENT_B_BUTTON_1 |
				   kD2207_EVENT_B_BUTTON_2 |
				   kD2207_EVENT_B_BUTTON_3 |
				   kD2207_EVENT_B_BUTTON_4),
	kD2207_EVENT_C_WAKEMASK = 0,
	kD2207_EVENT_D_WAKEMASK = 0,
	kD2207_EVENT_E_WAKEMASK = 0,
	kD2207_EVENT_F_WAKEMASK = 0,
	kD2207_EVENT_G_WAKEMASK = 0,
	kD2207_EVENT_H_WAKEMASK = 0,
	kD2207_EVENT_I_WAKEMASK = 0,
	kD2207_EVENT_J_WAKEMASK = 0,
	kD2207_EVENT_K_WAKEMASK = 0,
	kD2207_EVENT_L_WAKEMASK = kD2207_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 = {
	~kD2207_EVENT_A_WAKEMASK,
	~kD2207_EVENT_B_WAKEMASK,
	~kD2207_EVENT_C_WAKEMASK,
	~kD2207_EVENT_D_WAKEMASK,
	~kD2207_EVENT_E_WAKEMASK,
	~kD2207_EVENT_F_WAKEMASK,
	~kD2207_EVENT_G_WAKEMASK,
	~kD2207_EVENT_H_WAKEMASK,
	~kD2207_EVENT_I_WAKEMASK,
	~kD2207_EVENT_J_WAKEMASK,
	~kD2207_EVENT_K_WAKEMASK,
	~kD2207_EVENT_L_WAKEMASK,
};


// All wake events without the buttons
static const eventRegisters kDialogEventNotButtonMasks = {
	kD2207_EVENT_A_WAKEMASK,
	kD2207_EVENT_B_WAKEMASK & ~kDIALOG_EVENT_BUTTONS,
	kD2207_EVENT_C_WAKEMASK,
	kD2207_EVENT_D_WAKEMASK,
	kD2207_EVENT_E_WAKEMASK,
	kD2207_EVENT_F_WAKEMASK,
	kD2207_EVENT_G_WAKEMASK,
	kD2207_EVENT_H_WAKEMASK,
	kD2207_EVENT_I_WAKEMASK,
	kD2207_EVENT_J_WAKEMASK,
	kD2207_EVENT_K_WAKEMASK,
	kD2207_EVENT_L_WAKEMASK,
};

// All events indicating external power supply
static const eventRegisters kDialogEventPwrsupplyMask = {
	kD2207_EVENT_A_VBUS_EXT_DET | kD2207_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
	kD2207_EVENT_A_VCENTER_DET,
	0,
	kD2207_EVENT_C_CHG_ABCC_ACT,
	0,
	0,
	0,
	0,
	0,
	0,
};

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

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

enum {
	kDIALOG_LCM_ACTIVE_BOOST_EN		= (1 << 0) | (1 << 1),
	kDIALOG_LCM_ACTIVE_MASK			= (1 << 2) | (1 << 3) | (1 << 4),
};

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
	kD2207_FAULT_LOG_LDO6_BACKPOW	    = FAULTLOG_FLAG_MAKE(1, (1 << 4)),
	kD2207_FAULT_LOG_BOOST_OC_OV	    = FAULTLOG_FLAG_MAKE(1, (1 << 3)),
	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  = 0x02,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_200  = 0x0a,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_300  = 0x12,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_400  = 0x1a,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_500  = 0x22,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_600  = 0x2a,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_700  = 0x32,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_900  = 0x42,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_975  = 0x48,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_1000 = 0x4a,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_1450 = 0x6e,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_1500 = 0x72,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_1900 = 0x92,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_2000 = 0x9a,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_2100 = 0xa2,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_2300 = 0xb2,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_MAX  = 0xff,
	kDIALOG_CHARGE_BUCK_CONTROL_ISET_BUCK_MASK = 0xff,
};

enum {
	kDIALOG_CHARGE_BUCK_CONTROL_MIN		   = 75,
	kDIALOG_CHARGE_BUCK_CONTROL_STEP_PER_100MA = 8,
	kDIALOG_CHARGE_BUCK_CONTROL_MAX		   = 3262,
};

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		= 50,
	kDIALOG_CHARGE_CONTROL_MAX		= 3150,
};

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_MAN_CONV		= (1 << 7),
	kDIALOG_ADC_CONTROL_MUX_SEL_MASK	= (0x3f << 0),

	kDIALOG_ADC_CONTROL_MUX_SEL_VDD_OUT	= (0 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ICH		= (1 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_TBAT	= (2 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ACC_ID	= (3 << 0),	// not actually present, but reserved
	kDIALOG_ADC_CONTROL_MUX_SEL_VBAT	= (4 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_LG	= (5 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BRICK_ID	= (6 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IN7	= (7 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_TJUNC	= (8 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG	= (9 << 0),
		kDIALOG_ADC_CONTROL_MUX_SEL_VIBUS	= kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG,
	kDIALOG_ADC_CONTROL_MUX_SEL_NTC0	= (10 << 0),
		kDIALOG_ADC_CONTROL_MUX_NUM_NTC		= 9,
	kDIALOG_ADC_CONTROL_MUX_SEL_VBUS	= (19 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_LG_OFF	= (20 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_IBUS_IN_HG_OFF	= (21 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK23_TEMP	= (22 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_LDO5_TEMP	= (23 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_CBUCK_B_TEMP= (24 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_CHG_TEMP = (25 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK0_TEMP	= (26 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK4_TEMP	= (27 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK5_6_TEMP = (28 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_BUCK1_TEMP = (29 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_CBUCK_A_TEMP= (30 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IN31	= (31 << 0),

		kDIALOG_ADC_CONTROL_MUX_SEL_TINT_START	= kDIALOG_ADC_CONTROL_MUX_SEL_BUCK23_TEMP,
		kDIALOG_ADC_CONTROL_MUX_SEL_TINT_END	= kDIALOG_ADC_CONTROL_MUX_SEL_CBUCK_A_TEMP,

	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK0	= (32 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK1	= (33 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK2	= (34 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK3	= (35 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK4	= (36 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK5	= (37 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK0_OFF	= (38 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK1_OFF	= (39 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK2_OFF	= (40 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK3_OFF	= (41 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK4_OFF	= (42 << 0),
	kDIALOG_ADC_CONTROL_MUX_SEL_ADC_IBUCK5_OFF	= (43 << 0),
	
	kDIALOG_ADC_CONTROL2_AUTO_VDD_OUT_EN	= (1 << 7),
	kDIALOG_ADC_CONTROL2_ADC_REF_EN		= (1 << 6),
	kDIALOG_ADC_CONTROL2_IBUCK1_EN		= (1 << 2),
	kDIALOG_ADC_CONTROL2_IBUCK0_EN		= (1 << 1),
	kDIALOG_ADC_CONTROL2_IBUS_EN		= (1 << 0),
};

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_MAN_CONV		= (1 << 7),
    kDIALOG_BIST_ADC_CTRL_MUX_SEL_MASK	= (0x7f << 0),
    
//	From Table 65: BIST ADC measurement channel overview
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO1	= (0 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO1	= (1 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO2	= (2 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO2	= (3 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO3	= (4 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO3	= (5 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO4	= (6 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO4	= (7 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO5	= (8 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO5	= (9 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO6	= (10 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO6	= (11 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO7	= (12 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO7	= (13 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO8	= (14 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO8	= (15 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO9	= (16 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO9	= (17 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO13	= (18 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO13	= (19 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO11	= (20 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO11	= (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_VLCM1	= (24 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILCM1	= (25 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLCM2	= (26 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILCM2	= (27 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLCM3	= (28 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILCM3	= (29 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VRTC	= (30 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_IRTC	= (31 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUF_ON	= (32 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK0	= (34 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VOUT_WLEDB= (36 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK2	= (38 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK3	= (40 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK4	= (42 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VOUT_WLEDA= (44 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBOOST_LCM= (46 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_APP_MUX_A	= (48 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_APP_MUX_B	= (50 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK6	= (52 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VLDO14	= (54 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_ILDO14	= (55 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK1	= (56 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_VBUCK5	= (58 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_BUCK3_SW1	= (64 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_BUCK3_SW2	= (66 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_BUCK3_SW3	= (68 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_BUCK4_SW1	= (70 << 0),
	kDIALOG_BIST_ADC_CTRL_MUX_SEL_BUCK4_SW2	= (72 << 0),
};

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)

enum {
	kDIALOG_WLED_CONTROL_WLED_ENABLE1	= (1 << 0),
	kDIALOG_WLED_CONTROL_WLED_ENABLE2	= (1 << 1),
	kDIALOG_WLED_CONTROL_WLED_ENABLE3	= (1 << 2),
	kDIALOG_WLED_CONTROL_WLED_ENABLE4	= (1 << 3),
	kDIALOG_WLED_CONTROL_WLED_ENABLE5	= (1 << 4),
	kDIALOG_WLED_CONTROL_WLED_ENABLE6	= (1 << 5),
};

enum {
	kDIALOG_WLED_CONTROL2_WLED_DITH_RAMP_EN	= (1 << 3),
	kDIALOG_WLED_CONTROL2_WLED_DITH_EN	= (1 << 2),
	kDIALOG_WLED_CONTROL2_WLED_DWI_EN	= (1 << 1),
	kDIALOG_WLED_CONTROL2_WLED_RAMP_EN	= (1 << 0),
	
	kDIALOG_WLED_CONTROL_WLED_DWI_EN	= kDIALOG_WLED_CONTROL2_WLED_DWI_EN,
	
	kDIALOG_WLED_OPTIONS_DEFAULT		= kDIALOG_WLED_CONTROL2_WLED_DITH_EN,
	kDIALOG_WLED_OPTIONS_xWI_EN		= kDIALOG_WLED_CONTROL2_WLED_DWI_EN,
	kDIALOG_WLED_OPTIONS_MASK		= (kDIALOG_WLED_CONTROL2_WLED_RAMP_EN|
						   kDIALOG_WLED_CONTROL2_WLED_DITH_EN|
						   kDIALOG_WLED_CONTROL2_WLED_DITH_RAMP_EN),
};

#define WLED_ISET_BITS	(11)



#define NUM_LDOS 23
static const struct ldo_params ldo_d2207[NUM_LDOS] = {
	{ 2500, 25, 0x7f, 0x7f, 0x00, kD2207_LDO1_VSEL,	 kD2207_ACTIVE3, 0x02 },	// LDO1
	{ 1200, 5,  0xff, 0xff, 0x04, kD2207_LDO2_VSEL,	 kD2207_ACTIVE3, 0x04 },	// LDO2
	{ 2500, 25, 0x7f, 0x7f, 0x00, kD2207_LDO3_VSEL,	 kD2207_ACTIVE3, 0x08 },	// LDO3
	{ 2500, 25, 0x7f, 0x7f, 0x00, kD2207_LDO4_VSEL,	 kD2207_ACTIVE3, 0x10 },	// LDO4
	{ 1200, 25, 0x7f, 0x7f, 0x00, kD2207_LDO5_VSEL,	 kD2207_ACTIVE3, 0x20 },	// LDO5
	{ 2500, 25, 0x7f, 0x7f, 0x40, kD2207_LDO6_VSEL,	 kD2207_ACTIVE3, 0x40 },	// LDO6
	{ 1700, 25, 0x7f, 0x7f, 0x00, kD2207_LDO7_VSEL,	 kD2207_ACTIVE3, 0x80 },	// LDO7
	{ 1700, 25, 0x7f, 0x7f, 0x00, kD2207_LDO8_VSEL,	 kD2207_ACTIVE4, 0x01 },	// LDO8
	{ 1200, 25, 0x7f, 0x7f, 0x00, kD2207_LDO9_VSEL,	 kD2207_ACTIVE4, 0x02 },	// LDO9
	{ 600,  25, 0xff, 0xff, 0x00, kD2207_LDO10_VSEL, kD2207_ACTIVE4, 0x04 },	// LDO10
	{ 1700, 25, 0x7f, 0x7f, 0x00, kD2207_LDO11_VSEL, kD2207_ACTIVE4, 0x08 },	// LDO11
	{ 0,	0,  0,	  0,	0x00, 0,		 kD2207_ACTIVE4, 0x00 },	// there is no LDO12
	{ 1700, 25, 0x7f, 0x7f, 0x00, kD2207_LDO13_VSEL, kD2207_ACTIVE4, 0x20 },	// LDO13
	{ 1200, 25, 0x7f, 0x7f, 0x00, kD2207_LDO14_VSEL, kD2207_ACTIVE4, 0x40 },	// LDO14

	{ 5000, 50, 0x1f, 0x1f, 0x0, kD2207_LCM_BOOST_VSEL,kD2207_ACTIVE5, 0x04 },	// "LDO15" / LCM_LDO1
	{ 5000, 50, 0x1f, 0x1f, 0x0, kD2207_LCM_BOOST_VSEL,kD2207_ACTIVE5, 0x08 },	// "LDO16" / LCM_LDO2
	{ 5000, 50, 0x1f, 0x1f, 0x0, kD2207_LCM_BOOST_VSEL,kD2207_ACTIVE5, 0x10 },	// "LDO17" / LCM_LDO3

	{ 0,    0,  0,    0,    0x00, 0,		kD2207_ACTIVE6, 0x01 },		// "LDO18" - BUCK3_SW1_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2207_ACTIVE6, 0x02 },		// "LDO19" - BUCK3_SW2_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2207_ACTIVE6, 0x04 },		// "LDO20" - BUCK3_SW3_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2207_ACTIVE6, 0x10 },		// "LDO21" - BUCK4_SW1_EN
	{ 0,    0,  0,    0,    0x00, 0,		kD2207_ACTIVE6, 0x20 },		// "LDO22" - BUCK4_SW2_EN

	{ 0,    0,  0,    0,    0x00, 0,		kD2207_HIBERNATE3, 0x40 },	// "LDO23" - set LDO6_EN in HIB
};
#define LDOP ldo_d2207

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),
	kD2207_BUTTON_DBL_BTN1_DBL_EN		= (1 << 3),
	kD2207_BUTTON_DBL_BTN2_DBL_EN		= (1 << 4),
	kD2207_BUTTON_DBL_BTN3_DBL_EN		= (1 << 5),
	kD2207_BUTTON_DBL_BTN4_DBL_EN		= (1 << 6),
	kDIALOG_BUTTON_DBL_HOLD_DBL_EN		= kD2207_BUTTON_DBL_BTN2_DBL_EN,
	kDIALOG_BUTTON_DBL_MENU_DBL_EN		= kD2207_BUTTON_DBL_BTN1_DBL_EN,
	kDIALOG_BUTTON_DBL_RINGER_DBL_EN	= kD2207_BUTTON_DBL_BTN3_DBL_EN,
};

#endif /* __DIALOG_D2207_H */
