mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
power: pm8921-bms: remove support for pm8921 v1.0 and v1.1
The bms module is reused in multiple pmics. It is now unnecessary to check for 8921 versions in the driver. As a result of this change older 8921 versions are not supported. CRs-Fixed: 372679 Change-Id: Ie9131d47ed08fa6fa39812c9e60be34cc6280e4c Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This commit is contained in:
parent
a06763ac29
commit
141fd301b7
1 changed files with 3 additions and 20 deletions
|
@ -472,29 +472,12 @@ static int adjust_xo_vbatt_reading(struct pm8921_bms_chip *chip,
|
|||
* VBATT_MUL_FACTOR;
|
||||
}
|
||||
|
||||
#define CC_RESOLUTION_N_V1 1085069
|
||||
#define CC_RESOLUTION_D_V1 100000
|
||||
#define CC_RESOLUTION_N_V2 868056
|
||||
#define CC_RESOLUTION_D_V2 10000
|
||||
static s64 cc_to_microvolt_v1(s64 cc)
|
||||
{
|
||||
return div_s64(cc * CC_RESOLUTION_N_V1, CC_RESOLUTION_D_V1);
|
||||
}
|
||||
|
||||
static s64 cc_to_microvolt_v2(s64 cc)
|
||||
{
|
||||
return div_s64(cc * CC_RESOLUTION_N_V2, CC_RESOLUTION_D_V2);
|
||||
}
|
||||
#define CC_RESOLUTION_N 868056
|
||||
#define CC_RESOLUTION_D 10000
|
||||
|
||||
static s64 cc_to_microvolt(struct pm8921_bms_chip *chip, s64 cc)
|
||||
{
|
||||
/*
|
||||
* resolution (the value of a single bit) was changed after revision 2.0
|
||||
* for more accurate readings
|
||||
*/
|
||||
return (chip->revision < PM8XXX_REVISION_8921_2p0) ?
|
||||
cc_to_microvolt_v1((s64)cc) :
|
||||
cc_to_microvolt_v2((s64)cc);
|
||||
return div_s64(cc * CC_RESOLUTION_N, CC_RESOLUTION_D);
|
||||
}
|
||||
|
||||
#define CC_READING_TICKS 55
|
||||
|
|
Loading…
Reference in a new issue