Re: [PATCH RFC can-next 1/3] can: m_can: add handle_dev_interrupts callback to m_can_ops

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

 



On 14.05.2021 13:19:44, Torin Cooper-Bennun wrote:
> This callback will allow M_CAN-based devices, e.g. TI TCAN4550, to
> handle device-specific interrupts which are not part of the M_CAN core,
> but are signaled on the same interrupt pin.
> 
> Signed-off-by: Torin Cooper-Bennun <torin@xxxxxxxxxxxxxxxxxx>

Another option would be to register a 2nd threaded interrupt handler in
the tcan4x5x driver....But this is much simpler.

> ---
>  drivers/net/can/m_can/m_can.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
> index ace071c3e58c..99203a37f9cc 100644
> --- a/drivers/net/can/m_can/m_can.h
> +++ b/drivers/net/can/m_can/m_can.h
> @@ -28,6 +28,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/can/dev.h>
>  #include <linux/pinctrl/consumer.h>
> +#include <linux/irqreturn.h>
>  
>  /* m_can lec values */
>  enum m_can_lec_type {
> @@ -62,6 +63,7 @@ struct m_can_classdev;
>  struct m_can_ops {
>  	/* Device specific call backs */
>  	int (*clear_interrupts)(struct m_can_classdev *cdev);
> +	irqreturn_t (*handle_dev_interrupts)(struct m_can_classdev *cdev);
>  	u32 (*read_reg)(struct m_can_classdev *cdev, int reg);
>  	int (*write_reg)(struct m_can_classdev *cdev, int reg, int val);
>  	u32 (*read_fifo)(struct m_can_classdev *cdev, int addr_offset);
> -- 
> 2.30.2

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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