Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad7c7b10 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "smb138x: support usbin-usbin with external rsense"

parents a3851309 cdd3e673
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -577,13 +577,15 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
		rc = smblib_get_usb_suspend(chg, &val->intval);
		break;
	case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED:
		if (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		if ((chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		|| (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN_EXT))
			rc = smblib_get_prop_input_current_limited(chg, val);
		else
			val->intval = 0;
		break;
	case POWER_SUPPLY_PROP_CURRENT_MAX:
		if (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		if ((chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		|| (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN_EXT))
			rc = smblib_get_charge_param(chg, &chg->param.usb_icl,
				&val->intval);
		else
@@ -669,7 +671,8 @@ static int smb138x_parallel_set_prop(struct power_supply *psy,
		rc = smb138x_set_parallel_suspend(chip, (bool)val->intval);
		break;
	case POWER_SUPPLY_PROP_CURRENT_MAX:
		if (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		if ((chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		|| (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN_EXT))
			rc = smblib_set_charge_param(chg, &chg->param.usb_icl,
				val->intval);
		break;
@@ -1484,7 +1487,8 @@ static int smb138x_slave_probe(struct smb138x *chip)
		goto cleanup;
	}

	if (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN) {
	if ((chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN)
		|| (chip->dt.pl_mode == POWER_SUPPLY_PL_USBIN_USBIN_EXT)) {
		rc = smb138x_init_vbus_regulator(chip);
		if (rc < 0) {
			pr_err("Couldn't initialize vbus regulator rc=%d\n",