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 <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
weiweij 2022-05-24 15:54:36 +08:00 • committed by Wei Wei
commit 0732d05b33

View file

@ -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);