]> www.infradead.org Git - users/jedix/linux-maple.git/commit
can: mcp251xfd: move mcp251xfd_timestamp_start()/stop() into mcp251xfd_chip_start...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 11 Jan 2023 11:10:04 +0000 (12:10 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Jun 2024 21:48:11 +0000 (23:48 +0200)
commita7801540f325d104de5065850a003f1d9bdc6ad3
tree368f22fad6eeb1e825acc32845519afbee9937f8
parent71c45e6e0b4297433a8a64a1d24f01823a6a8dd1
can: mcp251xfd: move mcp251xfd_timestamp_start()/stop() into mcp251xfd_chip_start/stop()

The mcp251xfd wakes up from Low Power or Sleep Mode when SPI activity
is detected. To avoid this, make sure that the timestamp worker is
stopped before shutting down the chip.

Split the starting of the timestamp worker out of
mcp251xfd_timestamp_init() into the separate function
mcp251xfd_timestamp_start().

Call mcp251xfd_timestamp_init() before mcp251xfd_chip_start(), move
mcp251xfd_timestamp_start() to mcp251xfd_chip_start(). In this way,
mcp251xfd_timestamp_stop() can be called unconditionally by
mcp251xfd_chip_stop().

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h