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

Commit db6b12b8 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-smbcharger: hold the device awake during parallel taper"

parents caae1c89 bd71391a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ enum wake_reason {
	PM_PARALLEL_CHECK = BIT(0),
	PM_REASON_VFLOAT_ADJUST = BIT(1),
	PM_ESR_PULSE = BIT(2),
	PM_PARALLEL_TAPER = BIT(3),
};

static int smbchg_debug_mask;
@@ -1665,6 +1666,7 @@ static void smbchg_parallel_usb_taper(struct smbchg_chip *chip)
	if (!parallel_psy || !chip->parallel_charger_detected)
		return;

	smbchg_stay_awake(chip, PM_PARALLEL_TAPER);
try_again:
	mutex_lock(&chip->parallel.lock);
	if (chip->parallel.current_max_ma == 0) {
@@ -1710,6 +1712,7 @@ try_again:
	taper_irq_en(chip, true);
done:
	mutex_unlock(&chip->parallel.lock);
	smbchg_relax(chip, PM_PARALLEL_TAPER);
}

static bool smbchg_is_aicl_complete(struct smbchg_chip *chip)
@@ -5634,6 +5637,7 @@ static int smbchg_probe(struct spmi_device *spmi)
	mutex_init(&chip->pm_lock);
	mutex_init(&chip->wipower_config);
	mutex_init(&chip->usb_status_lock);
	device_init_wakeup(chip->dev, true);

	rc = smbchg_parse_peripherals(chip);
	if (rc) {
+5 −0
Original line number Diff line number Diff line
@@ -478,7 +478,9 @@ static int smb135x_read(struct smb135x_chg *chip, int reg,
		return 0;
	}
	mutex_lock(&chip->read_write_lock);
	pm_stay_awake(chip->dev);
	rc = __smb135x_read(chip, reg, val);
	pm_relax(chip->dev);
	mutex_unlock(&chip->read_write_lock);

	return rc;
@@ -493,7 +495,9 @@ static int smb135x_write(struct smb135x_chg *chip, int reg,
		return 0;

	mutex_lock(&chip->read_write_lock);
	pm_stay_awake(chip->dev);
	rc = __smb135x_write(chip, reg, val);
	pm_relax(chip->dev);
	mutex_unlock(&chip->read_write_lock);

	return rc;
@@ -4119,6 +4123,7 @@ static int smb135x_main_charger_probe(struct i2c_client *client,
	mutex_init(&chip->current_change_lock);
	mutex_init(&chip->read_write_lock);
	mutex_init(&chip->otg_oc_count_lock);
	device_init_wakeup(chip->dev, true);
	/* probe the device to check if its actually connected */
	rc = smb135x_read(chip, CFG_4_REG, &reg);
	if (rc) {