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

Commit bcf27738 authored by Shilpa Suresh's avatar Shilpa Suresh
Browse files

power: qpnp-smb2: Use chg_param.smb_version in place of smb_version



Modify the qpnp-smb2.c, smb-lib.c and smb-lib.h files to use
chg_param.smb_version instead of smb_version to comply with the new
charger_param structure added in battery.h.

Change-Id: I8d1ae454be0c6f98b1fb070d4a99fb21cc486fce
Signed-off-by: default avatarShilpa Suresh <sbsure@codeaurora.org>
parent 6bc6218e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1889,7 +1889,7 @@ static int smb2_chg_config_init(struct smb2 *chip)

	switch (pmic_rev_id->pmic_subtype) {
	case PMI8998_SUBTYPE:
		chip->chg.smb_version = PMI8998_SUBTYPE;
		chip->chg.chg_param.smb_version = PMI8998_SUBTYPE;
		chip->chg.wa_flags |= BOOST_BACK_WA | QC_AUTH_INTERRUPT_WA_BIT
				| TYPEC_PBS_WA_BIT;
		if (pmic_rev_id->rev4 == PMI8998_V1P1_REV4) /* PMI rev 1.1 */
@@ -1905,7 +1905,7 @@ static int smb2_chg_config_init(struct smb2 *chip)
		chg->chg_freq.freq_above_otg_threshold = 800;
		break;
	case PM660_SUBTYPE:
		chip->chg.smb_version = PM660_SUBTYPE;
		chip->chg.chg_param.smb_version = PM660_SUBTYPE;
		chip->chg.wa_flags |= BOOST_BACK_WA | OTG_WA | OV_IRQ_WA_BIT
				| TYPEC_PBS_WA_BIT;
		chg->param.freq_buck = pm660_params.freq_buck;
+6 −6
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ static int smblib_set_adapter_allowance(struct smb_charger *chg,
	int rc = 0;

	/* PM660 only support max. 9V */
	if (chg->smb_version == PM660_SUBTYPE) {
	if (chg->chg_param.smb_version == PM660_SUBTYPE) {
		switch (allowed_voltage) {
		case USBIN_ADAPTER_ALLOW_12V:
		case USBIN_ADAPTER_ALLOW_9V_TO_12V:
@@ -776,7 +776,7 @@ static int smblib_get_hw_pulse_cnt(struct smb_charger *chg, int *count)
	int rc;
	u8 val[2];

	switch (chg->smb_version) {
	switch (chg->chg_param.smb_version) {
	case PMI8998_SUBTYPE:
		rc = smblib_read(chg, QC_PULSE_COUNT_STATUS_REG, val);
		if (rc) {
@@ -798,7 +798,7 @@ static int smblib_get_hw_pulse_cnt(struct smb_charger *chg, int *count)
		break;
	default:
		smblib_dbg(chg, PR_PARALLEL, "unknown SMB chip %d\n",
				chg->smb_version);
				chg->chg_param.smb_version);
		return -EINVAL;
	}

@@ -2418,7 +2418,7 @@ int smblib_get_prop_usb_voltage_max(struct smb_charger *chg,
	switch (chg->real_charger_type) {
	case POWER_SUPPLY_TYPE_USB_HVDCP:
	case POWER_SUPPLY_TYPE_USB_HVDCP_3:
		if (chg->smb_version == PM660_SUBTYPE)
		if (chg->chg_param.smb_version == PM660_SUBTYPE)
			val->intval = MICRO_9V;
		else
			val->intval = MICRO_12V;
@@ -2441,7 +2441,7 @@ int smblib_get_prop_usb_voltage_max_design(struct smb_charger *chg,
	case POWER_SUPPLY_TYPE_USB_HVDCP:
	case POWER_SUPPLY_TYPE_USB_HVDCP_3:
	case POWER_SUPPLY_TYPE_USB_PD:
		if (chg->smb_version == PM660_SUBTYPE)
		if (chg->chg_param.smb_version == PM660_SUBTYPE)
			val->intval = MICRO_9V;
		else
			val->intval = MICRO_12V;
@@ -5311,7 +5311,7 @@ int smblib_init(struct smb_charger *chg)

	switch (chg->mode) {
	case PARALLEL_MASTER:
		rc = qcom_batt_init(chg->smb_version);
		rc = qcom_batt_init(&chg->chg_param);
		if (rc < 0) {
			smblib_err(chg, "Couldn't init qcom_batt_init rc=%d\n",
				rc);
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/regulator/consumer.h>
#include <linux/extcon.h>
#include "storm-watch.h"
#include "battery.h"

enum print_reason {
	PR_INTERRUPT	= BIT(0),
@@ -245,7 +246,7 @@ struct smb_charger {
	int			*try_sink_enabled;
	enum smb_mode		mode;
	struct smb_chg_freq	chg_freq;
	int			smb_version;
	struct charger_param    chg_param;
	int			otg_delay_ms;
	int			*weak_chg_icl_ua;