mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "power: supply: qti_battery_charger: Allow ICL to be set only for SDP"
This commit is contained in:
commit
ed86236edb
1 changed files with 10 additions and 2 deletions
|
|
@ -504,9 +504,18 @@ static const struct power_supply_desc wls_psy_desc = {
|
|||
|
||||
static int usb_psy_set_icl(struct battery_chg_dev *bcdev, u32 prop_id, int val)
|
||||
{
|
||||
struct psy_state *pst = &bcdev->psy_list[PSY_TYPE_USB];
|
||||
u32 temp;
|
||||
int rc;
|
||||
|
||||
rc = read_property_id(bcdev, pst, USB_ADAP_TYPE);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
/* Allow this only for SDP and not for other charger types */
|
||||
if (pst->prop[USB_ADAP_TYPE] != POWER_SUPPLY_USB_TYPE_SDP)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Input current limit (ICL) can be set by different clients. E.g. USB
|
||||
* driver can request for a current of 500/900 mA depending on the
|
||||
|
|
@ -518,8 +527,7 @@ static int usb_psy_set_icl(struct battery_chg_dev *bcdev, u32 prop_id, int val)
|
|||
if (val < 0)
|
||||
temp = UINT_MAX;
|
||||
|
||||
rc = write_property_id(bcdev, &bcdev->psy_list[PSY_TYPE_USB], prop_id,
|
||||
temp);
|
||||
rc = write_property_id(bcdev, pst, prop_id, temp);
|
||||
if (!rc)
|
||||
pr_debug("Set ICL to %u\n", temp);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue