spring: Hard-limit DCP current at 1.5A

The spec suggests we cannot reliably go over 1.5A and gracefully
recover. Let's avoid going over that limit.

BUG=chrome-os-partner:19267
TEST=Build spring
BRANCH=spring

Change-Id: I07411ff3ce4107e0289c5af5365ef5a23fd23e4e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50321
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vic Yang
2013-05-08 00:43:22 +08:00
committed by ChromeBot
parent b38a0988d7
commit b1b91c82b6

View File

@@ -257,6 +257,14 @@ static int apple_charger_current(void)
return apple_charger_type[type];
}
static int dcp_current_limit(void)
{
if (current_limit_mode == LIMIT_AGGRESSIVE)
return I_LIMIT_1500MA - PWM_CTRL_OC_MARGIN;
else
return I_LIMIT_1500MA;
}
static int probe_video(int device_type)
{
tsu6721_disable_interrupts();
@@ -475,11 +483,12 @@ static void usb_update_ilim(int dev_type)
int current_limit = I_LIMIT_500MA;
if (dev_type & TSU6721_TYPE_CHG12)
current_limit = I_LIMIT_3000MA;
else if (dev_type & TSU6721_TYPE_APPLE_CHG) {
else if (dev_type & TSU6721_TYPE_APPLE_CHG)
current_limit = apple_charger_current();
} else if ((dev_type & TSU6721_TYPE_CDP) ||
(dev_type & TSU6721_TYPE_DCP))
else if (dev_type & TSU6721_TYPE_CDP)
current_limit = I_LIMIT_1500MA;
else if (dev_type & TSU6721_TYPE_DCP)
current_limit = dcp_current_limit();
pwm_nominal_duty_cycle(current_limit);
} else {