OSDN Git Service

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)
commitb87c28b726daaa5ac315b59a0ae04282c265580b
treee7d7c4c38fb14944b55923eeb0adbb4805ba8494
parentd3a51507e45e06b22ea892fccfba4b42f704f859
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