mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 10:25:20 +00:00
BD99955: Support Pull-up port non-standard BC1.2 chargers
Some chargers with valid VBUS advertise as Pull-up ports. Hence,
added code to support these kind of chargers as non-standard
BC1.2 chargers.
BUG=chrome-os-partner:57163
BRANCH=none
TEST=Manually tested on reef. Used a Pull-up port non-standard
BC1.2 charger and observed it can ramp to its maximum
current ratings.
Change-Id: I33c4c3a64e9c7176c909a48f6fbc49e04d529541
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/385239
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Rachel Nancollas <rachelsn@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
f2dba9d779
commit
258bc48bac
@@ -198,11 +198,11 @@ static int bd99955_get_bc12_device_type(enum bd99955_charge_port port)
|
||||
return CHARGE_SUPPLIER_BC12_DCP;
|
||||
case BD99955_TYPE_SDP:
|
||||
return CHARGE_SUPPLIER_BC12_SDP;
|
||||
case BD99955_TYPE_PUP_PORT:
|
||||
case BD99955_TYPE_OTHER:
|
||||
return CHARGE_SUPPLIER_OTHER;
|
||||
case BD99955_TYPE_VBUS_OPEN:
|
||||
case BD99955_TYPE_PUP_PORT:
|
||||
case BD99955_TYPE_OPEN_PORT:
|
||||
case BD99955_TYPE_VBUS_OPEN:
|
||||
default:
|
||||
return CHARGE_SUPPLIER_NONE;
|
||||
}
|
||||
@@ -419,12 +419,11 @@ int charger_get_option(int *option)
|
||||
int rv;
|
||||
int reg;
|
||||
|
||||
rv = ch_raw_read16(BD99955_CMD_CHGOP_SET1, ®,
|
||||
rv = ch_raw_read16(BD99955_CMD_CHGOP_SET1, option,
|
||||
BD99955_EXTENDED_COMMAND);
|
||||
if (rv)
|
||||
return rv;
|
||||
|
||||
*option = reg;
|
||||
rv = ch_raw_read16(BD99955_CMD_CHGOP_SET2, ®,
|
||||
BD99955_EXTENDED_COMMAND);
|
||||
if (rv)
|
||||
|
||||
@@ -177,23 +177,31 @@ enum bd99955_charge_port {
|
||||
#define BD99955_CMD_UCD_STATUS_CHGPORT0 (1 << 12)
|
||||
#define BD99955_CMD_UCD_STATUS_PUPDET (1 << 11)
|
||||
#define BD99955_CMD_UCD_STATUS_CHGDET (1 << 6)
|
||||
#define BD99955_TYPE_VBUS_OPEN 0
|
||||
#define BD99955_TYPE_SDP BD99955_CMD_UCD_STATUS_CHGPORT0
|
||||
#define BD99955_TYPE_CDP (BD99955_CMD_UCD_STATUS_CHGDET | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT1)
|
||||
#define BD99955_TYPE_OTHER (BD99955_CMD_UCD_STATUS_CHGDET | \
|
||||
#define BD99955_TYPE_MASK (BD99955_CMD_UCD_STATUS_DCDFAIL | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT1 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0 | \
|
||||
BD99955_CMD_UCD_STATUS_DCDFAIL)
|
||||
#define BD99955_TYPE_DCP (BD99955_CMD_UCD_STATUS_CHGDET | \
|
||||
BD99955_CMD_UCD_STATUS_PUPDET | \
|
||||
BD99955_CMD_UCD_STATUS_CHGDET)
|
||||
|
||||
/* BC1.2 chargers */
|
||||
#define BD99955_TYPE_CDP (BD99955_CMD_UCD_STATUS_CHGPORT1 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGDET)
|
||||
#define BD99955_TYPE_DCP (BD99955_CMD_UCD_STATUS_CHGPORT1 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT1)
|
||||
#define BD99955_TYPE_PUP_PORT (BD99955_CMD_UCD_STATUS_PUPDET | \
|
||||
BD99955_CMD_UCD_STATUS_DCDFAIL | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0)
|
||||
BD99955_CMD_UCD_STATUS_CHGDET)
|
||||
#define BD99955_TYPE_SDP (BD99955_CMD_UCD_STATUS_CHGPORT0)
|
||||
/* non-standard BC1.2 chargers */
|
||||
#define BD99955_TYPE_OTHER (BD99955_CMD_UCD_STATUS_DCDFAIL | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT1 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0 | \
|
||||
BD99955_CMD_UCD_STATUS_CHGDET)
|
||||
#define BD99955_TYPE_PUP_PORT (BD99955_CMD_UCD_STATUS_DCDFAIL | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0 | \
|
||||
BD99955_CMD_UCD_STATUS_PUPDET)
|
||||
/* Open ports */
|
||||
#define BD99955_TYPE_OPEN_PORT (BD99955_CMD_UCD_STATUS_DCDFAIL | \
|
||||
BD99955_CMD_UCD_STATUS_CHGPORT0)
|
||||
#define BD99955_TYPE_MASK 0xB840
|
||||
#define BD99955_TYPE_VBUS_OPEN 0
|
||||
|
||||
#define BD99955_CMD_VCC_IDD_STATUS 0x2A
|
||||
#define BD99955_CMD_VCC_UCD_FCTRL_SET 0x2B
|
||||
|
||||
Reference in New Issue
Block a user