155 lines
5.9 KiB
C
155 lines
5.9 KiB
C
/*
|
|
* drivers/power/axp/axp803/axp803.h
|
|
* (C) Copyright 2010-2016
|
|
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|
* Pannan <pannan@allwinnertech.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of
|
|
* the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef AXP803_H_
|
|
#define AXP803_H_
|
|
|
|
#define AXP803_RSB_RTSADDR (0x2d)
|
|
|
|
#define AXP803_STATUS (0x00)
|
|
#define AXP803_MODE_CHGSTATUS (0x01)
|
|
#define AXP803_IC_TYPE (0x03)
|
|
#define AXP803_BUFFER1 (0x04)
|
|
#define AXP803_BUFFER2 (0x05)
|
|
#define AXP803_BUFFER3 (0x06)
|
|
#define AXP803_BUFFER4 (0x07)
|
|
#define AXP803_BUFFER5 (0x08)
|
|
#define AXP803_BUFFER6 (0x09)
|
|
#define AXP803_BUFFER7 (0x0A)
|
|
#define AXP803_BUFFER8 (0x0B)
|
|
#define AXP803_BUFFER9 (0x0C)
|
|
#define AXP803_BUFFERA (0x0D)
|
|
#define AXP803_BUFFERB (0x0E)
|
|
#define AXP803_BUFFERC (0x0F)
|
|
#define AXP803_LDO_DC_EN1 (0X10)
|
|
#define AXP803_LDO_DC_EN2 (0X12)
|
|
#define AXP803_LDO_DC_EN3 (0X13)
|
|
#define AXP803_DLDO1OUT_VOL (0x15)
|
|
#define AXP803_DLDO2OUT_VOL (0x16)
|
|
#define AXP803_DLDO3OUT_VOL (0x17)
|
|
#define AXP803_DLDO4OUT_VOL (0x18)
|
|
#define AXP803_ELDO1OUT_VOL (0x19)
|
|
#define AXP803_ELDO2OUT_VOL (0x1A)
|
|
#define AXP803_ELDO3OUT_VOL (0x1B)
|
|
#define AXP803_FLDO1OUT_VOL (0x1C)
|
|
#define AXP803_FLDO2OUT_VOL (0x1D)
|
|
#define AXP803_DC1OUT_VOL (0x20)
|
|
#define AXP803_DC2OUT_VOL (0x21)
|
|
#define AXP803_DC3OUT_VOL (0x22)
|
|
#define AXP803_DC4OUT_VOL (0x23)
|
|
#define AXP803_DC5OUT_VOL (0x24)
|
|
#define AXP803_DC6OUT_VOL (0x25)
|
|
#define AXP803_DC7OUT_VOL (0x26)
|
|
#define AXP803_DCDC_DVM_CTL (0x27)
|
|
#define AXP803_ALDO1OUT_VOL (0x28)
|
|
#define AXP803_ALDO2OUT_VOL (0x29)
|
|
#define AXP803_ALDO3OUT_VOL (0x2A)
|
|
#define AXP803_BC_CTL (0X2C)
|
|
#define AXP803_IPS_SET (0x30)
|
|
#define AXP803_VOFF_SET (0x31)
|
|
#define AXP803_OFF_CTL (0x32)
|
|
#define AXP803_CHARGE1 (0x33)
|
|
#define AXP803_CHARGE2 (0x34)
|
|
#define AXP803_CHARGE3 (0x35)
|
|
#define AXP803_POK_SET (0x36)
|
|
#define AXP803_VLTF_CHARGE (0x38)
|
|
#define AXP803_VHTF_CHARGE (0x39)
|
|
#define AXP803_CHARGE_AC_SET (0x3A)
|
|
#define AXP803_DCDC_FREQSET (0x3B)
|
|
#define AXP803_VLTF_WORK (0x3C)
|
|
#define AXP803_VHTF_WORK (0x3D)
|
|
#define AXP803_INTEN1 (0x40)
|
|
#define AXP803_INTEN2 (0x41)
|
|
#define AXP803_INTEN3 (0x42)
|
|
#define AXP803_INTEN4 (0x43)
|
|
#define AXP803_INTEN5 (0x44)
|
|
#define AXP803_INTEN6 (0x45)
|
|
#define AXP803_INTSTS1 (0x48)
|
|
#define AXP803_INTSTS2 (0x49)
|
|
#define AXP803_INTSTS3 (0x4A)
|
|
#define AXP803_INTSTS4 (0x4B)
|
|
#define AXP803_INTSTS5 (0x4C)
|
|
#define AXP803_INTSTS6 (0x4D)
|
|
#define AXP803_INTTEMP (0x56)
|
|
#define AXP803_VTS_RES (0x58)
|
|
#define AXP803_VBATH_RES (0x78)
|
|
#define AXP803_VBATL_RES (0x79)
|
|
#define AXP803_IBATH_REG (0x7A)
|
|
#define AXP803_DISIBATH_REG (0x7C)
|
|
#define AXP803_DCDC_MODESET (0x80)
|
|
#define AXP803_ADC_EN (0x82)
|
|
#define AXP803_ADC_SPEED_SET (0x85)
|
|
#define AXP803_HOTOVER_CTL (0x8F)
|
|
#define AXP803_GPIO0_CTL (0x90)
|
|
#define AXP803_GPIO0LDOOUT_VOL (0x91)
|
|
#define AXP803_GPIO1_CTL (0x92)
|
|
#define AXP803_GPIO1LDOOUT_VOL (0x93)
|
|
#define AXP803_GPIO01_SIGNAL (0x94)
|
|
#define AXP803_BAT_CHGCOULOMB3 (0xB0)
|
|
#define AXP803_BAT_CHGCOULOMB2 (0xB1)
|
|
#define AXP803_BAT_CHGCOULOMB1 (0xB2)
|
|
#define AXP803_BAT_CHGCOULOMB0 (0xB3)
|
|
#define AXP803_BAT_DISCHGCOULOMB3 (0xB4)
|
|
#define AXP803_BAT_DISCHGCOULOMB2 (0xB5)
|
|
#define AXP803_BAT_DISCHGCOULOMB1 (0xB6)
|
|
#define AXP803_BAT_DISCHGCOULOMB0 (0xB7)
|
|
#define AXP803_COULOMB_CTL (0xB8)
|
|
#define AXP803_CAP (0xB9)
|
|
#define AXP803_RDC0 (0xBA)
|
|
#define AXP803_RDC1 (0xBB)
|
|
#define AXP803_OCVBATH_RES (0xBC)
|
|
#define AXP803_OCVBATL_RES (0xBD)
|
|
#define AXP803_BATCAP0 (0xE0)
|
|
#define AXP803_BATCAP1 (0xE1)
|
|
#define AXP803_COUCNT0 (0xE2)
|
|
#define AXP803_COUCNT1 (0xE3)
|
|
#define AXP803_OCV_PERCENT (0xE4)
|
|
#define AXP803_COU_PERCENT (0xE5)
|
|
#define AXP803_WARNING_LEVEL (0xE6)
|
|
#define AXP803_ADJUST_PARA (0xE8)
|
|
#define AXP803_ADJUST_PARA1 (0xE9)
|
|
|
|
|
|
/* bit definitions for AXP events ,irq event */
|
|
#define AXP803_IRQ_USBRE (2)
|
|
#define AXP803_IRQ_USBIN (3)
|
|
#define AXP803_IRQ_USBOV (4)
|
|
#define AXP803_IRQ_ACRE (5)
|
|
#define AXP803_IRQ_ACIN (6)
|
|
#define AXP803_IRQ_ACOV (7)
|
|
#define AXP803_IRQ_CHAOV (10)
|
|
#define AXP803_IRQ_CHAST (11)
|
|
#define AXP803_IRQ_BATATOU (12)
|
|
#define AXP803_IRQ_BATATIN (13)
|
|
#define AXP803_IRQ_BATRE (14)
|
|
#define AXP803_IRQ_BATIN (15)
|
|
#define AXP803_IRQ_BATINWORK (17)
|
|
#define AXP803_IRQ_BATOVWORK (19)
|
|
#define AXP803_IRQ_QBATINCHG (20)
|
|
#define AXP803_IRQ_BATINCHG (21)
|
|
#define AXP803_IRQ_QBATOVCHG (22)
|
|
#define AXP803_IRQ_BATOVCHG (23)
|
|
#define AXP803_IRQ_LOWN2 (24)
|
|
#define AXP803_IRQ_LOWN1 (25)
|
|
#define AXP803_IRQ_GPIO0 (32)
|
|
#define AXP803_IRQ_GPIO1 (33)
|
|
#define AXP803_IRQ_POKLO (35)
|
|
#define AXP803_IRQ_POKSH (36)
|
|
#define AXP803_IRQ_PEKFE (37)
|
|
#define AXP803_IRQ_PEKRE (38)
|
|
#define AXP803_IRQ_TIMER (39)
|
|
|
|
extern s32 axp_debug;
|
|
extern struct axp_config_info axp803_config;
|
|
|
|
#endif /* AXP803_H_ */
|