]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: move clk_wol management to bcmgenet_wol
authorDoug Berger <opendmb@gmail.com>
Wed, 29 Apr 2020 20:02:02 +0000 (13:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Apr 2020 23:55:22 +0000 (16:55 -0700)
commitfdea17ac74799f81d5a8c41f8a7fc580e08899d6
tree494789d35155849519b848b63a5bba0a12e1ccf5
parentbed95eb0dbd99963abf9551e464796898db669b7
net: bcmgenet: move clk_wol management to bcmgenet_wol

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: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c