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

Commit 575d1d7d authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb5: configure input from wireless"

parents aab55f76 2f7861a3
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -73,6 +73,13 @@ static struct smb_params smb5_pmi632_params = {
		.max_u	= 1000000,
		.step_u	= 250000,
	},
	.dc_icl		= {
		.name   = "DC input current limit",
		.reg    = DCDC_CFG_REF_MAX_PSNS_REG,
		.min_u  = 0,
		.max_u  = 1500000,
		.step_u = 50000,
	},
	.jeita_cc_comp_hot	= {
		.name	= "jeita fcc reduction",
		.reg	= JEITA_CCCOMP_CFG_HOT_REG,
@@ -140,6 +147,13 @@ static struct smb_params smb5_pm8150b_params = {
		.max_u	= 3000000,
		.step_u	= 500000,
	},
	.dc_icl		= {
		.name   = "DC input current limit",
		.reg    = DCDC_CFG_REF_MAX_PSNS_REG,
		.min_u  = 0,
		.max_u  = 1500000,
		.step_u = 50000,
	},
	.jeita_cc_comp_hot	= {
		.name	= "jeita fcc reduction",
		.reg	= JEITA_CCCOMP_CFG_HOT_REG,
@@ -954,6 +968,7 @@ static enum power_supply_property smb5_dc_props[] = {
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
	POWER_SUPPLY_PROP_PRESENT,
	POWER_SUPPLY_PROP_ONLINE,
	POWER_SUPPLY_PROP_CURRENT_MAX,
	POWER_SUPPLY_PROP_REAL_TYPE,
};

@@ -975,6 +990,10 @@ static int smb5_dc_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_ONLINE:
		rc = smblib_get_prop_dc_online(chg, val);
		break;
	case POWER_SUPPLY_PROP_CURRENT_MAX:
		rc = smblib_get_charge_param(chg, &chg->param.dc_icl,
					&val->intval);
		break;
	case POWER_SUPPLY_PROP_REAL_TYPE:
		val->intval = POWER_SUPPLY_TYPE_WIPOWER;
		break;
@@ -1001,6 +1020,10 @@ static int smb5_dc_set_prop(struct power_supply *psy,
		rc = vote(chg->dc_suspend_votable, WBC_VOTER,
				(bool)val->intval, 0);
		break;
	case POWER_SUPPLY_PROP_CURRENT_MAX:
		rc = smblib_set_charge_param(chg, &chg->param.dc_icl,
					val->intval);
		break;
	default:
		return -EINVAL;
	}
@@ -1656,6 +1679,14 @@ static int smb5_init_hw(struct smb5 *chip)
	vote(chg->usb_icl_votable, HW_LIMIT_VOTER,
			chg->hw_max_icl_ua > 0, chg->hw_max_icl_ua);

	/* set DC icl_max 1A */
	rc = smblib_set_charge_param(chg, &chg->param.dc_icl, 1000000);
	if (rc < 0) {
		dev_err(chg->dev,
			"Couldn't set dc_icl rc=%d\n", rc);
		return rc;
	}

	/*
	 * AICL configuration:
	 * start from min and AICL ADC disable, and enable aicl rerun
+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ struct smb_params {
	struct smb_chg_param	icl_max_stat;
	struct smb_chg_param	icl_stat;
	struct smb_chg_param	otg_cl;
	struct smb_chg_param	dc_icl;
	struct smb_chg_param	jeita_cc_comp_hot;
	struct smb_chg_param	jeita_cc_comp_cold;
	struct smb_chg_param	freq_switcher;
+2 −0
Original line number Diff line number Diff line
@@ -138,6 +138,8 @@ enum {
#define DCDC_OTG_CFG_REG			(DCDC_BASE + 0x53)
#define OTG_EN_SRC_CFG_BIT			BIT(1)

#define DCDC_CFG_REF_MAX_PSNS_REG		(DCDC_BASE + 0x8C)

/********************************
 *  BATIF Peripheral Registers  *
 ********************************/