Merge "usb: phy: Reset PHY while disabling dpdm regulator"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
1c2af547a0
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -1056,6 +1056,20 @@ static int qusb_phy_dpdm_regulator_disable(struct regulator_dev *rdev)
|
||||
if (!qphy->cable_connected)
|
||||
qusb_phy_clear_tcsr_clamp(qphy, false);
|
||||
|
||||
/*
|
||||
* Phy reset is needed in case multiple instances
|
||||
* of HSPHY exists with shared power supplies. This
|
||||
* reset is to bring out the PHY from high-Z state
|
||||
* and avoid extra current consumption.
|
||||
*/
|
||||
ret = reset_control_assert(qphy->phy_reset);
|
||||
if (ret)
|
||||
dev_err(qphy->phy.dev, "phyassert failed\n");
|
||||
usleep_range(100, 150);
|
||||
ret = reset_control_deassert(qphy->phy_reset);
|
||||
if (ret)
|
||||
dev_err(qphy->phy.dev, "deassert failed\n");
|
||||
|
||||
ret = qusb_phy_enable_power(qphy, false);
|
||||
if (ret < 0) {
|
||||
dev_dbg(qphy->phy.dev,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -647,6 +647,13 @@ static int msm_hsphy_dpdm_regulator_disable(struct regulator_dev *rdev)
|
||||
mutex_lock(&phy->phy_lock);
|
||||
if (phy->dpdm_enable) {
|
||||
if (!phy->cable_connected) {
|
||||
/*
|
||||
* Phy reset is needed in case multiple instances
|
||||
* of HSPHY exists with shared power supplies. This
|
||||
* reset is to bring out the PHY from high-Z state
|
||||
* and avoid extra current consumption.
|
||||
*/
|
||||
msm_hsphy_reset(phy);
|
||||
ret = msm_hsphy_enable_power(phy, false);
|
||||
if (ret < 0) {
|
||||
mutex_unlock(&phy->phy_lock);
|
||||
|
||||
Reference in New Issue
Block a user