Commit d1e77806 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

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: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 50f426b5
...@@ -267,6 +267,10 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -267,6 +267,10 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hw); platform_set_drvdata(pdev, hw);
init_completion(&hw->done); init_completion(&hw->done);
/* setup the master state. */
master->num_chipselect = hw->pdata->num_cs;
/* setup the state for the bitbang driver */ /* setup the state for the bitbang driver */
hw->bitbang.master = hw->master; hw->bitbang.master = hw->master;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
struct s3c2410_spi_info { struct s3c2410_spi_info {
unsigned long pin_cs; /* simple gpio cs */ 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); void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment