add CDP max current config interface

add CDP max current config interface
for product config

Change-Id: I31dc81b67c46dc747163ceaa71bf61e8250b6385
Signed-off-by: Haijian Ma <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/2826519
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
This commit is contained in:
Haijian Ma 2023-12-15 17:48:05 +08:00 • committed by Xiaojun Ji
commit 8608c07035
3 changed files with 8 additions and 1 deletions

View file

@ -805,6 +805,12 @@ static int smb5_parse_dt_mmi(struct smb5 *chip, struct device_node *node)
chg->usb_dcp_curr_max = 0;
np = of_find_node_by_path("/chosen");
retval = of_property_read_u32(npoint, "qcom,cdp-curr-max",
&chg->usb_cdp_curr_max);
if (retval) {
chg->usb_cdp_curr_max = 1500000;
}
retval = of_property_read_u32(npoint, "qcom,dcp-curr-max",
&chg->usb_dcp_curr_max);
if (retval) {

View file

@ -6195,7 +6195,7 @@ static void update_sw_icl_max(struct smb_charger *chg, int val)
break;
case POWER_SUPPLY_TYPE_USB_CDP:
vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true,
CDP_CURRENT_UA);
(chg->usb_cdp_curr_max > 0) ? chg->usb_cdp_curr_max : CDP_CURRENT_UA);
vote(chg->usb_icl_votable, USB_PSY_VOTER, false, 0);
break;
case POWER_SUPPLY_TYPE_USB_DCP:

View file

@ -633,6 +633,7 @@ struct smb_charger {
ktime_t dcin_uv_last_time;
int last_wls_vout;
int usb_dcp_curr_max;
int usb_cdp_curr_max;
/* mmi qc3p */
struct iio_channel **iio_chan_list_mmi_cp;