linux/drivers/net/can/m_can
Brett Werling 0f97a7588d can: tcan4x5x: fix reset gpio usage during probe
Fixes reset GPIO usage during probe by ensuring we retrieve the GPIO and
take the device out of reset (if it defaults to being in reset) before
we attempt to communicate with the device. This is achieved by moving
the call to tcan4x5x_get_gpios() before tcan4x5x_find_version() and
avoiding any device communication while getting the GPIOs. Once we
determine the version, we can then take the knowledge of which GPIOs we
obtained and use it to decide whether we need to disable the wake or
state pin functions within the device.

This change is necessary in a situation where the reset GPIO is pulled
high externally before the CPU takes control of it, meaning we need to
explicitly bring the device out of reset before we can start
communicating with it at all.

This also has the effect of fixing an issue where a reset of the device
would occur after having called tcan4x5x_disable_wake(), making the
original behavior not actually disable the wake. This patch should now
disable wake or state pin functions well after the reset occurs.

Signed-off-by: Brett Werling <brett.werling@garmin.com>
Link: https://patch.msgid.link/20250711141728.1826073-1-brett.werling@garmin.com
Cc: Markus Schneider-Pargmann <msp@baylibre.com>
Fixes: 142c6dc6d9 ("can: tcan4x5x: Add support for tcan4552/4553")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-07-15 11:59:43 +02:00
..
Kconfig
m_can.c can: m_can: m_can_handle_lost_msg(): downgrade msg lost in rx message to debug level 2025-07-11 12:18:58 +02:00
m_can.h linux-can-next-for-6.14-20250110 2025-01-10 22:46:08 -08:00
m_can_pci.c can: m_can: fix missed interrupts with m_can_pci 2024-12-18 09:30:52 +01:00
m_can_platform.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
Makefile
tcan4x5x-core.c can: tcan4x5x: fix reset gpio usage during probe 2025-07-15 11:59:43 +02:00
tcan4x5x-regmap.c
tcan4x5x.h can: tcan4x5x: add option for selecting nWKRQ voltage 2024-12-23 12:37:24 +01:00