Linux USB
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: kishon@ti.com, vkoul@kernel.org
Cc: linux-usb@vger.kernel.org, jun.li@nxp.com, linux-imx@nxp.com,
	Peter Chen <peter.chen@nxp.com>
Subject: [PATCH 1/1] phy: phy-cadence-salvo: add phy .init API
Date: Thu,  7 May 2020 13:21:20 +0800	[thread overview]
Message-ID: <20200507052120.27497-1-peter.chen@nxp.com> (raw)

.init is used for PHY's initialization, and .power_on/power_off are only
used for clock on and off.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/phy/cadence/phy-cadence-salvo.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c
index fa666527356d..c2b6ddfe02e0 100644
--- a/drivers/phy/cadence/phy-cadence-salvo.c
+++ b/drivers/phy/cadence/phy-cadence-salvo.c
@@ -206,7 +206,7 @@ static struct cdns_reg_pairs cdns_nxp_sequence_pair[] = {
 };
 
 
-static int cdns_salvo_phy_power_on(struct phy *phy)
+static int cdns_salvo_phy_init(struct phy *phy)
 {
 	struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
 	struct cdns_salvo_data *data = salvo_phy->data;
@@ -231,9 +231,18 @@ static int cdns_salvo_phy_power_on(struct phy *phy)
 
 	udelay(10);
 
+	clk_disable_unprepare(salvo_phy->clk);
+
 	return ret;
 }
 
+static int cdns_salvo_phy_power_on(struct phy *phy)
+{
+	struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
+
+	return clk_prepare_enable(salvo_phy->clk);
+}
+
 static int cdns_salvo_phy_power_off(struct phy *phy)
 {
 	struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
@@ -244,6 +253,7 @@ static int cdns_salvo_phy_power_off(struct phy *phy)
 }
 
 static struct phy_ops cdns_salvo_phy_ops = {
+	.init		= cdns_salvo_phy_init,
 	.power_on	= cdns_salvo_phy_power_on,
 	.power_off	= cdns_salvo_phy_power_off,
 	.owner		= THIS_MODULE,
-- 
2.17.1


             reply	other threads:[~2020-05-07  5:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07  5:21 Peter Chen [this message]
     [not found] ` <20200513025709.GB29070@a0393678ub>
2020-05-13 10:51   ` [PATCH 1/1] phy: phy-cadence-salvo: add phy .init API Peter Chen
2020-05-13 11:00     ` Vinod Koul
2020-05-13 11:03     ` Kishon Vijay Abraham I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507052120.27497-1-peter.chen@nxp.com \
    --to=peter.chen@nxp.com \
    --cc=jun.li@nxp.com \
    --cc=kishon@ti.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox