summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-05-13 10:55:28 +0800
committerChromeBot <chrome-bot@google.com>2013-05-13 19:31:13 -0700
commitcbebc28804cfcaed9687408f1673017a070320bb (patch)
tree285ea9d66cfa8659866629f1302299baef0fc626
parentc18ef5f4219fddf36052abb5052396808c4fca4a (diff)
downloadchrome-ec-cbebc28804cfcaed9687408f1673017a070320bb.tar.gz
spring: Pull more current from video dongle
We cannot know how much current we can pull from video dongle, so let's just try to pull as much as possible up to 2A. BUG=chrome-os-partner:19324 TEST=Plug in video dongle and see 3.3V output. TEST=Plug in video dongle with supplied charger, and see 50% PWM duty cycle. TEST=Plug in video dongle with normal charger, and see 70~80% PWM duty cycle. BRANCH=spring Change-Id: I8b503f886fcafaa11e6757a5059ce673a8ed53cc Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/50963 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/extpower_usb.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/common/extpower_usb.c b/common/extpower_usb.c
index de09d61abe..56a85253ae 100644
--- a/common/extpower_usb.c
+++ b/common/extpower_usb.c
@@ -257,12 +257,12 @@ static int apple_charger_current(void)
return apple_charger_type[type];
}
-static int dcp_current_limit(void)
+static int hard_current_limit(int limit)
{
if (current_limit_mode == LIMIT_AGGRESSIVE)
- return I_LIMIT_1500MA - PWM_CTRL_OC_MARGIN;
+ return limit - PWM_CTRL_OC_MARGIN;
else
- return I_LIMIT_1500MA;
+ return limit;
}
static int probe_video(int device_type)
@@ -488,7 +488,9 @@ static void usb_update_ilim(int dev_type)
else if (dev_type & TSU6721_TYPE_CDP)
current_limit = I_LIMIT_1500MA;
else if (dev_type & TSU6721_TYPE_DCP)
- current_limit = dcp_current_limit();
+ current_limit = hard_current_limit(I_LIMIT_1500MA);
+ else if (dev_type & TSU6721_TYPE_JIG_UART_ON)
+ current_limit = hard_current_limit(I_LIMIT_2000MA);
pwm_nominal_duty_cycle(current_limit);
} else {
@@ -687,10 +689,12 @@ static void power_tweak(void)
/* Check video power input change */
if (current_dev_type & TSU6721_TYPE_JIG_UART_ON) {
- if (get_video_power() && vbus > 4000)
+ if (get_video_power() && vbus > 4000) {
set_video_power(0);
- else if (!get_video_power() && vbus <= 4000)
+ } else if (!get_video_power() && vbus <= 4000) {
+ set_pwm_duty_cycle(100);
set_video_power(1);
+ }
}
if (battery_current(&current))