mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
driver/power: add charge protocol get
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
fc35cf4737
commit
4ef7cf068b
@@ -125,7 +125,11 @@ struct battery_charger_operations_s
|
||||
|
||||
/* Get the actual output voltage for charging */
|
||||
|
||||
int (*get_voltage)(struct battery_charger_dev_s *dev, int *value);
|
||||
int (*get_voltage)(struct battery_charger_dev_s *dev, FAR int *value);
|
||||
|
||||
/* Get charge protocol */
|
||||
|
||||
int (*get_protocol)(struct battery_charger_dev_s *dev, FAR int *value);
|
||||
};
|
||||
|
||||
/* This structure defines the battery driver state structure */
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#define BATIOC_COULOMBS _BATIOC(0x0010)
|
||||
#define BATIOC_CHIPID _BATIOC(0x0011)
|
||||
#define BATIOC_GET_VOLTAGE _BATIOC(0x0012)
|
||||
#define BATIOC_GET_PROTOCOL _BATIOC(0x0013)
|
||||
|
||||
/* Special input values for BATIOC_INPUT_CURRENT that may optionally
|
||||
* be supported by lower-half driver:
|
||||
@@ -110,6 +111,14 @@ enum battery_health_e
|
||||
BATTERY_HEALTH_DISCONNECTED /* Battery is not connected */
|
||||
};
|
||||
|
||||
/* battery charge protocol type */
|
||||
|
||||
enum battery_protocol_e
|
||||
{
|
||||
BATTERY_PROTOCOL_QC3P0 = 1 << 0, /* Battery charge protocol of adapter is QC 3.0 */
|
||||
BATTERY_PROTOCOL_TX_XIAOMI = 1 << 1, /* Battery charge protocol of TX is xiaomi standard */
|
||||
};
|
||||
|
||||
/* Battery operation message */
|
||||
|
||||
struct batio_operate_msg_s
|
||||
|
||||
Reference in New Issue
Block a user