Thread (19 messages) 19 messages, 2 authors, 2021-07-02

Re: [PATCH can-next 0/5] m_can, tcan4x5x: device-specific interrupt handling

From: Torin Cooper-Bennun <hidden>
Date: 2021-06-01 08:21:12

On Wed, May 26, 2021 at 05:20:45PM +0200, Marc Kleine-Budde wrote:
On 26.05.2021 13:47:42, Torin Cooper-Bennun wrote:
quoted
TCAN4550 shutdown is attempted by setting the device into standby mode.
There is probably a better way, but I understand we are limited by being
in the ISR context.
Not exactly. The tcan's ISR runs in a threaded context, so you can
basically do normal SPI or regmap transactions, shut down clocks and
regulators, etc...
Got you. I keep forgetting that detail!

Would it be sufficient to change the CAN state as follows?

|	if (handled == IRQ_HANDLED) {
|		netdev_err(cdev->net,
|			   "Device is disabled by driver.\n");
|
|		cdev->can.state = CAN_STATE_STOPPED;
|
|		err = regmap_update_bits(priv->regmap, TCAN4X5X_CONFIG,
|					 TCAN4X5X_MODE_SEL_MASK,
|					 TCAN4X5X_MODE_STANDBY);
|		if (err)
|			goto exit_regmap_failure;
|	}

--
Regards,

Torin Cooper-Bennun
Software Engineer | maxiluxsystems.com

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help