]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
spi: spi-mxs: Change flag arguments in txrx functions to bit flags
authorTrent Piepho <tpiepho@gmail.com>
Tue, 1 Oct 2013 20:14:50 +0000 (13:14 -0700)
committerMark Brown <broonie@linaro.org>
Fri, 18 Oct 2013 00:00:29 +0000 (01:00 +0100)
commit28cad125881cb10172895774d4c3a04e748bf6bf
tree70b97772d3e78ef2e2336b6098cd69d9fc351ca5
parent75e73fa24882fb76e8ef89226893728ed0f78870
spi: spi-mxs: Change flag arguments in txrx functions to bit flags

There are three flag arguments to the PIO and DMA txrx functions.  Two
are passed as pointers to integers, even though they are input only
and not modified, which makes no sense to do.  The third is passed as
an integer.

The compiler must use an argument register or stack variable for each
flag this way.  Using bitflags in a single flag argument is more
efficient and produces smaller code, since all the flags can fit in a
single register.  And all the flag arguments get cumbersome,
especially when more are added for things like GPIO chipselects.

The "first" flag is never used, so can just be deleted.

The "last" flag is renamed to DEASSERT_CS, since that's really what it
does.  The spi_transfer cs_change flag means that CS might be
de-asserted on a transfer which is not last and not de-assert on the
last transfer, so it is not which transfer is the last we need to know
but rather the transfers after which CS should be de-asserted.

This also extends the driver to not ignore cs_change when setting the
DEASSERT_CS nee "last" flag.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-mxs.c