summaryrefslogtreecommitdiffstats
path: root/drivers/power/reset/at91-reset.c
diff options
context:
space:
mode:
authorAnda-Maria Nicolae2015-07-07 14:25:53 +0200
committerSebastian Reichel2015-07-09 04:04:56 +0200
commitf5bbc91c88c18a4c518f066cc4e784d7b5fb9735 (patch)
tree1c8f8a69c95ab60c31c7a218b5c1a15c810cd0b7 /drivers/power/reset/at91-reset.c
parentLinux 4.2-rc1 (diff)
downloadkernel-qcow2-linux-f5bbc91c88c18a4c518f066cc4e784d7b5fb9735.tar.gz
kernel-qcow2-linux-f5bbc91c88c18a4c518f066cc4e784d7b5fb9735.tar.xz
kernel-qcow2-linux-f5bbc91c88c18a4c518f066cc4e784d7b5fb9735.zip
power_supply: rt9455_charger: Properly notify userspace about charging events
Charging events this patch refers to are: - charger is connected to/disconnected from the power source - battery is reconnected to the charger, after it was absent. When the charger is connected to/disconnected from the power source, CHRVPI interrupt occurs and PWR_RDY bit is either set or cleared. PWR_RDY bit is updated after 1-2 seconds CHRVPI interrupt has occurred. power_supply_changed() should be called after PWR_RDY bit is updated. /sys/class/power_supply/rt9455-charger/online file displays the value of PWR_RDY bit. This way, if the userspace is notified that a charging event has occurred and the userspace reads /sys/class/power_supply/rt9455-charger/online file, this file is properly updated when the userspace reads it. This is the reason why power_supply_changed() is called in rt9455_pwr_rdy_work_callback(), instead of being called in interrupt handler. Since no interrupt is triggered when the battery is reconnected to the charger, the userspace is never notified that the battery is reconnected. This is why power_supply_changed() is called in rt9455_max_charging_time_work_callback(), so that the userspace is notified that the battery is reconnected. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/reset/at91-reset.c')
0 files changed, 0 insertions, 0 deletions