diff options
author | Sourav Poddar <sourav.poddar@ti.com> | 2013-08-22 15:50:48 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-22 18:05:39 (GMT) |
commit | db90a44177ac39fc22b2da5235b231fccdd4c673 (patch) | |
tree | 492a20db7dea81485f18da313a50e1a4136a9575 /kernel/auditsc.c | |
parent | f477b7fb13df2b843997559ff34e87d054ba6538 (diff) | |
download | linux-db90a44177ac39fc22b2da5235b231fccdd4c673.tar.xz |
spi: conditional checking of mode and transfer bits.
There is a bug in the following patch:
http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420
spi: DUAL and QUAD support
fix the previous patch some mistake below:
1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
"spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
previous way to get the property in @of_register_spi_devices().
2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
3. Add the following check
(1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
single, dual and quad.
(2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
to QUAD(SPI_NBITS_QUAD)
(3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
single(SPI_NBITS_SINGLE)
Checking of the tx/rx transfer bits and mode bits should be done conditionally
based on type of buffer filled else EINVAL condition will
always get hit either for rx or tx.
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'kernel/auditsc.c')
0 files changed, 0 insertions, 0 deletions