]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
can: mcp251xfd: move chip sleep mode into runtime pm
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 1 Oct 2025 09:10:01 +0000 (14:40 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 12 Nov 2025 08:36:59 +0000 (09:36 +0100)
commit71df9227ba9c5d18372c30904a93d360151874b2
tree09c577961cebb6abbe59c02e0a161b32b452485a
parent5cf236b89f4a8254f28af4badc0f0dbdaba09193
can: mcp251xfd: move chip sleep mode into runtime pm

This is a preparation patch to add GPIO support.

Up to now, the Vdd regulator and the clocks have been managed by
Runtime-PM (on systems without CONFIG_PM these remain permanently
switched on).

During the mcp251xfd_open() callback the mcp251xfd is powered,
soft-reset and configured. In mcp251xfd_stop() the chip is shut down
again. To support the on-chip GPIOs, the chip must be supplied with
power while GPIOs are being requested, even if the networking
interface is down.

To support this, move the functions mcp251xfd_chip_softreset() and
mcp251xfd_chip_clock_init() from mcp251xfd_chip_start() to
mcp251xfd_runtime_resume(). Instead of setting the controller to sleep
mode in mcp251xfd_chip_stop(), bring it into configuration mode. This
way it doesn't take part in bus activity and doesn't enter sleep mode.

Signed-off-by: Gregor Herburger <gregor.herburger@ew.tq-group.com>
Tested-by: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>
Signed-off-by: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251001091006.4003841-2-viken.dadhaniya@oss.qualcomm.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c