All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi-gpio: init CS before spi_bitbang_setup()
@ 2013-04-09 17:25 Josef Ahmad
  2013-04-10 13:47 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Josef Ahmad @ 2013-04-09 17:25 UTC (permalink / raw)
  To: Daniel Mack, Uwe Kleine-Koenig, Grant Likely,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Mark Brown
  Cc: Josef Ahmad

spi_bitbang_setup() deasserts the chip select line to initialise
the device. The chip select GPIO line is obtained from
spi_gpio->cs_gpios[] private data.
Currently, devices that are not registered under devicetree
environment will call into spi_bitbang_setup() with stale
cs_gpios[].

This patch ensures spi_gpio->cs_gpios[] is always initialised prior
to calling spi_bitbang_setup().

Reviewed-by: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Josef Ahmad <josef.ahmad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/spi/spi-gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index c7cf0b7..0fa345c 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi)
 		}
 	}
 	if (!status) {
-		status = spi_bitbang_setup(spi);
 		/* in case it was initialized from static board data */
 		spi_gpio->cs_gpios[spi->chip_select] = cs;
+		status = spi_bitbang_setup(spi);
 	}
 
 	if (status) {
-- 
1.7.0.7


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
  2013-04-09 17:25 [PATCH] spi-gpio: init CS before spi_bitbang_setup() Josef Ahmad
@ 2013-04-10 13:47 ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-04-10 13:47 UTC (permalink / raw)
  To: Josef Ahmad
  Cc: Daniel Mack, Uwe Kleine-Koenig, Grant Likely, spi-devel-general,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

On Tue, Apr 09, 2013 at 06:25:34PM +0100, Josef Ahmad wrote:
> spi_bitbang_setup() deasserts the chip select line to initialise
> the device. The chip select GPIO line is obtained from
> spi_gpio->cs_gpios[] private data.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
  2013-04-09 17:11       ` Daniel Mack
  (?)
@ 2013-04-09 17:32       ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2013-04-09 17:32 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Josef Ahmad, Uwe Kleine-Koenig, Grant Likely, spi-devel-general,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

On Tue, Apr 09, 2013 at 07:11:21PM +0200, Daniel Mack wrote:

> The reply was fyi only, as the patch also went to spi-devel-general. Can
> you pick it from there or should Josef send it again with your address
> in Cc:?

Please make sure stuff goes to my inbox, I *can* pick up from
-devel-general but it's generally painful as my list traffic is going to
a different e-mail account and so on (plus I'm heavily backlogged on
list traffic in general at the minute, and sourceforge is full of spam).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
@ 2013-04-09 17:11       ` Daniel Mack
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2013-04-09 17:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: Josef Ahmad, Uwe Kleine-Koenig, Grant Likely, spi-devel-general,
	linux-kernel

On 09.04.2013 19:08, Mark Brown wrote:
> On Tue, Apr 09, 2013 at 07:06:32PM +0200, Daniel Mack wrote:
>> Cc: Mark
>>
>> On 09.04.2013 18:40, Josef Ahmad wrote:
>>> spi_bitbang_setup() deasserts the chip select line to initialise
>>> the device. The chip select GPIO line is obtained from
> 
> Please resend the patch - git am doesn't know how to strip off quotation
> stuff!
> 

The reply was fyi only, as the patch also went to spi-devel-general. Can
you pick it from there or should Josef send it again with your address
in Cc:?


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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
@ 2013-04-09 17:11       ` Daniel Mack
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Mack @ 2013-04-09 17:11 UTC (permalink / raw)
  To: Mark Brown
  Cc: Josef Ahmad, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Uwe Kleine-Koenig

On 09.04.2013 19:08, Mark Brown wrote:
> On Tue, Apr 09, 2013 at 07:06:32PM +0200, Daniel Mack wrote:
>> Cc: Mark
>>
>> On 09.04.2013 18:40, Josef Ahmad wrote:
>>> spi_bitbang_setup() deasserts the chip select line to initialise
>>> the device. The chip select GPIO line is obtained from
> 
> Please resend the patch - git am doesn't know how to strip off quotation
> stuff!
> 

The reply was fyi only, as the patch also went to spi-devel-general. Can
you pick it from there or should Josef send it again with your address
in Cc:?


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
  2013-04-09 17:06 ` Daniel Mack
@ 2013-04-09 17:08   ` Mark Brown
  2013-04-09 17:11       ` Daniel Mack
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2013-04-09 17:08 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Josef Ahmad, Uwe Kleine-Koenig, Grant Likely, spi-devel-general,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On Tue, Apr 09, 2013 at 07:06:32PM +0200, Daniel Mack wrote:
> Cc: Mark
> 
> On 09.04.2013 18:40, Josef Ahmad wrote:
> > spi_bitbang_setup() deasserts the chip select line to initialise
> > the device. The chip select GPIO line is obtained from

Please resend the patch - git am doesn't know how to strip off quotation
stuff!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] spi-gpio: init CS before spi_bitbang_setup()
  2013-04-09 16:40 Josef Ahmad
@ 2013-04-09 17:06 ` Daniel Mack
  2013-04-09 17:08   ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Mack @ 2013-04-09 17:06 UTC (permalink / raw)
  To: Josef Ahmad
  Cc: Uwe Kleine-Koenig, Grant Likely, spi-devel-general, linux-kernel,
	Mark Brown

Cc: Mark

On 09.04.2013 18:40, Josef Ahmad wrote:
> spi_bitbang_setup() deasserts the chip select line to initialise
> the device. The chip select GPIO line is obtained from
> spi_gpio->cs_gpios[] private data.
> Currently, devices that are not registered under devicetree
> environment will call into spi_bitbang_setup() with stale
> cs_gpios[].
> 
> This patch ensures spi_gpio->cs_gpios[] is always initialised prior
> to calling spi_bitbang_setup().
> 
> Reviewed-by: Daniel Mack <zonque@gmail.com>
> Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
> ---
>  drivers/spi/spi-gpio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
> index c7cf0b7..0fa345c 100644
> --- a/drivers/spi/spi-gpio.c
> +++ b/drivers/spi/spi-gpio.c
> @@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi)
>  		}
>  	}
>  	if (!status) {
> -		status = spi_bitbang_setup(spi);
>  		/* in case it was initialized from static board data */
>  		spi_gpio->cs_gpios[spi->chip_select] = cs;
> +		status = spi_bitbang_setup(spi);
>  	}
>  
>  	if (status) {
> 


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

* [PATCH] spi-gpio: init CS before spi_bitbang_setup()
@ 2013-04-09 16:40 Josef Ahmad
  2013-04-09 17:06 ` Daniel Mack
  0 siblings, 1 reply; 8+ messages in thread
From: Josef Ahmad @ 2013-04-09 16:40 UTC (permalink / raw)
  To: Daniel Mack, Uwe Kleine-Koenig, Grant Likely,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Josef Ahmad

spi_bitbang_setup() deasserts the chip select line to initialise
the device. The chip select GPIO line is obtained from
spi_gpio->cs_gpios[] private data.
Currently, devices that are not registered under devicetree
environment will call into spi_bitbang_setup() with stale
cs_gpios[].

This patch ensures spi_gpio->cs_gpios[] is always initialised prior
to calling spi_bitbang_setup().

Reviewed-by: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Josef Ahmad <josef.ahmad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/spi/spi-gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index c7cf0b7..0fa345c 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -265,9 +265,9 @@ static int spi_gpio_setup(struct spi_device *spi)
 		}
 	}
 	if (!status) {
-		status = spi_bitbang_setup(spi);
 		/* in case it was initialized from static board data */
 		spi_gpio->cs_gpios[spi->chip_select] = cs;
+		status = spi_bitbang_setup(spi);
 	}
 
 	if (status) {
-- 
1.7.0.7


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

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

end of thread, other threads:[~2013-04-10 13:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09 17:25 [PATCH] spi-gpio: init CS before spi_bitbang_setup() Josef Ahmad
2013-04-10 13:47 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-04-09 16:40 Josef Ahmad
2013-04-09 17:06 ` Daniel Mack
2013-04-09 17:08   ` Mark Brown
2013-04-09 17:11     ` Daniel Mack
2013-04-09 17:11       ` Daniel Mack
2013-04-09 17:32       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.