diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-04-04 10:55:26 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-04-11 16:24:29 (GMT) |
commit | 4c21b72aceee0a6a182247442a3b4c307b2c6170 (patch) | |
tree | cb0ae04ca07e486efaa554c56d65556fcc46b479 | |
parent | 6f834514194a11e2e1b17a7a4e6e17a81969378d (diff) | |
download | linux-fsl-qoriq-4c21b72aceee0a6a182247442a3b4c307b2c6170.tar.xz |
gianfar: Enable all wol ports as wakeup event sources
Not all the eTSECs have an active clock by default
when the devices enter suspend state (i.e. sleep
power state). This property is however configurable,
and all the eTSECs with wake-on-lan capabilities
can be enabled as wakeup event sources.
Use the PMC API to enable all the eTSEC ports, which
are capable of wake-on-lan, as wakeup event sources.
Cc: Li Yang <leoli@freescale.com>
Cc: Zhao Chenhui <chenhui.zhao@freescale.com>
Change-Id: I7bd3db14173ddbe3cdd64bcffeb6c72adfcbf2c7
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/10729
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Yang Li <LeoLi@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ethtool.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 2b980d5..2160ec5 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -42,6 +42,9 @@ #include <linux/phy.h> #include <linux/sort.h> #include <linux/if_vlan.h> +#ifdef CONFIG_PM +#include <sysdev/fsl_soc.h> +#endif #include "gianfar.h" @@ -646,6 +649,7 @@ static void gfar_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { struct gfar_private *priv = netdev_priv(dev); + int err; if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) && wol->wolopts != 0) @@ -656,6 +660,12 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) device_set_wakeup_enable(priv->dev, wol->wolopts & WAKE_MAGIC); + err = mpc85xx_pmc_set_wake(priv->dev, wol->wolopts & WAKE_MAGIC); + if (err) { + device_set_wakeup_enable(priv->dev, false); + return err; + } + priv->wol_en = !!device_may_wakeup(priv->dev); return 0; |