* [PATCH v2 1/1] phy: phy-cadence-salvo: add phy .init API
@ 2020-05-13 12:56 Peter Chen
2020-05-15 7:50 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Peter Chen @ 2020-05-13 12:56 UTC (permalink / raw)
To: kishon, vkoul; +Cc: linux-usb, jun.li, linux-imx, Peter Chen
The .init is used for one-time PHY's initialization, and .power_on
is called many times during the device lifecycle.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
Changes for v2:
- Apply to linux-phy -next tree
- Change commit log a bit
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 292e9b4dd41a..1ecbb964cd21 100644
--- a/drivers/phy/cadence/phy-cadence-salvo.c
+++ b/drivers/phy/cadence/phy-cadence-salvo.c
@@ -205,7 +205,7 @@ static struct cdns_reg_pairs cdns_nxp_sequence_pair[] = {
{0x0090, TB_ADDR_XCVR_DIAG_LANE_FCM_EN_MGN_TMR},
};
-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;
@@ -230,9 +230,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);
@@ -243,6 +252,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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/1] phy: phy-cadence-salvo: add phy .init API
2020-05-13 12:56 [PATCH v2 1/1] phy: phy-cadence-salvo: add phy .init API Peter Chen
@ 2020-05-15 7:50 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-05-15 7:50 UTC (permalink / raw)
To: Peter Chen; +Cc: kishon, linux-usb, jun.li, linux-imx
On 13-05-20, 20:56, Peter Chen wrote:
> The .init is used for one-time PHY's initialization, and .power_on
> is called many times during the device lifecycle.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-15 7:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 12:56 [PATCH v2 1/1] phy: phy-cadence-salvo: add phy .init API Peter Chen
2020-05-15 7:50 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.