mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
net: stmmac: disable & enable clock on suspend resume
disable all eth clocks on suspend and enable them on resume. Change-Id: I65e80188e2cce0967b5bce8f0f5f55c842f40aa0 Acked-by: Nagarjuna Chaganti <nchagant@qti.qualcomm.com> Signed-off-by: Suraj Jaiswal <jsuraj@codeaurora.org>
This commit is contained in:
parent
336fdc586c
commit
8f1ad5f7a2
1 changed files with 28 additions and 0 deletions
|
|
@ -899,6 +899,8 @@ static void ethqos_pps_irq_config(struct qcom_ethqos *ethqos)
|
|||
|
||||
static void qcom_ethqos_phy_suspend_clks(struct qcom_ethqos *ethqos)
|
||||
{
|
||||
struct stmmac_priv *priv = qcom_ethqos_get_priv(ethqos);
|
||||
|
||||
ETHQOSINFO("Enter\n");
|
||||
|
||||
if (phy_intr_en)
|
||||
|
|
@ -908,6 +910,18 @@ static void qcom_ethqos_phy_suspend_clks(struct qcom_ethqos *ethqos)
|
|||
|
||||
ethqos_update_rgmii_clk_and_bus_cfg(ethqos, 0);
|
||||
|
||||
if (priv->plat->stmmac_clk)
|
||||
clk_disable_unprepare(priv->plat->stmmac_clk);
|
||||
|
||||
if (priv->plat->pclk)
|
||||
clk_disable_unprepare(priv->plat->pclk);
|
||||
|
||||
if (priv->plat->clk_ptp_ref)
|
||||
clk_disable_unprepare(priv->plat->clk_ptp_ref);
|
||||
|
||||
if (ethqos->rgmii_clk)
|
||||
clk_disable_unprepare(ethqos->rgmii_clk);
|
||||
|
||||
ETHQOSINFO("Exit\n");
|
||||
}
|
||||
|
||||
|
|
@ -933,8 +947,22 @@ inline bool qcom_ethqos_is_phy_link_up(struct qcom_ethqos *ethqos)
|
|||
|
||||
static void qcom_ethqos_phy_resume_clks(struct qcom_ethqos *ethqos)
|
||||
{
|
||||
struct stmmac_priv *priv = qcom_ethqos_get_priv(ethqos);
|
||||
|
||||
ETHQOSINFO("Enter\n");
|
||||
|
||||
if (priv->plat->stmmac_clk)
|
||||
clk_prepare_enable(priv->plat->stmmac_clk);
|
||||
|
||||
if (priv->plat->pclk)
|
||||
clk_prepare_enable(priv->plat->pclk);
|
||||
|
||||
if (priv->plat->clk_ptp_ref)
|
||||
clk_prepare_enable(priv->plat->clk_ptp_ref);
|
||||
|
||||
if (ethqos->rgmii_clk)
|
||||
clk_prepare_enable(ethqos->rgmii_clk);
|
||||
|
||||
if (qcom_ethqos_is_phy_link_up(ethqos))
|
||||
ethqos_update_rgmii_clk_and_bus_cfg(ethqos, ethqos->speed);
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue