Skip to contentSkip to conversation

can: tcan4x5x: put the device out of standby before register access

PATCH Superseded Sean Nyekjaer 1 participant 1 message Dec 11, 2019 1 message not in the archive

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v5 2/2 can: tcan4x5x: put the device out of standby before register access

The m_can tries to detect if Non ISO Operation is available while in standby, this function results in the following error:

tcan4x5x spi2.0 (unnamed net_device) (uninitialized): Failed to init module tcan4x5x spi2.0: m_can device registered (irq=84, version=32) tcan4x5x spi2.0 can2: TCAN4X5X successfully initialized.

When the tcan device comes out of reset it comes out in standby mode. The m_can driver tries to access the control register but fails due to the device is in standby mode.

So this patch will put the tcan device in normal mode before the m_can driver does the initialization.

Fixes 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")

---
Changes since v3:
- Fixed fixes tag

Changes since v4:
- None

 drivers/net/can/m_can/tcan4x5x.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/can/m_can/tcan4x5x.c +4 -0
index 032d110e0870..3a3359ad3723 100644
@@ -485,6 +485,10 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
 	if (ret)
 		goto out_power;
 
+	ret = tcan4x5x_init(mcan_class);
+	if (ret)
+		goto out_power;
+
 	ret = m_can_class_register(mcan_class);
 	if (ret)
 		goto out_power;
Signature · 1 line
2.24.0