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-14 08:04:16 -0700
commita7b1510f24ab1986d72b0a8a10a0227ac5f7aa60 (patch)
treeecab92c52b0fae72e4531fb1626034c9993cc16b
parentad9965c666bf705e38a1ab26f25fb8045624e86c (diff)
downloadchrome-ec-a7b1510f24ab1986d72b0a8a10a0227ac5f7aa60.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 Original-Change-Id: I8b503f886fcafaa11e6757a5059ce673a8ed53cc Signed-off-by: Vic Yang <victoryang@chromium.org> Change-Id: I480e0e0cce604306ab00e98f0f5ea81772607a60 Reviewed-on: https://gerrit.chromium.org/gerrit/50965 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index 89232a6421..a0c54517b9 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -245,12 +245,12 @@ static int board_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 video_dev_type(int device_type)
@@ -349,10 +349,12 @@ static void board_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) {
+ board_pwm_duty_cycle(100);
set_video_power(1);
+ }
}
if (battery_current(&current))
@@ -560,7 +562,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);
board_pwm_nominal_duty_cycle(current_limit);
} else {