summaryrefslogtreecommitdiff
path: root/board/ryu/usb_pd_policy.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-08-08 10:54:08 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-12 05:11:39 +0000
commit283fe98939fa56c61280529e2f933bedb122a52a (patch)
tree9f23119e61da776c19363b572204071549ae2b0b /board/ryu/usb_pd_policy.c
parentadbd5a0c9a6749468b7c085029cf5e5a41595dbf (diff)
downloadchrome-ec-stabilize-6146.B.tar.gz
samus: ryu: fix charge state machine init of input currentstabilize-6146.B
Currently charge state machine resets input current limit to default every time AC is connected. Problem is by the time charge state machine gets around to setting input current, it could have already been set by successful PD negotiation, and this ends up overriding that value. This fix has the state machine store desired input current limit, as determined from PD negotation or any other place, and send last desired input current limit on AC connect. BUG=chrome-os-partner:24461 BRANCH=none TEST=load on samus, test toggling between "pd 0 dev 5" and "pd 0 dev 20", and test plugging and unplugging zinger numerous times, and verify charger command always gives the expected input current limit based on PD negotiation. Change-Id: I18d8acc9e2085739e783c9c70c682d46bcce7fdb Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/211639 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/ryu/usb_pd_policy.c')
-rw-r--r--board/ryu/usb_pd_policy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/board/ryu/usb_pd_policy.c b/board/ryu/usb_pd_policy.c
index f202b31e24..453e463d59 100644
--- a/board/ryu/usb_pd_policy.c
+++ b/board/ryu/usb_pd_policy.c
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-#include "charger.h"
+#include "charge_state.h"
#include "common.h"
#include "console.h"
#include "gpio.h"
@@ -80,7 +80,7 @@ int pd_choose_voltage(int cnt, uint32_t *src_caps, uint32_t *rdo)
void pd_set_input_current_limit(uint32_t max_ma)
{
- int rv = charger_set_input_current(MAX(max_ma,
+ int rv = charge_set_input_current_limit(MAX(max_ma,
CONFIG_CHARGER_INPUT_CURRENT));
if (rv < 0)
CPRINTS("Failed to set input current limit for PD");