• Doug Berger's avatar
    net: bcmgenet: move clk_wol management to bcmgenet_wol · 1a1d5106
    Doug Berger authored
    The GENET_POWER_WOL_MAGIC power up and power down code configures
    the device for WoL when suspending and disables the WoL logic when
    resuming. It makes sense that this code should also manage the WoL
    clocking.
    
    This commit consolidates the logic and moves it earlier in the
    resume sequence.
    
    Since the clock is now only enabled if WoL is successfully entered
    the wol_active flag is introduced to track that state to keep the
    clock enables and disables balanced in case a suspend is aborted.
    The MPD_EN hardware bit can't be used because it can be cleared
    when the MAC is reset by a deep sleep.
    Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
    Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1a1d5106
bcmgenet.c 98.3 KB