107 lines
3.5 KiB
C
Executable File
107 lines
3.5 KiB
C
Executable File
/*
|
|
* drivers/power/axp/axp22x/axp22x-regulator.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 AXP22X_REGULATOR_H
|
|
#define AXP22X_REGULATOR_H
|
|
#include "axp22x.h"
|
|
|
|
enum {
|
|
AXP22X_ID_LDO1, /* RTCLDO */
|
|
AXP22X_ID_LDO2, /* ALDO1 */
|
|
AXP22X_ID_LDO3, /* ALDO2 */
|
|
AXP22X_ID_LDO4, /* ALDO3 */
|
|
AXP22X_ID_LDO5, /* DLDO1 */
|
|
AXP22X_ID_LDO6, /* DLDO2 */
|
|
#ifdef CONFIG_AW_AXP233
|
|
#else
|
|
AXP22X_ID_LDO7, /* DLDO3 */
|
|
AXP22X_ID_LDO8, /* DLDO4 */
|
|
#endif
|
|
AXP22X_ID_LDO9, /* ELDO1 */
|
|
AXP22X_ID_LDO10, /* ELDO2 */
|
|
AXP22X_ID_LDO11, /* ELDO3 */
|
|
AXP22X_ID_LDO12, /* DC5LDO */
|
|
AXP22X_ID_LDOIO0 = AXP_LDOIO_ID_START,
|
|
AXP22X_ID_LDOIO1,
|
|
#ifdef CONFIG_AW_AXP233
|
|
AXP22X_ID_SW0,
|
|
#endif
|
|
AXP22X_ID_SW1,
|
|
AXP22X_ID_DCDC1 = AXP_DCDC_ID_START,
|
|
AXP22X_ID_DCDC2,
|
|
AXP22X_ID_DCDC3,
|
|
AXP22X_ID_DCDC4,
|
|
AXP22X_ID_DCDC5,
|
|
};
|
|
|
|
/* AXP22 Regulator Registers */
|
|
#define AXP22X_LDO1 AXP22X_STATUS
|
|
#define AXP22X_LDO5 AXP22X_DLDO1OUT_VOL
|
|
#define AXP22X_LDO6 AXP22X_DLDO2OUT_VOL
|
|
#define AXP22X_LDO7 AXP22X_DLDO3OUT_VOL
|
|
#define AXP22X_LDO8 AXP22X_DLDO4OUT_VOL
|
|
#define AXP22X_LDO9 AXP22X_ELDO1OUT_VOL
|
|
#define AXP22X_LDO10 AXP22X_ELDO2OUT_VOL
|
|
#define AXP22X_LDO11 AXP22X_ELDO3OUT_VOL
|
|
#define AXP22X_LDO12 AXP22X_DC5LDOOUT_VOL
|
|
#define AXP22X_DCDC1 AXP22X_DC1OUT_VOL
|
|
#define AXP22X_DCDC2 AXP22X_DC2OUT_VOL
|
|
#define AXP22X_DCDC3 AXP22X_DC3OUT_VOL
|
|
#define AXP22X_DCDC4 AXP22X_DC4OUT_VOL
|
|
#define AXP22X_DCDC5 AXP22X_DC5OUT_VOL
|
|
|
|
#define AXP22X_LDOIO0 AXP22X_GPIO0LDOOUT_VOL
|
|
#define AXP22X_LDOIO1 AXP22X_GPIO1LDOOUT_VOL
|
|
#define AXP22X_LDO2 AXP22X_ALDO1OUT_VOL
|
|
#define AXP22X_LDO3 AXP22X_ALDO2OUT_VOL
|
|
#define AXP22X_LDO4 AXP22X_ALDO3OUT_VOL
|
|
#define AXP22X_SW0 AXP22X_STATUS
|
|
#define AXP22X_DC1SW AXP22X_STATUS
|
|
|
|
#define AXP22X_LDO1EN AXP22X_STATUS
|
|
#define AXP22X_LDO2EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_LDO3EN AXP22X_LDO_DC_EN1
|
|
|
|
#ifdef CONFIG_AW_AXP233
|
|
#define AXP22X_LDO4EN AXP22X_LDO_DC_EN2
|
|
#else
|
|
#define AXP22X_LDO4EN AXP22X_LDO_DC_EN3
|
|
#endif
|
|
|
|
#define AXP22X_LDO5EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO6EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO7EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO8EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO9EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO10EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO11EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_LDO12EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_DCDC1EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_DCDC2EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_DCDC3EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_DCDC4EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_DCDC5EN AXP22X_LDO_DC_EN1
|
|
#define AXP22X_LDOIO0EN AXP22X_GPIO0_CTL
|
|
#define AXP22X_LDOIO1EN AXP22X_GPIO1_CTL
|
|
#define AXP22X_DC1SW1EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_SW0EN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_DC1SWEN AXP22X_LDO_DC_EN2
|
|
#define AXP22X_BUCKMODE AXP22X_DCDC_MODESET
|
|
#define AXP22X_BUCKFREQ AXP22X_DCDC_FREQSET
|
|
|
|
extern int axp22x_need_save_regulator;
|
|
extern int axp22x_regulator_save(void);
|
|
extern void axp22x_regulator_restore(void);
|
|
|
|
#endif /* AXP22X_REGULATOR_H */
|