Skip to content

Commit

Permalink
spi: spi_s3c24xx must initialize num_chipselect
Browse files Browse the repository at this point in the history
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 <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ben Dooks authored and torvalds committed Apr 16, 2008
1 parent 50f426b commit d1e7780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi_s3c24xx.c
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions include/asm-arm/arch-s3c2410/spi.h
Expand Up @@ -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);
};
Expand Down

0 comments on commit d1e7780

Please sign in to comment.