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

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

Merge "power: qpnp-qg: Add support for voltage-only mode of QG"

parents 8480036e 5b82a4fb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -308,6 +308,11 @@ First Level Node - QGAUGE device
	Definition: Boolean property to support external-rsense based
		    configuration.

- qcom,qg-vbms-mode
	Usage:      optional
	Value type: <bool>
	Definition: Boolean property to run QG in Voltage-only mode of QG.

- qcom,shutdown-temp-diff
	Usage:      optional
	Value type: <u32>
+20 −1
Original line number Diff line number Diff line
@@ -1055,9 +1055,19 @@ static void ttf_work(struct work_struct *work)
	struct ttf *ttf = container_of(work,
				struct ttf, ttf_work.work);
	int rc, ibatt_now, vbatt_now, ttf_now, charge_status;
	int valid = 0;
	ktime_t ktime_now;

	mutex_lock(&ttf->lock);
	rc = ttf->get_ttf_param(ttf->data, TTF_VALID, &valid);
	if (rc < 0) {
		pr_err("failed to get ttf_valid rc=%d\n", rc);
		goto end_work;
	}

	if (!valid)
		goto end_work;

	rc =  ttf->get_ttf_param(ttf->data, TTF_CHG_STATUS, &charge_status);
	if (rc < 0) {
		pr_err("failed to get charge_status rc=%d\n", rc);
@@ -1198,7 +1208,16 @@ int ttf_get_time_to_empty(struct ttf *ttf, int *val)
 */
void ttf_update(struct ttf *ttf, bool input_present)
{
	int delay_ms;
	int delay_ms, rc, valid = 0;

	rc = ttf->get_ttf_param(ttf->data, TTF_VALID, &valid);
	if (rc < 0) {
		pr_err("failed to get ttf_valid rc=%d\n", rc);
		return;
	}

	if (!valid)
		return;

	if (ttf->input_present == input_present)
		return;
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ struct qg_dt {
	bool			esr_disable;
	bool			esr_discharge_enable;
	bool			qg_ext_sense;
	bool			qg_vbms_mode;
};

struct qg_esr_data {
@@ -128,6 +129,7 @@ struct qpnp_qg {
	int			esr_nominal;
	int			soh;
	int			soc_reporting_ready;
	int			vbms_ibat_ua;
	u32			fifo_done_count;
	u32			wa_flags;
	u32			seq_no;
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@
#define QG_SDAM_MAX_OFFSET			0xA4

/* Below offset is used by PBS */
#define QG_SDAM_SEQ_OFFSET			0xBB /* 1-byte 0xBB */
#define QG_SDAM_PON_OCV_OFFSET			0xBC /* 2-byte 0xBC-0xBD */

#endif
+5 −0
Original line number Diff line number Diff line
@@ -342,6 +342,11 @@ int qg_get_battery_current(struct qpnp_qg *chip, int *ibat_ua)
		return 0;
	}

	if (chip->dt.qg_vbms_mode) {
		*ibat_ua = chip->vbms_ibat_ua;
		return 0;
	}

	/* hold data */
	rc = qg_masked_write(chip, chip->qg_base + QG_DATA_CTL2_REG,
				BURST_AVG_HOLD_FOR_READ_BIT,
Loading