OSDN Git Service

qpnp: smb-lib: move usb_icl_votable to battery library
authorAshay Jaiswal <ashayj@codeaurora.org>
Wed, 22 Mar 2017 17:48:51 +0000 (23:18 +0530)
committerAshay Jaiswal <ashayj@codeaurora.org>
Wed, 5 Apr 2017 04:32:46 +0000 (10:02 +0530)
commit7ddef0d5e4503fd8b0f98389b8469cfa831fade6
tree5d22ce97ad6f3e7da843c9d39f619aeb06879db6
parentef45c30bc84a0ba83be48f0aa59e7170bf5058a8
qpnp: smb-lib: move usb_icl_votable to battery library

Move usb_icl_votable creation and it's callback in the
battery.c file, in preparation for an upcoming change where
usb_icl_votable callback will be able to
disable parallel charger when a low input current
request is set.

The new callback uses CURRENT_MAX property to be set on main
psy to set the ICL limit of primary charger.

The limit setting code in main charger path where the votable
call resides currently relies a lot on client being present or not.
Since the votable is being moved away, it won't have information
about the client. So use the current parameter of INT_MAX to
indicate no clients present.

Also it could be that main psy is not instantiated by the time first
icl vote comes in. Ensure that we rerun_election on usb_icl_votable
the instant main psy is seen.

CRs-Fixed: 2014572
Change-Id: Ie449af086ed9218b40ea83158b69e8f8e73edda3
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
drivers/power/supply/qcom/battery.c
drivers/power/supply/qcom/qpnp-smb2.c
drivers/power/supply/qcom/smb-lib.c
drivers/power/supply/qcom/smb-lib.h