power: rk818-charger: add TS2 voltage detect when update input current
authorchenjh <chenjh@rock-chips.com>
Wed, 17 May 2017 09:27:56 +0000 (17:27 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 19 May 2017 07:31:03 +0000 (15:31 +0800)
commit9decafdc60597edc2a63164597ede3fb601976e7
treec67079763028e38576813231ee32f26de39beb87
parent3244d204d45b22ac4ec4d8f987a027a403d405dc
power: rk818-charger: add TS2 voltage detect when update input current

rk818's input charge voltage limit function doesn't works well. If software
set input current over than charger's max support value, rk818 may cause
charger over current protect which means disconnecting.
To solve this problem, we need to detect vbus voltage by TS2 pin, if vbus
is upper than 4.4v, we can safely adjust input current step by step from
low to high until meeting the target input current value.

Change-Id: I01d63974f251ad8ef0037158b66f4b85d3928baf
Signed-off-by: chenjh <chenjh@rock-chips.com>
drivers/power/rk818_charger.c