diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2017-01-09 18:34:05 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-09 23:54:00 +0300 |
commit | d8981d029da9d230955dabe596dbb30e7971b7b9 (patch) | |
tree | 26c81fccf7113c7432fbeebd0b9a6065ee052524 /drivers/spi | |
parent | 6dcf45e514974a1ff10755015b5e06746a033e5f (diff) | |
download | linux-d8981d029da9d230955dabe596dbb30e7971b7b9.tar.xz |
sh_eth: add generic wake-on-lan support via magic packet
Add generic functionality to support Wake-on-LAN using MagicPacket which
are supported by at least a few versions of sh_eth. Only add
functionality for WoL, no specific sh_eth versions are marked to support
WoL yet.
WoL is enabled in the suspend callback by setting MagicPacket detection
and disabling all interrupts expect MagicPacket. In the resume path the
driver needs to reset the hardware to rearm the WoL logic, this prevents
the driver from simply restoring the registers and to take advantage of
that sh_eth was not suspended to reduce resume time. To reset the
hardware the driver closes and reopens the device just like it would do
in a normal suspend/resume scenario without WoL enabled, but it both
closes and opens the device in the resume callback since the device
needs to be open for WoL to work.
One quirk needed for WoL is that the module clock needs to be prevented
from being switched off by Runtime PM. To keep the clock alive the
suspend callback need to call clk_enable() directly to increase the
usage count of the clock. Then when Runtime PM decreases the clock usage
count it won't reach 0 and be switched off.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/spi')
0 files changed, 0 insertions, 0 deletions