linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state
@ 2014-05-20  6:50 Fugang Duan
  2014-05-20  6:50 ` [PATCH v1 1/2] ARM: dts: imx6sl: add " Fugang Duan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fugang Duan @ 2014-05-20  6:50 UTC (permalink / raw)
  To: linux-arm-kernel

The two patches is to add fec sleep pinctrl for pin PM state in imx6sl
evk platform.

Fugang Duan (2):
  ARM: dts: imx6sl: add fec sleep pinctrl for pin PM state
  net: fec: use pinctrl PM helpers

 arch/arm/boot/dts/imx6sl-evk.dts          |   16 +++++++++++++++-
 drivers/net/ethernet/freescale/fec_main.c |   10 ++++++++++
 2 files changed, 25 insertions(+), 1 deletions(-)

-- 
1.7.8

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] ARM: dts: imx6sl: add fec sleep pinctrl for pin PM state
  2014-05-20  6:50 [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state Fugang Duan
@ 2014-05-20  6:50 ` Fugang Duan
  2014-05-21  6:56   ` Shawn Guo
  2014-05-20  6:50 ` [PATCH v1 2/2] net: fec: use pinctrl PM helpers Fugang Duan
  2014-05-22 19:10 ` [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Fugang Duan @ 2014-05-20  6:50 UTC (permalink / raw)
  To: linux-arm-kernel

when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 arch/arm/boot/dts/imx6sl-evk.dts |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
index a8d9a93..050786d 100644
--- a/arch/arm/boot/dts/imx6sl-evk.dts
+++ b/arch/arm/boot/dts/imx6sl-evk.dts
@@ -116,8 +116,9 @@
 };
 
 &fec {
-	pinctrl-names = "default";
+	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&pinctrl_fec>;
+	pinctrl-1 = <&pinctrl_fec_sleep>;
 	phy-mode = "rmii";
 	status = "okay";
 };
@@ -300,6 +301,19 @@
 			>;
 		};
 
+		pinctrl_fec_sleep: fecgrp-sleep {
+			fsl,pins = <
+				MX6SL_PAD_FEC_MDC__GPIO4_IO23      0x3080
+				MX6SL_PAD_FEC_CRS_DV__GPIO4_IO25   0x3080
+				MX6SL_PAD_FEC_RXD0__GPIO4_IO17     0x3080
+				MX6SL_PAD_FEC_RXD1__GPIO4_IO18     0x3080
+				MX6SL_PAD_FEC_TX_EN__GPIO4_IO22    0x3080
+				MX6SL_PAD_FEC_TXD0__GPIO4_IO24     0x3080
+				MX6SL_PAD_FEC_TXD1__GPIO4_IO16     0x3080
+				MX6SL_PAD_FEC_REF_CLK__GPIO4_IO26  0x3080
+			>;
+		};
+
 		pinctrl_i2c1: i2c1grp {
 			fsl,pins = <
 				MX6SL_PAD_I2C1_SCL__I2C1_SCL	0x4001b8b1
-- 
1.7.8

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/2] net: fec: use pinctrl PM helpers
  2014-05-20  6:50 [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state Fugang Duan
  2014-05-20  6:50 ` [PATCH v1 1/2] ARM: dts: imx6sl: add " Fugang Duan
@ 2014-05-20  6:50 ` Fugang Duan
  2014-05-22 19:10 ` [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Fugang Duan @ 2014-05-20  6:50 UTC (permalink / raw)
  To: linux-arm-kernel

when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index cb5c987..2053dac 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1816,6 +1816,7 @@ fec_enet_open(struct net_device *ndev)
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	int ret;
 
+	pinctrl_pm_select_default_state(&fep->pdev->dev);
 	ret = fec_enet_clk_enable(ndev, true);
 	if (ret)
 		return ret;
@@ -1859,6 +1860,7 @@ fec_enet_close(struct net_device *ndev)
 	}
 
 	fec_enet_clk_enable(ndev, false);
+	pinctrl_pm_select_sleep_state(&fep->pdev->dev);
 	fec_enet_free_buffers(ndev);
 
 	return 0;
@@ -2162,6 +2164,9 @@ fec_probe(struct platform_device *pdev)
 		fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
 #endif
 
+	/* Select default pin state */
+	pinctrl_pm_select_default_state(&pdev->dev);
+
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	fep->hwp = devm_ioremap_resource(&pdev->dev, r);
 	if (IS_ERR(fep->hwp)) {
@@ -2258,6 +2263,7 @@ fec_probe(struct platform_device *pdev)
 	/* Carrier starts down, phylib will bring it up */
 	netif_carrier_off(ndev);
 	fec_enet_clk_enable(ndev, false);
+	pinctrl_pm_select_sleep_state(&pdev->dev);
 
 	ret = register_netdev(ndev);
 	if (ret)
@@ -2321,6 +2327,8 @@ fec_suspend(struct device *dev)
 	if (fep->reg_phy)
 		regulator_disable(fep->reg_phy);
 
+	pinctrl_pm_select_sleep_state(&fep->pdev->dev);
+
 	return 0;
 }
 
@@ -2331,6 +2339,8 @@ fec_resume(struct device *dev)
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	int ret;
 
+	pinctrl_pm_select_default_state(&fep->pdev->dev);
+
 	if (fep->reg_phy) {
 		ret = regulator_enable(fep->reg_phy);
 		if (ret)
-- 
1.7.8

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] ARM: dts: imx6sl: add fec sleep pinctrl for pin PM state
  2014-05-20  6:50 ` [PATCH v1 1/2] ARM: dts: imx6sl: add " Fugang Duan
@ 2014-05-21  6:56   ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-05-21  6:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 20, 2014 at 02:50:44PM +0800, Fugang Duan wrote:
> when system suspend, need to set pins to low power state to
> save IO power consumption, there are three states of pinctrl:
> "default", "idle" and "sleep". Currently enet supports default
> and sleep state.
> 
> Signed-off-by: Fugang Duan <B38611@freescale.com>

I understand that this dts patch can be applied independently.  So
patch applied, thanks.

Shawn

> ---
>  arch/arm/boot/dts/imx6sl-evk.dts |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
> index a8d9a93..050786d 100644
> --- a/arch/arm/boot/dts/imx6sl-evk.dts
> +++ b/arch/arm/boot/dts/imx6sl-evk.dts
> @@ -116,8 +116,9 @@
>  };
>  
>  &fec {
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "sleep";
>  	pinctrl-0 = <&pinctrl_fec>;
> +	pinctrl-1 = <&pinctrl_fec_sleep>;
>  	phy-mode = "rmii";
>  	status = "okay";
>  };
> @@ -300,6 +301,19 @@
>  			>;
>  		};
>  
> +		pinctrl_fec_sleep: fecgrp-sleep {
> +			fsl,pins = <
> +				MX6SL_PAD_FEC_MDC__GPIO4_IO23      0x3080
> +				MX6SL_PAD_FEC_CRS_DV__GPIO4_IO25   0x3080
> +				MX6SL_PAD_FEC_RXD0__GPIO4_IO17     0x3080
> +				MX6SL_PAD_FEC_RXD1__GPIO4_IO18     0x3080
> +				MX6SL_PAD_FEC_TX_EN__GPIO4_IO22    0x3080
> +				MX6SL_PAD_FEC_TXD0__GPIO4_IO24     0x3080
> +				MX6SL_PAD_FEC_TXD1__GPIO4_IO16     0x3080
> +				MX6SL_PAD_FEC_REF_CLK__GPIO4_IO26  0x3080
> +			>;
> +		};
> +
>  		pinctrl_i2c1: i2c1grp {
>  			fsl,pins = <
>  				MX6SL_PAD_I2C1_SCL__I2C1_SCL	0x4001b8b1
> -- 
> 1.7.8
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state
  2014-05-20  6:50 [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state Fugang Duan
  2014-05-20  6:50 ` [PATCH v1 1/2] ARM: dts: imx6sl: add " Fugang Duan
  2014-05-20  6:50 ` [PATCH v1 2/2] net: fec: use pinctrl PM helpers Fugang Duan
@ 2014-05-22 19:10 ` David Miller
  2014-05-27  9:04   ` fugang.duan at freescale.com
  2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-05-22 19:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fugang Duan <b38611@freescale.com>
Date: Tue, 20 May 2014 14:50:43 +0800

> The two patches is to add fec sleep pinctrl for pin PM state in imx6sl
> evk platform.

Patch #2 doesn't apply at all to the net tree.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state
  2014-05-22 19:10 ` [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state David Miller
@ 2014-05-27  9:04   ` fugang.duan at freescale.com
  0 siblings, 0 replies; 6+ messages in thread
From: fugang.duan at freescale.com @ 2014-05-27  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, David,

From: David Miller <davem@davemloft.net> Data: Friday, May 23, 2014 3:11 AM
>To: Duan Fugang-B38611
>Cc: Guo Shawn-R65073; linux-arm-kernel at lists.infradead.org;
>netdev at vger.kernel.org; kernel at pengutronix.de; Li Frank-B20596
>Subject: Re: [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM
>state
>
>From: Fugang Duan <b38611@freescale.com>
>Date: Tue, 20 May 2014 14:50:43 +0800
>
>> The two patches is to add fec sleep pinctrl for pin PM state in imx6sl
>> evk platform.
>
>Patch #2 doesn't apply at all to the net tree.
The previous patch is based on next, now I resend the patch base your tree.

Thanks,
Andy

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-27  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20  6:50 [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state Fugang Duan
2014-05-20  6:50 ` [PATCH v1 1/2] ARM: dts: imx6sl: add " Fugang Duan
2014-05-21  6:56   ` Shawn Guo
2014-05-20  6:50 ` [PATCH v1 2/2] net: fec: use pinctrl PM helpers Fugang Duan
2014-05-22 19:10 ` [PATCH v1 0/2] net: fec: Add fec sleep pinctrl for pin PM state David Miller
2014-05-27  9:04   ` fugang.duan at freescale.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).