#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <sys-i2c.h>
#include "reg-axp.h"
Go to the source code of this file.
|
| int | axp_set_vol (sunxi_i2c_t *i2c_dev, char *name, int set_vol, int onoff, axp_contrl_info *axp_ctrl_tbl, uint8_t axp_ctrl_tbl_size, uint8_t axp_addr) |
| | Set the voltage for a specific power domain controlled by AXP.
|
| |
| int | axp_get_vol (sunxi_i2c_t *i2c_dev, char *name, axp_contrl_info *axp_ctrl_tbl, uint8_t axp_ctrl_tbl_size, uint8_t axp_addr) |
| | Get the voltage value for a specific power domain controlled by AXP.
|
| |
| | DEFINE_AXP_PMU (axp1530) |
| |
| | DEFINE_AXP_PMU (axp2202) |
| |
| | DEFINE_AXP_PMU (axp2101) |
| |
| | DEFINE_AXP_PMU (axp8191) |
| |
| | DEFINE_AXP_PMU (axp333) |
| |
| int | pmu_axp1530_set_dual_phase (sunxi_i2c_t *i2c_dev) |
| | Set the dual phase function on the AXP1530 PMU.
|
| |
◆ DEFINE_AXP_PMU
| #define DEFINE_AXP_PMU |
( |
|
name | ) |
|
Value:
char name[ANDR_BOOT_NAME_SIZE]
Definition bimage.c:76
Structure representing an I2C device configuration.
Definition sys-i2c.h:39
Macro to define PMU functions for a specific AXP PMU chip.
This macro generates a set of function prototypes for controlling and interacting with a specified AXP Power Management Unit (PMU) chip.
The generated functions are:
pmu_<name>_init: Initializes the PMU for the specified device.
pmu_<name>_get_vol: Retrieves the voltage of a specified power rail.
pmu_<name>_set_vol: Sets the voltage of a specified power rail.
pmu_<name>_dump: Dumps the internal registers and status of the PMU.
Example usage:
#define DEFINE_AXP_PMU(name)
Macro to define PMU functions for a specific AXP PMU chip.
Definition axp.h:100
This will generate the following function prototypes:
- Parameters
-
| name | The name of the PMU chip (e.g., axp2202, axp221, etc.). |
◆ axp_contrl_info
Structure describing the control information of a power domain.
◆ axp_step_info_t
Structure describing a voltage step of the power domain.
◆ axp_get_vol()
Get the voltage value for a specific power domain controlled by AXP.
- Parameters
-
| i2c_dev | Pointer to the I2C device structure. |
| name | Name of the power domain. |
| axp_ctrl_tbl | Pointer to the AXP control information table. |
| axp_ctrl_tbl_size | Size of the AXP control information table. |
| axp_addr | AXP device address. |
- Returns
- The voltage value of the specified power domain.
◆ axp_set_vol()
Set the voltage for a specific power domain controlled by AXP.
- Parameters
-
| i2c_dev | Pointer to the I2C device structure. |
| name | Name of the power domain. |
| set_vol | Voltage value to set. |
| onoff | Whether to turn on or off the power domain (1 for on, 0 for off). |
| axp_ctrl_tbl | Pointer to the AXP control information table. |
| axp_ctrl_tbl_size | Size of the AXP control information table. |
| axp_addr | AXP device address. |
- Returns
- Integer indicating the success status of the operation.
◆ DEFINE_AXP_PMU() [1/5]
| DEFINE_AXP_PMU |
( |
axp1530 |
| ) |
|
◆ DEFINE_AXP_PMU() [2/5]
| DEFINE_AXP_PMU |
( |
axp2101 |
| ) |
|
◆ DEFINE_AXP_PMU() [3/5]
| DEFINE_AXP_PMU |
( |
axp2202 |
| ) |
|
◆ DEFINE_AXP_PMU() [4/5]
| DEFINE_AXP_PMU |
( |
axp333 |
| ) |
|
◆ DEFINE_AXP_PMU() [5/5]
| DEFINE_AXP_PMU |
( |
axp8191 |
| ) |
|
◆ pmu_axp1530_set_dual_phase()
| int pmu_axp1530_set_dual_phase |
( |
sunxi_i2c_t * |
i2c_dev | ) |
|
Set the dual phase function on the AXP1530 PMU.
- Parameters
-
| i2c_dev | Pointer to the I2C device structure. |
- Returns
- 0 if successful, -1 if an error occurred.