spi-fsl-dspi: Fix CTAR Register access
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Thu, 10 Dec 2015 05:55:30 +0000 (11:25 +0530)
committerMark Brown <broonie@kernel.org>
Sat, 12 Dec 2015 22:33:09 +0000 (22:33 +0000)
commitef22d1604c622d24ded69f40d40c3c6d83f71156
tree00857ff3240d92db30110b13bf70af44189d4592
parent8005c49d9aea74d382f474ce11afbbc7d7130bec
spi-fsl-dspi: Fix CTAR Register access

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: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Acked-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c
This page took 0.024756 seconds and 5 git commands to generate.