linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.8-rc6 2/3] spi: fix spi_s3c24xx_gpio num_chipselect
@ 2008-11-22 20:19 David Brownell
       [not found] ` <200811221219.12473.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2008-11-22 20:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Ben Dooks

From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

The spi master driver must have num_chipselect set to
allow the bus to initialise. Pass this through the
platform data.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 arch/arm/mach-s3c2410/include/mach/spi-gpio.h |    1 +
 drivers/spi/spi_s3c24xx_gpio.c                |    1 +
 2 files changed, 2 insertions(+)

--- a/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
@@ -18,6 +18,7 @@ struct s3c2410_spigpio_info {
 	unsigned long		 pin_mosi;
 	unsigned long		 pin_miso;
 
+	int			 num_chipselect;
 	int			 bus_num;
 
 	void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs);
--- a/drivers/spi/spi_s3c24xx_gpio.c
+++ b/drivers/spi/spi_s3c24xx_gpio.c
@@ -118,6 +118,7 @@ static int s3c2410_spigpio_probe(struct 
 	/* setup spi bitbang adaptor */
 	sp->bitbang.master = spi_master_get(master);
 	sp->bitbang.master->bus_num = info->bus_num;
+	sp->bitbang.master->num_chipselect = info->num_chipselect;
 	sp->bitbang.chipselect = s3c2410_spigpio_chipselect;
 
 	sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0;

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 2.6.8-rc6 2/3] spi: fix spi_s3c24xx_gpio num_chipselect
       [not found] ` <200811221219.12473.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
@ 2008-11-22 21:17   ` Andrew Morton
       [not found]     ` <20081122131750.e1c031e2.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2008-11-22 21:17 UTC (permalink / raw)
  To: David Brownell
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Ben Dooks

On Sat, 22 Nov 2008 12:19:12 -0800 David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:

> From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> 
> The spi master driver must have num_chipselect set to
> allow the bus to initialise. Pass this through the
> platform data.
> 
> Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> ---
>  arch/arm/mach-s3c2410/include/mach/spi-gpio.h |    1 +
>  drivers/spi/spi_s3c24xx_gpio.c                |    1 +
>  2 files changed, 2 insertions(+)
> 
> --- a/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
> +++ b/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
> @@ -18,6 +18,7 @@ struct s3c2410_spigpio_info {
>  	unsigned long		 pin_mosi;
>  	unsigned long		 pin_miso;
>  
> +	int			 num_chipselect;
>  	int			 bus_num;
>  
>  	void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs);
> --- a/drivers/spi/spi_s3c24xx_gpio.c
> +++ b/drivers/spi/spi_s3c24xx_gpio.c
> @@ -118,6 +118,7 @@ static int s3c2410_spigpio_probe(struct 
>  	/* setup spi bitbang adaptor */
>  	sp->bitbang.master = spi_master_get(master);
>  	sp->bitbang.master->bus_num = info->bus_num;
> +	sp->bitbang.master->num_chipselect = info->num_chipselect;
>  	sp->bitbang.chipselect = s3c2410_spigpio_chipselect;
>  
>  	sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0;

What are the consequences of not having this fix in one's kernel?

(ie: which kernel versions need this fix?)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 2.6.8-rc6 2/3] spi: fix spi_s3c24xx_gpio num_chipselect
       [not found]     ` <20081122131750.e1c031e2.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
@ 2008-11-22 21:41       ` David Brownell
  0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2008-11-22 21:41 UTC (permalink / raw)
  To: Andrew Morton
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Ben Dooks

On Saturday 22 November 2008, Andrew Morton wrote:
> What are the consequences of not having this fix in one's kernel?
> 
> (ie: which kernel versions need this fix?)

Adapter won't register; so, 2.6.28 (or 2.6.8 if you believe $SUBJECT)
for sure.

This driver predates 082c8cb4e5e68c0fd29cc10c59db94d2284fd2b0 which
fixed a bug in the SPI framework that would have hidden this; that
merged in 2.6.23, so this particular issue has been lurking for a
while.  I'm guessing most folk have used the "native" driver on
those s3c chips.

- Dave



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-22 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-22 20:19 [patch 2.6.8-rc6 2/3] spi: fix spi_s3c24xx_gpio num_chipselect David Brownell
     [not found] ` <200811221219.12473.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-22 21:17   ` Andrew Morton
     [not found]     ` <20081122131750.e1c031e2.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-11-22 21:41       ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).