Other Parts Discussed in Thread: BQ25890,
Tool/software:
Please see the output below.
When the kernel module is reloaded, depending on whether the USB is connected or not, it updates few of the values (POWER_SUPPLY_ONLINE, POWER_SUPPLY_STATUS, POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE).
However, unless it is reloaded it seems that these values never update.
Could you advise why the driver may not be updating the values automatically?
$ modinfo -F filename bq25890_charger
/lib/modules/4.4.194/bq25890_charger.ko
$ cat /sys/class/power_supply/bq25890-charger/uevent
POWER_SUPPLY_NAME=bq25890-charger
POWER_SUPPLY_MANUFACTURER=Texas Instruments
POWER_SUPPLY_MODEL_NAME=BQ25895
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_CHARGE_TYPE=N/A
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1088000
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE=2304000
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE_MAX=4208000
POWER_SUPPLY_CHARGE_TERM_CURRENT=64000
POWER_SUPPLY_INPUT_CURRENT_LIMIT=2100000
POWER_SUPPLY_VOLTAGE_NOW=2304000
POWER_SUPPLY_CURRENT_NOW=0
$ echo "Disconnect USB and wait 10 seconds"
Disconnect USB and wait 10 seconds
$ cat /sys/class/power_supply/bq25890-charger/uevent
POWER_SUPPLY_NAME=bq25890-charger
POWER_SUPPLY_MANUFACTURER=Texas Instruments
POWER_SUPPLY_MODEL_NAME=BQ25895
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_CHARGE_TYPE=N/A
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1088000
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE=2304000
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE_MAX=4208000
POWER_SUPPLY_CHARGE_TERM_CURRENT=64000
POWER_SUPPLY_INPUT_CURRENT_LIMIT=2100000
POWER_SUPPLY_VOLTAGE_NOW=2304000
POWER_SUPPLY_CURRENT_NOW=0
$ sudo rmmod bq25890_charger
$ sudo insmod bq25890_charger.ko
$ cat /sys/class/power_supply/bq25890-charger/uevent
POWER_SUPPLY_NAME=bq25890-charger
POWER_SUPPLY_MANUFACTURER=Texas Instruments
POWER_SUPPLY_MODEL_NAME=BQ25895
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_CHARGE_TYPE=N/A
POWER_SUPPLY_ONLINE=0
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1088000
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE=0
POWER_SUPPLY_CONSTANT_CHARGE_VOLTAGE_MAX=4208000
POWER_SUPPLY_CHARGE_TERM_CURRENT=64000
POWER_SUPPLY_INPUT_CURRENT_LIMIT=2100000
POWER_SUPPLY_VOLTAGE_NOW=2304000
POWER_SUPPLY_CURRENT_NOW=0