diff options
author | 2024-12-17 18:03:11 -0800 | |
---|---|---|
committer | 2024-12-19 18:05:57 -0800 | |
commit | 3fc87cb94f5f3224a9ea168ee935286d915d2a6a (patch) | |
tree | eead55351b00e4f6612e437ed430267a80e87d46 /drivers/net/dsa/microchip/ksz_spi.c | |
parent | Merge branch 'bnxt_en-driver-update' (diff) | |
download | wireguard-linux-3fc87cb94f5f3224a9ea168ee935286d915d2a6a.tar.xz wireguard-linux-3fc87cb94f5f3224a9ea168ee935286d915d2a6a.zip |
net: dsa: microchip: Add suspend/resume support to KSZ DSA driver
The KSZ DSA driver starts a timer to read MIB counters periodically to
avoid count overrun. During system suspend this will give an error for
not able to write to register as the SPI system returns an error when
it is in suspend state. This implementation stops the timer when the
system goes into suspend and restarts it when resumed.
Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241218020311.70628-1-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/dsa/microchip/ksz_spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c index 108a958dc356..b633d263098c 100644 --- a/drivers/net/dsa/microchip/ksz_spi.c +++ b/drivers/net/dsa/microchip/ksz_spi.c @@ -239,10 +239,14 @@ static const struct spi_device_id ksz_spi_ids[] = { }; MODULE_DEVICE_TABLE(spi, ksz_spi_ids); +static DEFINE_SIMPLE_DEV_PM_OPS(ksz_spi_pm_ops, + ksz_switch_suspend, ksz_switch_resume); + static struct spi_driver ksz_spi_driver = { .driver = { .name = "ksz-switch", .of_match_table = ksz_dt_ids, + .pm = &ksz_spi_pm_ops, }, .id_table = ksz_spi_ids, .probe = ksz_spi_probe, |