aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMike Frysinger <michael.frysinger@analog.com>2007-12-05 02:45:14 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-05 12:21:19 -0500
commit2ed355165ff4ec834a75770f2a15dc87f5e06088 (patch)
tree9d409b8a624916225f07791d322dd6ca9eea4521 /drivers/spi
parentfad91c890909aabab0d9858d50f3c8394ee16b21 (diff)
spi: spi_bfin, don't bypass spi framework
Prevent people from setting bits in ctl_reg that the SPI framework already handles, hopefully we can one day drop ctl_reg completely Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_bfin5xx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index c2d51cf3c639..8e4ea8906dc7 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -998,6 +998,18 @@ static int setup(struct spi_device *spi)
998 998
999 /* chip_info isn't always needed */ 999 /* chip_info isn't always needed */
1000 if (chip_info) { 1000 if (chip_info) {
1001 /* Make sure people stop trying to set fields via ctl_reg
1002 * when they should actually be using common SPI framework.
1003 * Currently we let through: WOM EMISO PSSE GM SZ TIMOD.
1004 * Not sure if a user actually needs/uses any of these,
1005 * but let's assume (for now) they do.
1006 */
1007 if (chip_info->ctl_reg & (SPE|MSTR|CPOL|CPHA|LSBF|SIZE)) {
1008 dev_err(&spi->dev, "do not set bits in ctl_reg "
1009 "that the SPI framework manages\n");
1010 return -EINVAL;
1011 }
1012
1001 chip->enable_dma = chip_info->enable_dma != 0 1013 chip->enable_dma = chip_info->enable_dma != 0
1002 && drv_data->master_info->enable_dma; 1014 && drv_data->master_info->enable_dma;
1003 chip->ctl_reg = chip_info->ctl_reg; 1015 chip->ctl_reg = chip_info->ctl_reg;