mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-03 21:49:32 +00:00
ryu: remove charge ramping
The charger chip is supposed to handle this feature in hardware. Let's disable the software version to exercise the hardware. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:38603 TEST=on Ryu P6, plug BC1.2 chargers through legacy A-to-C cable. Change-Id: I074eee0621ba8d23c7ef87dd251ce8fbf86a0265 Reviewed-on: https://chromium-review.googlesource.com/269518 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
f782bab165
commit
b9222ae924
@@ -344,9 +344,6 @@ const struct adc_t adc_channels[] = {
|
||||
/* USB PD CC lines sensing. Converted to mV (3000mV/4096). */
|
||||
[ADC_CC1_PD] = {"CC1_PD", 3000, 4096, 0, STM32_AIN(1)},
|
||||
[ADC_CC2_PD] = {"CC2_PD", 3000, 4096, 0, STM32_AIN(3)},
|
||||
/* Charger current sensing. Converted to mA. */
|
||||
[ADC_IADP] = {"IADP", 7500, 4096, 0, STM32_AIN(8)},
|
||||
[ADC_IBAT] = {"IBAT", 37500, 4096, 0, STM32_AIN(13)},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
|
||||
|
||||
@@ -489,52 +486,6 @@ void board_set_charge_limit(int charge_ma)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether ramping is allowed for given supplier
|
||||
*/
|
||||
int board_is_ramp_allowed(int supplier)
|
||||
{
|
||||
return supplier == CHARGE_SUPPLIER_BC12_DCP ||
|
||||
supplier == CHARGE_SUPPLIER_BC12_SDP ||
|
||||
supplier == CHARGE_SUPPLIER_BC12_CDP ||
|
||||
supplier == CHARGE_SUPPLIER_PROPRIETARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the maximum allowed input current
|
||||
*/
|
||||
int board_get_ramp_current_limit(int supplier, int sup_curr)
|
||||
{
|
||||
switch (supplier) {
|
||||
case CHARGE_SUPPLIER_BC12_DCP:
|
||||
return 2000;
|
||||
case CHARGE_SUPPLIER_BC12_SDP:
|
||||
return 1000;
|
||||
case CHARGE_SUPPLIER_BC12_CDP:
|
||||
case CHARGE_SUPPLIER_PROPRIETARY:
|
||||
return sup_curr;
|
||||
default:
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if board is consuming full amount of input current
|
||||
*/
|
||||
int board_is_consuming_full_charge(void)
|
||||
{
|
||||
return adc_read_channel(ADC_IADP) >= charge_current_limit -
|
||||
IADP_ERROR_MARGIN_MA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if VBUS is sagging low enough that we should stop ramping
|
||||
*/
|
||||
int board_is_vbus_too_low(enum chg_ramp_vbus_state ramp_state)
|
||||
{
|
||||
return adc_read_channel(ADC_VBUS) < VBUS_LOW_THRESHOLD_MV;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable and disable SPI for case closed debugging. This forces the AP into
|
||||
* reset while SPI is enabled, thus preventing contention on the SPI interface.
|
||||
*/
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
/* Optional features */
|
||||
#undef CONFIG_CMD_HASH
|
||||
#define CONFIG_CHARGE_MANAGER
|
||||
#define CONFIG_CHARGE_RAMP
|
||||
#define CONFIG_CMD_CHGRAMP
|
||||
#define CONFIG_FORCE_CONSOLE_RESUME
|
||||
#define CONFIG_STM_HWTIMER32
|
||||
#define CONFIG_USB_POWER_DELIVERY
|
||||
@@ -148,8 +146,6 @@ enum adc_channel {
|
||||
ADC_VBUS = 0,
|
||||
ADC_CC1_PD,
|
||||
ADC_CC2_PD,
|
||||
ADC_IADP,
|
||||
ADC_IBAT,
|
||||
/* Number of ADC channels */
|
||||
ADC_CH_COUNT
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
#define CONFIG_TASK_LIST \
|
||||
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
|
||||
TASK_ALWAYS(CHG_RAMP, chg_ramp_task, NULL, SMALLER_TASK_STACK_SIZE) \
|
||||
TASK_ALWAYS(USB_CHG, usb_charger_task, NULL, SMALLER_TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, LARGER_TASK_STACK_SIZE) \
|
||||
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
|
||||
|
||||
Reference in New Issue
Block a user