can: tcan4x5x: tcan4x5x_can_probe(): get the device out of standby before register...
authorSean Nyekjaer <sean@geanix.com>
Wed, 11 Dec 2019 13:58:52 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 19:08:27 +0000 (20:08 +0100)
commit1ad3ee211d331cdc60260952c3b3c61ddda4ed64
tree3bd4aa4eb263737974a1b8ba31884f57e6364f75
parenta05b169456468190549af475076e6d6b630b172a
can: tcan4x5x: tcan4x5x_can_probe(): get the device out of standby before register access

commit 3069ce620daed85e4ef2b0c087dca2509f809470 upstream.

The m_can tries to detect if Non ISO Operation is available while in
standby mode, 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 goes in standby mode. The
m_can driver tries to access the control register but fails due to the
device being 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")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/m_can/tcan4x5x.c