mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
phy: qcom-ufs: remove failure when rx/tx_iface_clk are absent
Since in future UFS Phy's the tx_iface_clk and rx_iface_clk are no longer exist, we should not fail when their initialization fail, but rather just report with debug message. Change-Id: I87e4deca632d4d4ee9e35a03f2fc9c22987255b3 Signed-off-by: Yaniv Gardi <[email protected]> [[email protected]: resolved trivial merge conflicts] Signed-off-by: Can Guo <[email protected]>
This commit is contained in:
parent
a27ae1c711
commit
73597f6e60
1 changed files with 19 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2015, Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2019, Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "phy-qcom-ufs-i.h"
|
||||
|
|
@ -184,16 +184,24 @@ int ufs_qcom_phy_init_clks(struct ufs_qcom_phy *phy_common)
|
|||
if (of_device_is_compatible(phy_common->dev->of_node,
|
||||
"qcom,msm8996-ufs-phy-qmp-14nm"))
|
||||
goto skip_txrx_clk;
|
||||
|
||||
/*
|
||||
* tx_iface_clk does not exist in newer version of ufs-phy HW,
|
||||
* so don't return error if it is not found
|
||||
*/
|
||||
err = ufs_qcom_phy_clk_get(phy_common->dev, "tx_iface_clk",
|
||||
&phy_common->tx_iface_clk);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
dev_dbg(phy_common->dev, "%s: failed to get tx_iface_clk\n",
|
||||
__func__);
|
||||
/*
|
||||
* rx_iface_clk does not exist in newer version of ufs-phy HW,
|
||||
* so don't return error if it is not found
|
||||
*/
|
||||
err = ufs_qcom_phy_clk_get(phy_common->dev, "rx_iface_clk",
|
||||
&phy_common->rx_iface_clk);
|
||||
if (err)
|
||||
goto out;
|
||||
dev_dbg(phy_common->dev, "%s: failed to get rx_iface_clk\n",
|
||||
__func__);
|
||||
|
||||
skip_txrx_clk:
|
||||
err = ufs_qcom_phy_clk_get(phy_common->dev, "ref_clk_src",
|
||||
|
|
@ -445,6 +453,9 @@ static int ufs_qcom_phy_enable_iface_clk(struct ufs_qcom_phy *phy)
|
|||
if (phy->is_iface_clk_enabled)
|
||||
goto out;
|
||||
|
||||
if (!phy->tx_iface_clk)
|
||||
goto out;
|
||||
|
||||
ret = clk_prepare_enable(phy->tx_iface_clk);
|
||||
if (ret) {
|
||||
dev_err(phy->dev, "%s: tx_iface_clk enable failed %d\n",
|
||||
|
|
@ -467,6 +478,9 @@ out:
|
|||
/* Turn OFF M-PHY RMMI interface clocks */
|
||||
static void ufs_qcom_phy_disable_iface_clk(struct ufs_qcom_phy *phy)
|
||||
{
|
||||
if (!phy->tx_iface_clk)
|
||||
return;
|
||||
|
||||
if (phy->is_iface_clk_enabled) {
|
||||
clk_disable_unprepare(phy->tx_iface_clk);
|
||||
clk_disable_unprepare(phy->rx_iface_clk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue