Skip to contentSkip to conversation

phy: phy-cadence-salvo: add phy .init API

PATCH Superseded Peter Chen 3 participants 4 messages May 7, 2020 – May 13, 2020 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH 1/1 phy: phy-cadence-salvo: add phy .init API

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

---
 drivers/phy/cadence/phy-cadence-salvo.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/phy/cadence/phy-cadence-salvo.c +11 -1
index fa666527356d..c2b6ddfe02e0 100644
@@ -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,
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): 20200513025709.GB29070@a0393678ub

author
#2 lore raw
Quoted 11 lines · Kishon Vijay Abraham I

Hi Peter,

Quoted 4 lines · Peter Chen

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

This patch doesn't apply cleanly. Can you kindly check phy -next is proper since I expected this to merge cleanly?

Hi Kishon,

I don't see my first salvo PHY at your phy -next tree

https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git/log/?h=next

But I do see it is on linux-next tree:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=50d35aa8c15f7210fe76de64b1940100b588bcae

What happened?

Peter

Quoted 49 lines

Thanks
Kishon

Quoted 47 lines
---
 drivers/phy/cadence/phy-cadence-salvo.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/phy/cadence/phy-cadence-salvo.c +11 -1
index fa666527356d..c2b6ddfe02e0 100644
@@ -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,
Signature · 1 line
2.17.1
Signature · 2 lines
Thanks,
Peter Chen
maintainer
#3 lore raw
Quoted 17 lines · Peter Chen
Quoted 11 lines · Kishon Vijay Abraham I

Hi Peter,

Quoted 4 lines · Peter Chen

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

This patch doesn't apply cleanly. Can you kindly check phy -next is proper since I expected this to merge cleanly?

Hi Kishon,

I don't see my first salvo PHY at your phy -next tree

Quoted 7 lines

https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git/log/?h=next

But I do see it is on linux-next tree:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=50d35aa8c15f7210fe76de64b1940100b588bcae

What happened?

Phy tree has moved to git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git

Signature · 1 line
~Vinod
#4 lore raw
In reply to Peter Chen

Hi Peter,

Quoted 13 lines · Peter Chen
Quoted 11 lines · Kishon Vijay Abraham I

Hi Peter,

Quoted 4 lines · Peter Chen

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

This patch doesn't apply cleanly. Can you kindly check phy -next is proper since I expected this to merge cleanly?

Quoted 5 lines

Hi Kishon,

I don't see my first salvo PHY at your phy -next tree

https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git/log/?h=next

PHY tree is moved here
git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git

Thanks
Kishon

Quoted 58 lines

But I do see it is on linux-next tree:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=50d35aa8c15f7210fe76de64b1940100b588bcae

What happened?

Peter

Quoted 49 lines

Thanks
Kishon

Quoted 47 lines
---
 drivers/phy/cadence/phy-cadence-salvo.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/phy/cadence/phy-cadence-salvo.c +11 -1
index fa666527356d..c2b6ddfe02e0 100644
@@ -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,
Signature · 1 line
2.17.1