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

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

Merge "power: step-chg-jeita: Allow JEITA ARB workaround configurable"

parents a67c232d 87d410ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -5128,7 +5128,7 @@ int smblib_init(struct smb_charger *chg)
		}
		}


		rc = qcom_step_chg_init(chg->dev, chg->step_chg_enabled,
		rc = qcom_step_chg_init(chg->dev, chg->step_chg_enabled,
						chg->sw_jeita_enabled);
						chg->sw_jeita_enabled, true);
		if (rc < 0) {
		if (rc < 0) {
			smblib_err(chg, "Couldn't init qcom_step_chg_init rc=%d\n",
			smblib_err(chg, "Couldn't init qcom_step_chg_init rc=%d\n",
				rc);
				rc);
+1 −1
Original line number Original line Diff line number Diff line
@@ -5579,7 +5579,7 @@ int smblib_init(struct smb_charger *chg)
		}
		}


		rc = qcom_step_chg_init(chg->dev, chg->step_chg_enabled,
		rc = qcom_step_chg_init(chg->dev, chg->step_chg_enabled,
						chg->sw_jeita_enabled);
						chg->sw_jeita_enabled, false);
		if (rc < 0) {
		if (rc < 0) {
			smblib_err(chg, "Couldn't init qcom_step_chg_init rc=%d\n",
			smblib_err(chg, "Couldn't init qcom_step_chg_init rc=%d\n",
				rc);
				rc);
+4 −2
Original line number Original line Diff line number Diff line
@@ -50,6 +50,7 @@ struct step_chg_info {
	ktime_t			jeita_last_update_time;
	ktime_t			jeita_last_update_time;
	bool			step_chg_enable;
	bool			step_chg_enable;
	bool			sw_jeita_enable;
	bool			sw_jeita_enable;
	bool			jeita_arb_en;
	bool			config_is_read;
	bool			config_is_read;
	bool			step_chg_cfg_valid;
	bool			step_chg_cfg_valid;
	bool			sw_jeita_cfg_valid;
	bool			sw_jeita_cfg_valid;
@@ -601,7 +602,7 @@ static int handle_jeita(struct step_chg_info *chip)
	 * Suspend USB input path if battery voltage is above
	 * Suspend USB input path if battery voltage is above
	 * JEITA VFLOAT threshold.
	 * JEITA VFLOAT threshold.
	 */
	 */
	if (fv_uv > 0) {
	if (chip->jeita_arb_en && fv_uv > 0) {
		rc = power_supply_get_property(chip->batt_psy,
		rc = power_supply_get_property(chip->batt_psy,
				POWER_SUPPLY_PROP_VOLTAGE_NOW, &pval);
				POWER_SUPPLY_PROP_VOLTAGE_NOW, &pval);
		if (!rc && (pval.intval > fv_uv))
		if (!rc && (pval.intval > fv_uv))
@@ -753,7 +754,7 @@ static int step_chg_register_notifier(struct step_chg_info *chip)
}
}


int qcom_step_chg_init(struct device *dev,
int qcom_step_chg_init(struct device *dev,
		bool step_chg_enable, bool sw_jeita_enable)
		bool step_chg_enable, bool sw_jeita_enable, bool jeita_arb_en)
{
{
	int rc;
	int rc;
	struct step_chg_info *chip;
	struct step_chg_info *chip;
@@ -774,6 +775,7 @@ int qcom_step_chg_init(struct device *dev,
	chip->dev = dev;
	chip->dev = dev;
	chip->step_chg_enable = step_chg_enable;
	chip->step_chg_enable = step_chg_enable;
	chip->sw_jeita_enable = sw_jeita_enable;
	chip->sw_jeita_enable = sw_jeita_enable;
	chip->jeita_arb_en = jeita_arb_en;
	chip->step_index = -EINVAL;
	chip->step_index = -EINVAL;
	chip->jeita_fcc_index = -EINVAL;
	chip->jeita_fcc_index = -EINVAL;
	chip->jeita_fv_index = -EINVAL;
	chip->jeita_fv_index = -EINVAL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ struct range_data {
};
};


int qcom_step_chg_init(struct device *dev,
int qcom_step_chg_init(struct device *dev,
		bool step_chg_enable, bool sw_jeita_enable);
		bool step_chg_enable, bool sw_jeita_enable, bool jeita_arb_en);
void qcom_step_chg_deinit(void);
void qcom_step_chg_deinit(void);
int read_range_data_from_node(struct device_node *node,
int read_range_data_from_node(struct device_node *node,
		const char *prop_str, struct range_data *ranges,
		const char *prop_str, struct range_data *ranges,