mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-07 16:11:43 +00:00
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>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user