]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit14d8c3c6ba4b62f92e4c092384955c594182022e
tree00857ff3240d92db30110b13bf70af44189d4592
parent837e0eb1c9d194f0eb3cf87d97b2235de146c9fe
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