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

Commit 084fe9ff authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: smb1398: Handle USB power path suspension appropriately



Unsuspend USB power path (turn off USB-path front-porch FET) before
enabling, and suspend it upon disabling SMB1398.

Change-Id: I319c215861f82cb2fb96504c38993c6eb03c38a7
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 1ea05851
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt) "SMB1398: %s: " fmt, __func__
@@ -724,6 +724,14 @@ static int smb1398_div2_cp_switcher_en(struct smb1398_chip *chip, bool en)
{
	int rc;

	rc = smb1398_masked_write(chip, MISC_USB_WLS_SUSPEND_REG,
			USB_SUSPEND, en ? 0 : USB_SUSPEND);
	if (rc < 0) {
		dev_err(chip->dev, "Couldn't write USB_WLS_SUSPEND_REG, rc=%d\n",
				rc);
		return rc;
	}

	rc = smb1398_masked_write(chip, MISC_SL_SWITCH_EN_REG,
			EN_SWITCHER, en ? EN_SWITCHER : 0);
	if (rc < 0) {