]> git.baikalelectronics.ru Git - kernel.git/commit
can: flexcan: flexcan_irq(): add support for TX mailbox in iflag1
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 1 Mar 2019 14:38:05 +0000 (15:38 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 11 Nov 2019 20:58:12 +0000 (21:58 +0100)
commit9af9321fa1322ab304bfe123ff541199cf741374
treee7d7c4c38fb14944b55923eeb0adbb4805ba8494
parentf32824f4a4bfa208ac4013a4c6ec22ea974b5ca5
can: flexcan: flexcan_irq(): add support for TX mailbox in iflag1

The flexcan IP core has up to 64 mailboxes, each one has a corresponding
interrupt bit in the iflag1 or iflag2 registers and a mask bit in the
imask1 or imask2 registers.

The driver will always use the last mailbox for TX, which falls into the iflag2
register.

To support CANFD the payload size has to increase to 64 bytes and the number of
mailboxes will decrease so much that the TX mailbox will be handled in the
iflag1 register.

This patch add support to handle the TX mailbox independent whether it's
in iflag1 or iflag2 by introducing th flexcan_read_reg_iflag_tx()
function, similar to flexcan_read_reg_iflag_rx(), for the read path.

For the write path the function flexcan_write64() is added.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c