MLK-15046-1 can: flexcan: re-structure to decouple the dependency on fifo mode
authorDong Aisheng <aisheng.dong@nxp.com>
Fri, 2 Jun 2017 08:16:20 +0000 (16:16 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:27:01 +0000 (15:27 -0500)
commitb428a6741cc1cfed3de58a75cb30a5a5a073aff8
tree29a3edc6874ba6778272210350ce34520d91f67e
parent92ff9e111b52ee1007b656b7a290f795a72de704
MLK-15046-1 can: flexcan: re-structure to decouple the dependency on fifo mode

Current driver is highly dependent on the struct flexcan_regs layout
which may vary once the Message Buffer is changed in the new flexcan
version supporting CAN FD protocol.

This patch tends to decouple the dependency on both register layout
and underlying transfer mechanism (FIFO mode or Message buffer).
The Message Buffer mode is still not supported which will be added
later.

To achieve this, struct flexcan_regs is removed and changed to use
reg offset instead and flexcan_{read|write} is then re-prototyped.

Besides that, two new designed API flexcan_mb_read/write are introduced
for raw message buffer read/write which is independent on underlying
transfer mechanism.

This patch has no function change but a preparation for the later
CAN FD support.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers/net/can/flexcan.c