New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 862777 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

platform/ec: unify current limits for bc12 / USB charging

Project Member Reported by tbroch@chromium.org, Jul 11

Issue description

Currently there's various hard-coded values for USB charge current limits.

For example,

driver/bc12/bq24392.c:89:       new_chg.current = is_chg_det_activated(cfg) ? 2400 : 500;
driver/bc12/pi3usb9281.c:209:           current_limit_ma = 2400;

As noted here by mdh, crrev.com/c/1123658, who also pointed out it would be good to unify these constants to avoid confusion as to why the particular value was chosen.  Lets do it.

Mark's proposal to add to usb_charge.h

#define MAX_RAMP_SDP_mA 500
#define MAX_RAMP_CDP_mA 1500
#define MAX_RAMP_DCP_mA 2000
#define MAX_RAMP_APPLE2.0_mA 2000
#define MAX_RAMP_APPLE2.4_mA 2400
/* Use this when you can tell it is a charger, but don't know DCP vs Apple */
#define MAX_RAMP_CHARGER_DET_mA 2000

Note, usb_charge.h does have one of these already:

/* USB charger minimum current */
#define USB_CHARGER_MIN_CURR_MA 500

w/ a few usages,
common/usb_charger.c:33:                charge.current = USB_CHARGER_MIN_CURR_MA;
driver/charger/rt946x.c:898:            return USB_CHARGER_MIN_CURR_MA;

Anyone feel strongly about the prefix?

I'd propose 'USB_CHARGER_CUR' as the prefix ... for example
#define USB_CHARGER_CUR_SDP_MA 500


 

Sign in to add a comment