Skip to content

Commit 11c82af

Browse files
Peter Chenvinodkoul
authored andcommitted
phy: phy-cadence-salvo: add phy .init API
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> Link: https://lore.kernel.org/r/20200513125605.5545-1-peter.chen@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent f004be5 commit 11c82af

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎drivers/phy/cadence/phy-cadence-salvo.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static struct cdns_reg_pairs cdns_nxp_sequence_pair[] = {
205205
{0x0090, TB_ADDR_XCVR_DIAG_LANE_FCM_EN_MGN_TMR},
206206
};
207207

208-
static int cdns_salvo_phy_power_on(struct phy *phy)
208+
static int cdns_salvo_phy_init(struct phy *phy)
209209
{
210210
struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
211211
struct cdns_salvo_data *data = salvo_phy->data;
@@ -230,9 +230,18 @@ static int cdns_salvo_phy_power_on(struct phy *phy)
230230

231231
udelay(10);
232232

233+
clk_disable_unprepare(salvo_phy->clk);
234+
233235
return ret;
234236
}
235237

238+
static int cdns_salvo_phy_power_on(struct phy *phy)
239+
{
240+
struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
241+
242+
return clk_prepare_enable(salvo_phy->clk);
243+
}
244+
236245
static int cdns_salvo_phy_power_off(struct phy *phy)
237246
{
238247
struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy);
@@ -243,6 +252,7 @@ static int cdns_salvo_phy_power_off(struct phy *phy)
243252
}
244253

245254
static struct phy_ops cdns_salvo_phy_ops = {
255+
.init = cdns_salvo_phy_init,
246256
.power_on = cdns_salvo_phy_power_on,
247257
.power_off = cdns_salvo_phy_power_off,
248258
.owner = THIS_MODULE,

0 commit comments

Comments
 (0)