• Bhuvanchandra DV's avatar
    spi-fsl-dspi: Fix CTAR Register access · ef22d160
    Bhuvanchandra DV authored
    DSPI instances in Vybrid have a different amount of chip selects
    and CTARs (Clock and transfer Attributes Register). In case of
    DSPI1 we only have 2 CTAR registers and 4 CS. In present driver
    implementation CTAR offset is derived from CS instance which will
    lead to out of bound access if chip select instance is greater than
    CTAR register instance, hence use single CTAR0 register for all CS
    instances. Since we write the CTAR register anyway before each access,
    there is no value in using the additional CTAR registers. Also one
    should not program a value in CTAS for a CTAR register that is not
    present, hence configure CTAS to use CTAR0.
    Signed-off-by: default avatarBhuvanchandra DV <bhuvanchandra.dv@toradex.com>
    Acked-by: default avatarStefan Agner <stefan@agner.ch>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    ef22d160
spi-fsl-dspi.c 18.8 KB