]> asedeno.scripts.mit.edu Git - linux.git/commit
can: xilinx_can: refactor code in preparation for CAN FD support
authorAnssi Hannula <anssi.hannula@bitwise.fi>
Mon, 26 Feb 2018 13:56:51 +0000 (15:56 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 27 Jul 2018 08:40:17 +0000 (10:40 +0200)
commit1598efe57b3e768056e4ca56cb9cf33111e68d1c
treee7ca69720a7b3a479b80cc143b33d15f943c06e7
parent7cb0f17f5252874ba0ecbda964e7e01587bf828e
can: xilinx_can: refactor code in preparation for CAN FD support

Xilinx CAN FD cores are different enough from the previous Zynq and AXI
CAN cores that some refactoring of the driver is needed.

This commit contains most of the required refactoring to existing code
and should not alter behavior on existing supported HW.

The changes are:

- Reading and writing to frame registers is parametrized to allow
  reading/writing a different frame in the future.

- Slightly misleading (as it did not specify *all* the interrupts
  supported by the HW) XCAN_INTR_ALL is replaced with specifying the
  interrupts inline in interrupt enabling code.

- xcan_devtype_data.caps is renamed to xcan_devtype_data.flags to allow
  for flags that define alternative functionality (e.g. mailboxes vs.
  FIFO) instead of purely additive capabilities.

- can_bittiming_const is added to xcan_devtype_data as CAN FD cores will
  have wider setting ranges.

- bus_clk clock name is now determined through xcan_devtype_data instead
  of comparing compatible string in probe().

- xcan_devtype_data is added to xcan_priv to allow flag checks after
  probe().

- XCAN_CAP_WATERMARK is now XCAN_FLAG_TXFEMP. CAN FD cores have
  watermark support but no TXFEMP interrupt, which is what we are
  actually interested in.

- xcan_start_xmit() is split to in two parts to prepare for TX mailboxes
  instead of FIFO in CAN FD cores.

v2: Wrapped some long lines in xcan_write_frame().

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/xilinx_can.c