diff mbox series

[1/3] phy: cadence: Sierra: add phy_reset hook

Message ID 20191022132249.869-2-rogerq@ti.com
State Superseded
Headers show
Series phy: cadence: j721e-wiz: Add Type-C plug flip support | expand

Commit Message

Roger Quadros Oct. 22, 2019, 1:22 p.m. UTC
This is required if type C driver needs to hold
global reset on J7ES to perform LN10 swap.

Signed-off-by: Roger Quadros <rogerq@ti.com>

Signed-off-by: Sekhar Nori <nsekhar@ti.com>

---
 drivers/phy/cadence/phy-cadence-sierra.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Comments

Kishon Vijay Abraham I Oct. 23, 2019, 7:36 a.m. UTC | #1
Roger,

On 22/10/19 6:52 PM, Roger Quadros wrote:
> This is required if type C driver needs to hold

> global reset on J7ES to perform LN10 swap.


Can you replace "This" with something more specific.

Thanks
Kishon
> 

> Signed-off-by: Roger Quadros <rogerq@ti.com>

> Signed-off-by: Sekhar Nori <nsekhar@ti.com>

> ---

>  drivers/phy/cadence/phy-cadence-sierra.c | 10 ++++++++++

>  1 file changed, 10 insertions(+)

> 

> diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c

> index affede8c4368..e6d27bdec22a 100644

> --- a/drivers/phy/cadence/phy-cadence-sierra.c

> +++ b/drivers/phy/cadence/phy-cadence-sierra.c

> @@ -339,10 +339,20 @@ static int cdns_sierra_phy_off(struct phy *gphy)

>  	return reset_control_assert(ins->lnk_rst);

>  }

>  

> +static int cdns_sierra_phy_reset(struct phy *gphy)

> +{

> +	struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent);

> +

> +	reset_control_assert(sp->phy_rst);

> +	reset_control_deassert(sp->phy_rst);

> +	return 0;

> +};

> +

>  static const struct phy_ops ops = {

>  	.init		= cdns_sierra_phy_init,

>  	.power_on	= cdns_sierra_phy_on,

>  	.power_off	= cdns_sierra_phy_off,

> +	.reset		= cdns_sierra_phy_reset,

>  	.owner		= THIS_MODULE,

>  };

>  

>
Roger Quadros Oct. 23, 2019, 8:08 a.m. UTC | #2
Kishon,

On 23/10/2019 10:36, Kishon Vijay Abraham I wrote:
> Roger,

> 

> On 22/10/19 6:52 PM, Roger Quadros wrote:

>> This is required if type C driver needs to hold

>> global reset on J7ES to perform LN10 swap.

> 

> Can you replace "This" with something more specific.


I meant this patch, but I will revise the commit message.

cheers,
-roger
> 

> Thanks

> Kishon

>>

>> Signed-off-by: Roger Quadros <rogerq@ti.com>

>> Signed-off-by: Sekhar Nori <nsekhar@ti.com>

>> ---

>>   drivers/phy/cadence/phy-cadence-sierra.c | 10 ++++++++++

>>   1 file changed, 10 insertions(+)

>>

>> diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c

>> index affede8c4368..e6d27bdec22a 100644

>> --- a/drivers/phy/cadence/phy-cadence-sierra.c

>> +++ b/drivers/phy/cadence/phy-cadence-sierra.c

>> @@ -339,10 +339,20 @@ static int cdns_sierra_phy_off(struct phy *gphy)

>>   	return reset_control_assert(ins->lnk_rst);

>>   }

>>   

>> +static int cdns_sierra_phy_reset(struct phy *gphy)

>> +{

>> +	struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent);

>> +

>> +	reset_control_assert(sp->phy_rst);

>> +	reset_control_deassert(sp->phy_rst);

>> +	return 0;

>> +};

>> +

>>   static const struct phy_ops ops = {

>>   	.init		= cdns_sierra_phy_init,

>>   	.power_on	= cdns_sierra_phy_on,

>>   	.power_off	= cdns_sierra_phy_off,

>> +	.reset		= cdns_sierra_phy_reset,

>>   	.owner		= THIS_MODULE,

>>   };

>>   

>>


-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index affede8c4368..e6d27bdec22a 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -339,10 +339,20 @@  static int cdns_sierra_phy_off(struct phy *gphy)
 	return reset_control_assert(ins->lnk_rst);
 }
 
+static int cdns_sierra_phy_reset(struct phy *gphy)
+{
+	struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent);
+
+	reset_control_assert(sp->phy_rst);
+	reset_control_deassert(sp->phy_rst);
+	return 0;
+};
+
 static const struct phy_ops ops = {
 	.init		= cdns_sierra_phy_init,
 	.power_on	= cdns_sierra_phy_on,
 	.power_off	= cdns_sierra_phy_off,
+	.reset		= cdns_sierra_phy_reset,
 	.owner		= THIS_MODULE,
 };