diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/power/max17042_battery.h | 48 | ||||
-rw-r--r-- | include/linux/power_supply.h | 10 |
2 files changed, 57 insertions, 1 deletions
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h index 4badd5322949..d55c746ac56e 100644 --- a/include/linux/power/max17042_battery.h +++ b/include/linux/power/max17042_battery.h @@ -105,11 +105,56 @@ enum max17042_register { MAX17042_OCV = 0xEE, - MAX17042_OCVInternal = 0xFB, + MAX17042_OCVInternal = 0xFB, /* MAX17055 VFOCV */ MAX17042_VFSOC = 0xFF, }; +enum max17055_register { + MAX17055_QRes = 0x0C, + MAX17055_TTF = 0x20, + MAX17055_V_empty = 0x3A, + MAX17055_TIMER = 0x3E, + MAX17055_USER_MEM = 0x40, + MAX17055_RGAIN = 0x42, + + MAX17055_ConvgCfg = 0x49, + MAX17055_VFRemCap = 0x4A, + + MAX17055_STATUS2 = 0xB0, + MAX17055_POWER = 0xB1, + MAX17055_ID = 0xB2, + MAX17055_AvgPower = 0xB3, + MAX17055_IAlrtTh = 0xB4, + MAX17055_TTFCfg = 0xB5, + MAX17055_CVMixCap = 0xB6, + MAX17055_CVHalfTime = 0xB7, + MAX17055_CGTempCo = 0xB8, + MAX17055_Curve = 0xB9, + MAX17055_HibCfg = 0xBA, + MAX17055_Config2 = 0xBB, + MAX17055_VRipple = 0xBC, + MAX17055_RippleCfg = 0xBD, + MAX17055_TimerH = 0xBE, + + MAX17055_RSense = 0xD0, + MAX17055_ScOcvLim = 0xD1, + + MAX17055_SOCHold = 0xD3, + MAX17055_MaxPeakPwr = 0xD4, + MAX17055_SusPeakPwr = 0xD5, + MAX17055_PackResistance = 0xD6, + MAX17055_SysResistance = 0xD7, + MAX17055_MinSysV = 0xD8, + MAX17055_MPPCurrent = 0xD9, + MAX17055_SPPCurrent = 0xDA, + MAX17055_ModelCfg = 0xDB, + MAX17055_AtQResidual = 0xDC, + MAX17055_AtTTE = 0xDD, + MAX17055_AtAvSOC = 0xDE, + MAX17055_AtAvCap = 0xDF, +}; + /* Registers specific to max17047/50 */ enum max17047_register { MAX17047_QRTbl00 = 0x12, @@ -125,6 +170,7 @@ enum max170xx_chip_type { MAXIM_DEVICE_TYPE_MAX17042, MAXIM_DEVICE_TYPE_MAX17047, MAXIM_DEVICE_TYPE_MAX17050, + MAXIM_DEVICE_TYPE_MAX17055, MAXIM_DEVICE_TYPE_NUM }; diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 28413f737e7d..dcd5a71e6c67 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -325,6 +325,11 @@ struct power_supply_battery_ocv_table { int capacity; /* percent */ }; +struct power_supply_resistance_temp_table { + int temp; /* celsius */ + int resistance; /* internal resistance percent */ +}; + #define POWER_SUPPLY_OCV_TEMP_MAX 20 /* @@ -349,6 +354,8 @@ struct power_supply_battery_info { int ocv_temp[POWER_SUPPLY_OCV_TEMP_MAX];/* celsius */ struct power_supply_battery_ocv_table *ocv_table[POWER_SUPPLY_OCV_TEMP_MAX]; int ocv_table_size[POWER_SUPPLY_OCV_TEMP_MAX]; + struct power_supply_resistance_temp_table *resist_table; + int resist_table_size; }; extern struct atomic_notifier_head power_supply_notifier; @@ -381,6 +388,9 @@ power_supply_find_ocv2cap_table(struct power_supply_battery_info *info, int temp, int *table_len); extern int power_supply_batinfo_ocv2cap(struct power_supply_battery_info *info, int ocv, int temp); +extern int +power_supply_temp2resist_simple(struct power_supply_resistance_temp_table *table, + int table_len, int temp); extern void power_supply_changed(struct power_supply *psy); extern int power_supply_am_i_supplied(struct power_supply *psy); extern int power_supply_set_input_current_limit_from_supplier( |