From: Ben Dooks Date: Tue, 15 Apr 2008 21:34:46 +0000 (-0700) Subject: spi: spi_s3c24xx must initialize num_chipselect X-Git-Tag: v2.6.25~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1e7780638a9192f15caf590e0081bf915fdef71;p=platform%2Fkernel%2Flinux-3.10.git spi: spi_s3c24xx must initialize num_chipselect The SPI core now expects num_chipselect to be set correctly as due to added checks on the chip being selected before an transfer is allowed. This patch adds a num_cs field to the platform data which needs to be set correctly before adding the SPI platform device. Signed-off-by: Ben Dooks Signed-off-by: David Brownell Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 80719ef..b7476b8 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -267,6 +267,10 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, hw); init_completion(&hw->done); + /* setup the master state. */ + + master->num_chipselect = hw->pdata->num_cs; + /* setup the state for the bitbang driver */ hw->bitbang.master = hw->master; diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h index 7ca0ed9..352d338 100644 --- a/include/asm-arm/arch-s3c2410/spi.h +++ b/include/asm-arm/arch-s3c2410/spi.h @@ -15,6 +15,7 @@ struct s3c2410_spi_info { unsigned long pin_cs; /* simple gpio cs */ + unsigned int num_cs; /* total chipselects */ void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); };