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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
> > 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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux