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(¤t))