2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2015-10-03 13:18:33 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
|
|
|
|
*
|
|
|
|
* X-Powers AX Power Management IC support header
|
|
|
|
*/
|
|
|
|
#ifndef _AXP_PMIC_H_
|
2021-08-22 23:18:03 +00:00
|
|
|
#define _AXP_PMIC_H_
|
2015-10-03 13:18:33 +00:00
|
|
|
|
2021-10-08 05:17:20 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2015-10-03 13:18:33 +00:00
|
|
|
#include <axp152.h>
|
|
|
|
#include <axp209.h>
|
|
|
|
#include <axp221.h>
|
2021-01-11 20:11:33 +00:00
|
|
|
#include <axp305.h>
|
2016-05-02 02:28:15 +00:00
|
|
|
#include <axp809.h>
|
2015-11-28 17:07:21 +00:00
|
|
|
#include <axp818.h>
|
2015-10-03 13:18:33 +00:00
|
|
|
|
2021-10-08 05:17:20 +00:00
|
|
|
#define AXP_PMIC_MODE_REG 0x3e
|
|
|
|
#define AXP_PMIC_MODE_I2C 0x00
|
|
|
|
#define AXP_PMIC_MODE_P2WI 0x3e
|
2021-10-08 05:17:21 +00:00
|
|
|
#define AXP_PMIC_MODE_RSB 0x7c
|
|
|
|
|
|
|
|
#define AXP_PMIC_PRI_DEVICE_ADDR 0x3a3
|
|
|
|
#define AXP_PMIC_PRI_RUNTIME_ADDR 0x2d
|
|
|
|
#define AXP_PMIC_SEC_DEVICE_ADDR 0x745
|
|
|
|
#define AXP_PMIC_SEC_RUNTIME_ADDR 0x3a
|
2021-10-08 05:17:20 +00:00
|
|
|
|
2023-01-21 23:13:04 +00:00
|
|
|
enum {
|
|
|
|
AXP152_ID,
|
|
|
|
AXP202_ID,
|
|
|
|
AXP209_ID,
|
|
|
|
AXP221_ID,
|
|
|
|
AXP223_ID,
|
|
|
|
AXP803_ID,
|
|
|
|
AXP806_ID,
|
|
|
|
AXP809_ID,
|
|
|
|
AXP813_ID,
|
|
|
|
};
|
|
|
|
|
2015-10-03 13:18:33 +00:00
|
|
|
int axp_set_dcdc1(unsigned int mvolt);
|
|
|
|
int axp_set_dcdc2(unsigned int mvolt);
|
|
|
|
int axp_set_dcdc3(unsigned int mvolt);
|
|
|
|
int axp_set_dcdc4(unsigned int mvolt);
|
|
|
|
int axp_set_dcdc5(unsigned int mvolt);
|
|
|
|
int axp_set_aldo1(unsigned int mvolt);
|
|
|
|
int axp_set_aldo2(unsigned int mvolt);
|
|
|
|
int axp_set_aldo3(unsigned int mvolt);
|
|
|
|
int axp_set_aldo4(unsigned int mvolt);
|
2016-01-12 06:42:37 +00:00
|
|
|
int axp_set_dldo(int dldo_num, unsigned int mvolt);
|
2015-10-03 13:18:33 +00:00
|
|
|
int axp_set_eldo(int eldo_num, unsigned int mvolt);
|
2016-03-29 16:26:48 +00:00
|
|
|
int axp_set_fldo(int fldo_num, unsigned int mvolt);
|
2016-05-02 02:28:12 +00:00
|
|
|
int axp_set_sw(bool on);
|
2015-10-03 13:18:33 +00:00
|
|
|
int axp_init(void);
|
|
|
|
int axp_get_sid(unsigned int *sid);
|
|
|
|
|
|
|
|
#endif
|