diff mbox series

[1/1] phy: phy-cadence-salvo: add phy .init API

Message ID 20200507052120.27497-1-peter.chen@nxp.com (mailing list archive)
State Superseded
Headers show
Series [1/1] phy: phy-cadence-salvo: add phy .init API | expand

Commit Message

Peter Chen May 7, 2020, 5:21 a.m. UTC
.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(-)

Comments

Peter Chen May 13, 2020, 10:51 a.m. UTC | #1
On 20-05-13 08:27:09, Kishon Vijay Abraham I wrote:
> Hi Peter,
> 
> On Thu, May 07, 2020 at 01:21:20PM +0800, Peter Chen wrote:
> > .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>
> 
> 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
> Thanks
> Kishon
> > ---
> >  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
> >
Vinod Koul May 13, 2020, 11 a.m. UTC | #2
On 13-05-20, 10:51, Peter Chen wrote:
> On 20-05-13 08:27:09, Kishon Vijay Abraham I wrote:
> > Hi Peter,
> > 
> > On Thu, May 07, 2020 at 01:21:20PM +0800, Peter Chen wrote:
> > > .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>
> > 
> > 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?

Phy tree has moved to git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git
Kishon Vijay Abraham I May 13, 2020, 11:03 a.m. UTC | #3
Hi Peter,

On 5/13/2020 4:21 PM, Peter Chen wrote:
> On 20-05-13 08:27:09, Kishon Vijay Abraham I wrote:
>> Hi Peter,
>>
>> On Thu, May 07, 2020 at 01:21:20PM +0800, Peter Chen wrote:
>>> .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>
>>
>> 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

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

Thanks
Kishon

> 
> 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
>> Thanks
>> Kishon
>>> ---
>>>  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
>>>
>
diff mbox series

Patch

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,