• Mark A. Greer's avatar
    spi: omap2-mcspi: Configure hardware when slave driver changes mode · c301ca64
    Mark A. Greer authored
    commit 97ca0d6c upstream.
    
    Commit id 2bd16e3e
    (spi: omap2-mcspi: Do not configure the controller
    on each transfer unless needed) does its job too
    well so omap2_mcspi_setup_transfer() isn't called
    even when an SPI slave driver changes 'spi->mode'.
    The result is that the mode requested by the SPI
    slave driver never takes effect.
    
    Fix this by adding the 'mode' member to the
    omap2_mcspi_cs structure which holds the mode
    value that the hardware is configured for.
    When the SPI slave driver changes 'spi->mode'
    it will be different than the value of this new
    member and the SPI master driver will know that
    the hardware must be reconfigured (by calling
    omap2_mcspi_setup_transfer()).
    
    Fixes: 2bd16e3e (spi: omap2-mcspi: Do not configure the controller on each transfer unless needed)
    Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c301ca64
spi-omap2-mcspi.c 38.2 KB