• Trent Piepho's avatar
    spi: spi-mxs: Change flag arguments in txrx functions to bit flags · 28cad125
    Trent Piepho authored
    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: default avatarTrent 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: default avatarMark Brown <broonie@linaro.org>
    28cad125
spi-mxs.c 14.6 KB