]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: simplify UINC handling
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 13 Feb 2021 23:25:45 +0000 (00:25 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 30 Mar 2021 09:14:49 +0000 (11:14 +0200)
commit454b5bdc883349cfca8c2321b10534e6620bd99e
tree3e96dbb91307b185f7a7a9d647dfb8fd75ebcea1
parentd71ab6800b39c1ddfbdc17efdc96d1cb463ad3bb
can: mcp251xfd: simplify UINC handling

In the patches:

af150a87df7c can: mcp25xxfd: rx-path: reduce number of SPI core requests to set UINC bit
fbb26ab001bc can: mcp251xfd: tef-path: reduce number of SPI core requests to set UINC bit

the setting of the UINC bit in the TEF and RX FIFO was batched into a
single SPI message consisting of several transfers. All transfers but
the last need to have the cs_change set to 1.

In the original patches the array of prepared transfers is send from
the beginning with the length depending on the number of read TEF/RX
objects. The cs_change of the last transfer is temporarily set to
0 during send.

This patch removes the modification of cs_change by preparing the last
transfer with cs_change to 0 and all other to 1. When sending the SPI
message the driver now starts with an offset into the array, so that
it always ends on the last entry in the array, which has the cs_change
set to 0.

Link: https://lore.kernel.org/r/20210304160328.2752293-3-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c