mirror-linux/drivers/net/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
..
c_can can: c_can: Use syscon_regmap_lookup_by_phandle_args 2025-02-19 10:44:21 +01:00
cc770 can: {cc770,sja1000}_isa: allow building on x86_64 2024-11-04 17:46:06 +01:00
ctucanfd can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
dev can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
esd can: esd_402_pci: Add support for one-shot mode 2024-08-05 17:32:00 +02:00
flexcan can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
ifi_canfd can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
m_can can: tcan4x5x: fix reset gpio usage during probe 2025-07-15 11:59:43 +02:00
mscan can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
peak_canfd can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
rcar can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
rockchip can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
sja1000 treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
slcan can: slcan: allow reception of short error messages 2025-05-21 10:12:05 +02:00
softing can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
spi can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00
usb treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
Kconfig can: rockchip_canfd: add driver for Rockchip CAN-FD controller 2024-09-04 14:41:51 +02:00
Makefile can: rockchip_canfd: add driver for Rockchip CAN-FD controller 2024-09-04 14:41:51 +02:00
at91_can.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
bxcan.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
can327.c
grcan.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
janz-ican3.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
kvaser_pciefd.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
sun4i_can.c linux-can-next-for-6.14-20250110 2025-01-10 22:46:08 -08:00
ti_hecc.c can: Switch back to struct platform_driver::remove() 2024-09-11 09:37:16 +02:00
vcan.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
vxcan.c net: Use link/peer netns in newlink() of rtnl_link_ops 2025-02-21 15:28:02 -08:00
xilinx_can.c can: dev: add struct data_bittiming_params to group FD parameters 2025-05-21 14:33:28 +02:00