From 0732d05b33b68a31a06fdbb831c8e13b5f08c7e6 Mon Sep 17 00:00:00 2001 From: weiweij Date: Tue, 24 May 2022 15:54:36 +0800 Subject: [PATCH] wls-chg: change psy/voltage_now's value to vout value For the file pointer of psy/wireless/voltage_now, it should be the result of VOUT value. If we use the result of vbus(from usb/voltage_now), it could not distinguish between the result from charger out and the one from wireless out. Meanwhile, the required voltage unit is 0.1mV. So we should make the result by 10. Change-Id: Ibf6e657da8bd594985c64cf2aabe004b153e78ea Reviewed-on: https://gerrit.mot.com/2278185 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/power/cps4019_wls_charger/cps4019_wls_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c b/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c index 63996d39f4ac..58dd875576fd 100644 --- a/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c +++ b/drivers/power/cps4019_wls_charger/cps4019_wls_charger.c @@ -1202,7 +1202,7 @@ static int cps_wls_get_vout(void) { cps_reg_s *cps_reg; cps_reg = (cps_reg_s*)(&cps_reg_cfg[CPS_REG_ADC_VOUT]); - return cps_wls_read_reg((int)cps_reg->reg_addr, (int)cps_reg->reg_bytes_len); + return cps_wls_read_reg((int)cps_reg->reg_addr, (int)cps_reg->reg_bytes_len) * 10;//request unit is 0.1mV } static int cps_wls_get_state(void) @@ -1387,7 +1387,7 @@ static int cps_wls_chrg_get_property(struct power_supply *psy, val->intval = 5000000;//Have no usage, just for voltage max propety. break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: - ret = cps_get_power_supply_prop("usb", psp, val); + val->intval = cps_wls_get_vout(); break; case POWER_SUPPLY_PROP_CURRENT_NOW: ret = cps_get_power_supply_prop("battery", psp, val);