All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-06-28  6:47 ` Raffaele Recalcati
  0 siblings, 0 replies; 8+ messages in thread
From: Raffaele Recalcati @ 2010-06-28  6:47 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: Raffaele Recalcati, Davide Bonfanti, Russell King,
	Sandeep Paulraj, Cyril Chemparathy, Miguel Aguilar,
	Thomas Koeller, David Brownell, Grant Likely, Philby John,
	Sudhakar Rajashekhara, linux-arm-kernel, linux-kernel,
	spi-devel-general

From: Raffaele Recalcati <raffaele.recalcati@bticino.it>

    It is not everytime possible, due to hardware constraints,
    to use the hw chip select available on spi port.
    So I add this possibility using a gpio as chip select.
    If controller_data variable is not null it is
    the gpio to be used as chip select.
    The default case is compatible with evmdm365.
    This patch has been developed against the
    http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
    git tree and has been tested on bmx board (similar to dm365 evm but with
    gpio as spi chip select).

Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
---
 arch/arm/mach-davinci/dm365.c |   10 ++++++----
 drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a146849..42fd4a4 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
 	davinci_cfg_reg(DM365_SPI0_SDO);
 
 	/* not all slaves will be wired up */
-	if (chipselect_mask & BIT(0))
-		davinci_cfg_reg(DM365_SPI0_SDENA0);
-	if (chipselect_mask & BIT(1))
-		davinci_cfg_reg(DM365_SPI0_SDENA1);
+	if  (!((unsigned long) info->controller_data)) {
+		if (chipselect_mask & BIT(0))
+			davinci_cfg_reg(DM365_SPI0_SDENA0);
+		if (chipselect_mask & BIT(1))
+			davinci_cfg_reg(DM365_SPI0_SDENA1);
+	}
 
 	spi_register_board_info(info, len);
 
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 95afb6b..621ae46 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -29,6 +29,7 @@
 #include <linux/spi/spi_bitbang.h>
 #include <linux/slab.h>
 
+#include <mach/gpio.h>
 #include <mach/spi.h>
 #include <mach/edma.h>
 
@@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
 	pdata = davinci_spi->pdata;
 
 	/*
-	 * Board specific chip select logic decides the polarity and cs
-	 * line for the controller
-	 */
+	* Board specific chip select logic decides the polarity and cs
+	* line for the controller
+	*/
 	if (value == BITBANG_CS_INACTIVE) {
-		set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
-
-		data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
-		iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
-
+		if  ((unsigned long) spi->controller_data) {
+			gpio_set_value(spi->controller_data, \
+				!(spi->mode & SPI_CS_HIGH));
+		} else {
+			set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
+
+			data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
+			iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
+		}
 		while ((ioread32(davinci_spi->base + SPIBUF)
-					& SPIBUF_RXEMPTY_MASK) == 0)
+				& SPIBUF_RXEMPTY_MASK) == 0)
 			cpu_relax();
+	} else {
+		if  ((unsigned long) spi->controller_data)
+			gpio_set_value(spi->controller_data, \
+				(spi->mode & SPI_CS_HIGH));
 	}
 }
 
-- 
1.7.0.4


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

* [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-06-28  6:47 ` Raffaele Recalcati
  0 siblings, 0 replies; 8+ messages in thread
From: Raffaele Recalcati @ 2010-06-28  6:47 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: spi-devel-general, David Brownell, Russell King, Thomas Koeller,
	Sudhakar Rajashekhara, linux-kernel, Sandeep Paulraj,
	Grant Likely, Davide Bonfanti, Raffaele Recalcati,
	linux-arm-kernel, Cyril Chemparathy, Philby John, Miguel Aguilar

From: Raffaele Recalcati <raffaele.recalcati@bticino.it>

    It is not everytime possible, due to hardware constraints,
    to use the hw chip select available on spi port.
    So I add this possibility using a gpio as chip select.
    If controller_data variable is not null it is
    the gpio to be used as chip select.
    The default case is compatible with evmdm365.
    This patch has been developed against the
    http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
    git tree and has been tested on bmx board (similar to dm365 evm but with
    gpio as spi chip select).

Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
---
 arch/arm/mach-davinci/dm365.c |   10 ++++++----
 drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a146849..42fd4a4 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
 	davinci_cfg_reg(DM365_SPI0_SDO);
 
 	/* not all slaves will be wired up */
-	if (chipselect_mask & BIT(0))
-		davinci_cfg_reg(DM365_SPI0_SDENA0);
-	if (chipselect_mask & BIT(1))
-		davinci_cfg_reg(DM365_SPI0_SDENA1);
+	if  (!((unsigned long) info->controller_data)) {
+		if (chipselect_mask & BIT(0))
+			davinci_cfg_reg(DM365_SPI0_SDENA0);
+		if (chipselect_mask & BIT(1))
+			davinci_cfg_reg(DM365_SPI0_SDENA1);
+	}
 
 	spi_register_board_info(info, len);
 
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 95afb6b..621ae46 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -29,6 +29,7 @@
 #include <linux/spi/spi_bitbang.h>
 #include <linux/slab.h>
 
+#include <mach/gpio.h>
 #include <mach/spi.h>
 #include <mach/edma.h>
 
@@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
 	pdata = davinci_spi->pdata;
 
 	/*
-	 * Board specific chip select logic decides the polarity and cs
-	 * line for the controller
-	 */
+	* Board specific chip select logic decides the polarity and cs
+	* line for the controller
+	*/
 	if (value == BITBANG_CS_INACTIVE) {
-		set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
-
-		data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
-		iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
-
+		if  ((unsigned long) spi->controller_data) {
+			gpio_set_value(spi->controller_data, \
+				!(spi->mode & SPI_CS_HIGH));
+		} else {
+			set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
+
+			data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
+			iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
+		}
 		while ((ioread32(davinci_spi->base + SPIBUF)
-					& SPIBUF_RXEMPTY_MASK) == 0)
+				& SPIBUF_RXEMPTY_MASK) == 0)
 			cpu_relax();
+	} else {
+		if  ((unsigned long) spi->controller_data)
+			gpio_set_value(spi->controller_data, \
+				(spi->mode & SPI_CS_HIGH));
 	}
 }
 
-- 
1.7.0.4

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

* [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-06-28  6:47 ` Raffaele Recalcati
  0 siblings, 0 replies; 8+ messages in thread
From: Raffaele Recalcati @ 2010-06-28  6:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Raffaele Recalcati <raffaele.recalcati@bticino.it>

    It is not everytime possible, due to hardware constraints,
    to use the hw chip select available on spi port.
    So I add this possibility using a gpio as chip select.
    If controller_data variable is not null it is
    the gpio to be used as chip select.
    The default case is compatible with evmdm365.
    This patch has been developed against the
    http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
    git tree and has been tested on bmx board (similar to dm365 evm but with
    gpio as spi chip select).

Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
---
 arch/arm/mach-davinci/dm365.c |   10 ++++++----
 drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a146849..42fd4a4 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
 	davinci_cfg_reg(DM365_SPI0_SDO);
 
 	/* not all slaves will be wired up */
-	if (chipselect_mask & BIT(0))
-		davinci_cfg_reg(DM365_SPI0_SDENA0);
-	if (chipselect_mask & BIT(1))
-		davinci_cfg_reg(DM365_SPI0_SDENA1);
+	if  (!((unsigned long) info->controller_data)) {
+		if (chipselect_mask & BIT(0))
+			davinci_cfg_reg(DM365_SPI0_SDENA0);
+		if (chipselect_mask & BIT(1))
+			davinci_cfg_reg(DM365_SPI0_SDENA1);
+	}
 
 	spi_register_board_info(info, len);
 
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 95afb6b..621ae46 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -29,6 +29,7 @@
 #include <linux/spi/spi_bitbang.h>
 #include <linux/slab.h>
 
+#include <mach/gpio.h>
 #include <mach/spi.h>
 #include <mach/edma.h>
 
@@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
 	pdata = davinci_spi->pdata;
 
 	/*
-	 * Board specific chip select logic decides the polarity and cs
-	 * line for the controller
-	 */
+	* Board specific chip select logic decides the polarity and cs
+	* line for the controller
+	*/
 	if (value == BITBANG_CS_INACTIVE) {
-		set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
-
-		data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
-		iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
-
+		if  ((unsigned long) spi->controller_data) {
+			gpio_set_value(spi->controller_data, \
+				!(spi->mode & SPI_CS_HIGH));
+		} else {
+			set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
+
+			data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
+			iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
+		}
 		while ((ioread32(davinci_spi->base + SPIBUF)
-					& SPIBUF_RXEMPTY_MASK) == 0)
+				& SPIBUF_RXEMPTY_MASK) == 0)
 			cpu_relax();
+	} else {
+		if  ((unsigned long) spi->controller_data)
+			gpio_set_value(spi->controller_data, \
+				(spi->mode & SPI_CS_HIGH));
 	}
 }
 
-- 
1.7.0.4

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

* Re: [PATCH] spi: davinci: Added support for chip select using gpio
  2010-06-28  6:47 ` Raffaele Recalcati
@ 2010-06-30 23:03   ` Grant Likely
  -1 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2010-06-30 23:03 UTC (permalink / raw)
  To: Raffaele Recalcati, Brian Niebuhr
  Cc: davinci-linux-open-source, Raffaele Recalcati, Davide Bonfanti,
	Russell King, Sandeep Paulraj, Cyril Chemparathy, Miguel Aguilar,
	Thomas Koeller, David Brownell, Philby John,
	Sudhakar Rajashekhara, linux-arm-kernel, linux-kernel,
	spi-devel-general

On Mon, Jun 28, 2010 at 12:47 AM, Raffaele Recalcati
<lamiaposta71@gmail.com> wrote:
> From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>
>    It is not everytime possible, due to hardware constraints,
>    to use the hw chip select available on spi port.
>    So I add this possibility using a gpio as chip select.
>    If controller_data variable is not null it is
>    the gpio to be used as chip select.
>    The default case is compatible with evmdm365.
>    This patch has been developed against the
>    http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
>    git tree and has been tested on bmx board (similar to dm365 evm but with
>    gpio as spi chip select).
>
> Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>

The davinci SPI driver is getting completely replaced (as soon as I
receive the respun patches), and I assume this patch will no longer
apply after the fact, so I'm not going to pick this patch up.  You
should coordinate with Brian Niebuhr to get this feature into his new
driver.

Cheers,
g.

> ---
>  arch/arm/mach-davinci/dm365.c |   10 ++++++----
>  drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
>  2 files changed, 24 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
> index a146849..42fd4a4 100644
> --- a/arch/arm/mach-davinci/dm365.c
> +++ b/arch/arm/mach-davinci/dm365.c
> @@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
>        davinci_cfg_reg(DM365_SPI0_SDO);
>
>        /* not all slaves will be wired up */
> -       if (chipselect_mask & BIT(0))
> -               davinci_cfg_reg(DM365_SPI0_SDENA0);
> -       if (chipselect_mask & BIT(1))
> -               davinci_cfg_reg(DM365_SPI0_SDENA1);
> +       if  (!((unsigned long) info->controller_data)) {
> +               if (chipselect_mask & BIT(0))
> +                       davinci_cfg_reg(DM365_SPI0_SDENA0);
> +               if (chipselect_mask & BIT(1))
> +                       davinci_cfg_reg(DM365_SPI0_SDENA1);
> +       }
>
>        spi_register_board_info(info, len);
>
> diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
> index 95afb6b..621ae46 100644
> --- a/drivers/spi/davinci_spi.c
> +++ b/drivers/spi/davinci_spi.c
> @@ -29,6 +29,7 @@
>  #include <linux/spi/spi_bitbang.h>
>  #include <linux/slab.h>
>
> +#include <mach/gpio.h>
>  #include <mach/spi.h>
>  #include <mach/edma.h>
>
> @@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
>        pdata = davinci_spi->pdata;
>
>        /*
> -        * Board specific chip select logic decides the polarity and cs
> -        * line for the controller
> -        */
> +       * Board specific chip select logic decides the polarity and cs
> +       * line for the controller
> +       */
>        if (value == BITBANG_CS_INACTIVE) {
> -               set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
> -
> -               data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
> -               iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
> -
> +               if  ((unsigned long) spi->controller_data) {
> +                       gpio_set_value(spi->controller_data, \
> +                               !(spi->mode & SPI_CS_HIGH));
> +               } else {
> +                       set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
> +
> +                       data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
> +                       iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
> +               }
>                while ((ioread32(davinci_spi->base + SPIBUF)
> -                                       & SPIBUF_RXEMPTY_MASK) == 0)
> +                               & SPIBUF_RXEMPTY_MASK) == 0)
>                        cpu_relax();
> +       } else {
> +               if  ((unsigned long) spi->controller_data)
> +                       gpio_set_value(spi->controller_data, \
> +                               (spi->mode & SPI_CS_HIGH));
>        }
>  }
>
> --
> 1.7.0.4
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-06-30 23:03   ` Grant Likely
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2010-06-30 23:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 28, 2010 at 12:47 AM, Raffaele Recalcati
<lamiaposta71@gmail.com> wrote:
> From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>
> ? ?It is not everytime possible, due to hardware constraints,
> ? ?to use the hw chip select available on spi port.
> ? ?So I add this possibility using a gpio as chip select.
> ? ?If controller_data variable is not null it is
> ? ?the gpio to be used as chip select.
> ? ?The default case is compatible with evmdm365.
> ? ?This patch has been developed against the
> ? ?http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git
> ? ?git tree and has been tested on bmx board (similar to dm365 evm but with
> ? ?gpio as spi chip select).
>
> Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>

The davinci SPI driver is getting completely replaced (as soon as I
receive the respun patches), and I assume this patch will no longer
apply after the fact, so I'm not going to pick this patch up.  You
should coordinate with Brian Niebuhr to get this feature into his new
driver.

Cheers,
g.

> ---
> ?arch/arm/mach-davinci/dm365.c | ? 10 ++++++----
> ?drivers/spi/davinci_spi.c ? ? | ? 27 ++++++++++++++++++---------
> ?2 files changed, 24 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
> index a146849..42fd4a4 100644
> --- a/arch/arm/mach-davinci/dm365.c
> +++ b/arch/arm/mach-davinci/dm365.c
> @@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
> ? ? ? ?davinci_cfg_reg(DM365_SPI0_SDO);
>
> ? ? ? ?/* not all slaves will be wired up */
> - ? ? ? if (chipselect_mask & BIT(0))
> - ? ? ? ? ? ? ? davinci_cfg_reg(DM365_SPI0_SDENA0);
> - ? ? ? if (chipselect_mask & BIT(1))
> - ? ? ? ? ? ? ? davinci_cfg_reg(DM365_SPI0_SDENA1);
> + ? ? ? if ?(!((unsigned long) info->controller_data)) {
> + ? ? ? ? ? ? ? if (chipselect_mask & BIT(0))
> + ? ? ? ? ? ? ? ? ? ? ? davinci_cfg_reg(DM365_SPI0_SDENA0);
> + ? ? ? ? ? ? ? if (chipselect_mask & BIT(1))
> + ? ? ? ? ? ? ? ? ? ? ? davinci_cfg_reg(DM365_SPI0_SDENA1);
> + ? ? ? }
>
> ? ? ? ?spi_register_board_info(info, len);
>
> diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
> index 95afb6b..621ae46 100644
> --- a/drivers/spi/davinci_spi.c
> +++ b/drivers/spi/davinci_spi.c
> @@ -29,6 +29,7 @@
> ?#include <linux/spi/spi_bitbang.h>
> ?#include <linux/slab.h>
>
> +#include <mach/gpio.h>
> ?#include <mach/spi.h>
> ?#include <mach/edma.h>
>
> @@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
> ? ? ? ?pdata = davinci_spi->pdata;
>
> ? ? ? ?/*
> - ? ? ? ?* Board specific chip select logic decides the polarity and cs
> - ? ? ? ?* line for the controller
> - ? ? ? ?*/
> + ? ? ? * Board specific chip select logic decides the polarity and cs
> + ? ? ? * line for the controller
> + ? ? ? */
> ? ? ? ?if (value == BITBANG_CS_INACTIVE) {
> - ? ? ? ? ? ? ? set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
> -
> - ? ? ? ? ? ? ? data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
> - ? ? ? ? ? ? ? iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
> -
> + ? ? ? ? ? ? ? if ?((unsigned long) spi->controller_data) {
> + ? ? ? ? ? ? ? ? ? ? ? gpio_set_value(spi->controller_data, \
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? !(spi->mode & SPI_CS_HIGH));
> + ? ? ? ? ? ? ? } else {
> + ? ? ? ? ? ? ? ? ? ? ? set_io_bits(davinci_spi->base + SPIDEF, CS_DEFAULT);
> +
> + ? ? ? ? ? ? ? ? ? ? ? data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
> + ? ? ? ? ? ? ? ? ? ? ? iowrite32(data1_reg_val, davinci_spi->base + SPIDAT1);
> + ? ? ? ? ? ? ? }
> ? ? ? ? ? ? ? ?while ((ioread32(davinci_spi->base + SPIBUF)
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? & SPIBUF_RXEMPTY_MASK) == 0)
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? & SPIBUF_RXEMPTY_MASK) == 0)
> ? ? ? ? ? ? ? ? ? ? ? ?cpu_relax();
> + ? ? ? } else {
> + ? ? ? ? ? ? ? if ?((unsigned long) spi->controller_data)
> + ? ? ? ? ? ? ? ? ? ? ? gpio_set_value(spi->controller_data, \
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (spi->mode & SPI_CS_HIGH));
> ? ? ? ?}
> ?}
>
> --
> 1.7.0.4
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Rif: Re: [PATCH] spi: davinci: Added support for chip select using gpio
  2010-06-30 23:03   ` Grant Likely
  (?)
@ 2010-07-01  5:59     ` raffaele.recalcati
  -1 siblings, 0 replies; 8+ messages in thread
From: raffaele.recalcati @ 2010-07-01  5:59 UTC (permalink / raw)
  To: Grant Likely, Brian Niebuhr
  Cc: Raffaele Recalcati, davinci-linux-open-source, Davide Bonfanti,
	Russell King, Sandeep Paulraj, Cyril Chemparathy, Miguel Aguilar,
	Thomas Koeller, David Brownell, Philby John,
	Sudhakar Rajashekhara, linux-arm-kernel, linux-kernel,
	spi-devel-general


-----glikely@secretlab.ca ha scritto: -----

>Per: Raffaele Recalcati <lamiaposta71@gmail.com>, Brian Niebuhr
><bniebuhr3@gmail.com>
>Da: Grant Likely <grant.likely@secretlab.ca>
>Inviato da: glikely@secretlab.ca
>Data: 01/07/2010 01.03
>Cc: davinci-linux-open-source@linux.davincidsp.com, Raffaele
>Recalcati <raffaele.recalcati@bticino.it>, Davide Bonfanti
><davide.bonfanti@bticino.it>, Russell King <linux@arm.linux.org.uk>,
>Sandeep Paulraj <s-paulraj@ti.com>, Cyril Chemparathy <cyril@ti.com>,
>Miguel Aguilar <miguel.aguilar@ridgerun.com>, Thomas Koeller
><thomas.koeller@baslerweb.com>, David Brownell
><dbrownell@users.sourceforge.net>, Philby John <pjohn@in.mvista.com>,
>Sudhakar Rajashekhara <sudhakar.raj@ti.com>,
>linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,
>spi-devel-general@lists.sourceforge.net
>Oggetto: Re: [PATCH] spi: davinci: Added support for chip select
>using gpio
>
>On Mon, Jun 28, 2010 at 12:47 AM, Raffaele Recalcati
><lamiaposta71@gmail.com> wrote:
>> From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>>
>>    It is not everytime possible, due to hardware constraints,
>>    to use the hw chip select available on spi port.
>>    So I add this possibility using a gpio as chip select.
>>    If controller_data variable is not null it is
>>    the gpio to be used as chip select.
>>    The default case is compatible with evmdm365.
>>    This patch has been developed against the
>>
>http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.
>git
>>    git tree and has been tested on bmx board (similar to dm365 evm
>but with
>>    gpio as spi chip select).
>>
>> Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
>
>The davinci SPI driver is getting completely replaced (as soon as I
>receive the respun patches), and I assume this patch will no longer
>apply after the fact, so I'm not going to pick this patch up.  You
>should coordinate with Brian Niebuhr to get this feature into his new
>driver.

I'm not very lucky with davinci-linux-open-source patching.
Thank you for the information.
The patch is really simple and so it will be not a real problem to up port
it.

I'd like anyway a timing roadmap, because,
if now the best kernel choose for dm365 is surely
http://arago-project.org/git/projects/linux-davinci.git
because of dvsdk (video codec) compatibility,
it is possible that next year 2.6.36 will be stable and compatible to dvsdk
(video codec).
The kernel of dm365 (that is a video processor) has to be compatible to its
video codec.
How to manage the transition?


>Cheers,
>g.
>
>> ---
>>  arch/arm/mach-davinci/dm365.c |   10 ++++++----
>>  drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
>>  2 files changed, 24 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/dm365.c
>b/arch/arm/mach-davinci/dm365.c
>> index a146849..42fd4a4 100644
>> --- a/arch/arm/mach-davinci/dm365.c
>> +++ b/arch/arm/mach-davinci/dm365.c
>> @@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned
>chipselect_mask,
>>        davinci_cfg_reg(DM365_SPI0_SDO);
>>
>>        /* not all slaves will be wired up */
>> -       if (chipselect_mask & BIT(0))
>> -               davinci_cfg_reg(DM365_SPI0_SDENA0);
>> -       if (chipselect_mask & BIT(1))
>> -               davinci_cfg_reg(DM365_SPI0_SDENA1);
>> +       if  (!((unsigned long) info->controller_data)) {
>> +               if (chipselect_mask & BIT(0))
>> +                       davinci_cfg_reg(DM365_SPI0_SDENA0);
>> +               if (chipselect_mask & BIT(1))
>> +                       davinci_cfg_reg(DM365_SPI0_SDENA1);
>> +       }
>>
>>        spi_register_board_info(info, len);
>>
>> diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
>> index 95afb6b..621ae46 100644
>> --- a/drivers/spi/davinci_spi.c
>> +++ b/drivers/spi/davinci_spi.c
>> @@ -29,6 +29,7 @@
>>  #include <linux/spi/spi_bitbang.h>
>>  #include <linux/slab.h>
>>
>> +#include <mach/gpio.h>
>>  #include <mach/spi.h>
>>  #include <mach/edma.h>
>>
>> @@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct
>spi_device *spi, int value)
>>        pdata = davinci_spi->pdata;
>>
>>        /*
>> -        * Board specific chip select logic decides the polarity
>and cs
>> -        * line for the controller
>> -        */
>> +       * Board specific chip select logic decides the polarity and
>cs
>> +       * line for the controller
>> +       */
>>        if (value == BITBANG_CS_INACTIVE) {
>> -               set_io_bits(davinci_spi->base + SPIDEF,
>CS_DEFAULT);
>> -
>> -               data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
>> -               iowrite32(data1_reg_val, davinci_spi->base +
>SPIDAT1);
>> -
>> +               if  ((unsigned long) spi->controller_data) {
>> +                       gpio_set_value(spi->controller_data, \
>> +                               !(spi->mode & SPI_CS_HIGH));
>> +               } else {
>> +                       set_io_bits(davinci_spi->base + SPIDEF,
>CS_DEFAULT);
>> +
>> +                       data1_reg_val |= CS_DEFAULT <<
>SPIDAT1_CSNR_SHIFT;
>> +                       iowrite32(data1_reg_val, davinci_spi->base
>+ SPIDAT1);
>> +               }
>>                while ((ioread32(davinci_spi->base + SPIBUF)
>> -                                       & SPIBUF_RXEMPTY_MASK) ==
>0)
>> +                               & SPIBUF_RXEMPTY_MASK) == 0)
>>                        cpu_relax();
>> +       } else {
>> +               if  ((unsigned long) spi->controller_data)
>> +                       gpio_set_value(spi->controller_data, \
>> +                               (spi->mode & SPI_CS_HIGH));
>>        }
>>  }
>>
>> --
>> 1.7.0.4
>>
>>
>
>
>
>--
>Grant Likely, B.Sc., P.Eng.
>Secret Lab Technologies Ltd.

Ce message, ainsi que tous les fichiers joints à ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas être divulguées. Si vous n'êtes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier immédiatement à son expéditeur, et
de détruire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autorisée, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.

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

* Rif: Re: [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-07-01  5:59     ` raffaele.recalcati
  0 siblings, 0 replies; 8+ messages in thread
From: raffaele.recalcati @ 2010-07-01  5:59 UTC (permalink / raw)
  To: Grant Likely, Brian Niebuhr
  Cc: linux-arm-kernel, davinci-linux-open-source, David Brownell,
	Russell King, Thomas Koeller, Sudhakar Rajashekhara,
	linux-kernel, Sandeep Paulraj, Davide Bonfanti, Philby John,
	Miguel Aguilar, Cyril Chemparathy, spi-devel-general,
	Raffaele Recalcati


-----glikely@secretlab.ca ha scritto: -----

>Per: Raffaele Recalcati <lamiaposta71@gmail.com>, Brian Niebuhr
><bniebuhr3@gmail.com>
>Da: Grant Likely <grant.likely@secretlab.ca>
>Inviato da: glikely@secretlab.ca
>Data: 01/07/2010 01.03
>Cc: davinci-linux-open-source@linux.davincidsp.com, Raffaele
>Recalcati <raffaele.recalcati@bticino.it>, Davide Bonfanti
><davide.bonfanti@bticino.it>, Russell King <linux@arm.linux.org.uk>,
>Sandeep Paulraj <s-paulraj@ti.com>, Cyril Chemparathy <cyril@ti.com>,
>Miguel Aguilar <miguel.aguilar@ridgerun.com>, Thomas Koeller
><thomas.koeller@baslerweb.com>, David Brownell
><dbrownell@users.sourceforge.net>, Philby John <pjohn@in.mvista.com>,
>Sudhakar Rajashekhara <sudhakar.raj@ti.com>,
>linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,
>spi-devel-general@lists.sourceforge.net
>Oggetto: Re: [PATCH] spi: davinci: Added support for chip select
>using gpio
>
>On Mon, Jun 28, 2010 at 12:47 AM, Raffaele Recalcati
><lamiaposta71@gmail.com> wrote:
>> From: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>>
>>    It is not everytime possible, due to hardware constraints,
>>    to use the hw chip select available on spi port.
>>    So I add this possibility using a gpio as chip select.
>>    If controller_data variable is not null it is
>>    the gpio to be used as chip select.
>>    The default case is compatible with evmdm365.
>>    This patch has been developed against the
>>
>http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.
>git
>>    git tree and has been tested on bmx board (similar to dm365 evm
>but with
>>    gpio as spi chip select).
>>
>> Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
>> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
>
>The davinci SPI driver is getting completely replaced (as soon as I
>receive the respun patches), and I assume this patch will no longer
>apply after the fact, so I'm not going to pick this patch up.  You
>should coordinate with Brian Niebuhr to get this feature into his new
>driver.

I'm not very lucky with davinci-linux-open-source patching.
Thank you for the information.
The patch is really simple and so it will be not a real problem to up port
it.

I'd like anyway a timing roadmap, because,
if now the best kernel choose for dm365 is surely
http://arago-project.org/git/projects/linux-davinci.git
because of dvsdk (video codec) compatibility,
it is possible that next year 2.6.36 will be stable and compatible to dvsdk
(video codec).
The kernel of dm365 (that is a video processor) has to be compatible to its
video codec.
How to manage the transition?


>Cheers,
>g.
>
>> ---
>>  arch/arm/mach-davinci/dm365.c |   10 ++++++----
>>  drivers/spi/davinci_spi.c     |   27 ++++++++++++++++++---------
>>  2 files changed, 24 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/dm365.c
>b/arch/arm/mach-davinci/dm365.c
>> index a146849..42fd4a4 100644
>> --- a/arch/arm/mach-davinci/dm365.c
>> +++ b/arch/arm/mach-davinci/dm365.c
>> @@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned
>chipselect_mask,
>>        davinci_cfg_reg(DM365_SPI0_SDO);
>>
>>        /* not all slaves will be wired up */
>> -       if (chipselect_mask & BIT(0))
>> -               davinci_cfg_reg(DM365_SPI0_SDENA0);
>> -       if (chipselect_mask & BIT(1))
>> -               davinci_cfg_reg(DM365_SPI0_SDENA1);
>> +       if  (!((unsigned long) info->controller_data)) {
>> +               if (chipselect_mask & BIT(0))
>> +                       davinci_cfg_reg(DM365_SPI0_SDENA0);
>> +               if (chipselect_mask & BIT(1))
>> +                       davinci_cfg_reg(DM365_SPI0_SDENA1);
>> +       }
>>
>>        spi_register_board_info(info, len);
>>
>> diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
>> index 95afb6b..621ae46 100644
>> --- a/drivers/spi/davinci_spi.c
>> +++ b/drivers/spi/davinci_spi.c
>> @@ -29,6 +29,7 @@
>>  #include <linux/spi/spi_bitbang.h>
>>  #include <linux/slab.h>
>>
>> +#include <mach/gpio.h>
>>  #include <mach/spi.h>
>>  #include <mach/edma.h>
>>
>> @@ -270,18 +271,26 @@ static void davinci_spi_chipselect(struct
>spi_device *spi, int value)
>>        pdata = davinci_spi->pdata;
>>
>>        /*
>> -        * Board specific chip select logic decides the polarity
>and cs
>> -        * line for the controller
>> -        */
>> +       * Board specific chip select logic decides the polarity and
>cs
>> +       * line for the controller
>> +       */
>>        if (value == BITBANG_CS_INACTIVE) {
>> -               set_io_bits(davinci_spi->base + SPIDEF,
>CS_DEFAULT);
>> -
>> -               data1_reg_val |= CS_DEFAULT << SPIDAT1_CSNR_SHIFT;
>> -               iowrite32(data1_reg_val, davinci_spi->base +
>SPIDAT1);
>> -
>> +               if  ((unsigned long) spi->controller_data) {
>> +                       gpio_set_value(spi->controller_data, \
>> +                               !(spi->mode & SPI_CS_HIGH));
>> +               } else {
>> +                       set_io_bits(davinci_spi->base + SPIDEF,
>CS_DEFAULT);
>> +
>> +                       data1_reg_val |= CS_DEFAULT <<
>SPIDAT1_CSNR_SHIFT;
>> +                       iowrite32(data1_reg_val, davinci_spi->base
>+ SPIDAT1);
>> +               }
>>                while ((ioread32(davinci_spi->base + SPIBUF)
>> -                                       & SPIBUF_RXEMPTY_MASK) ==
>0)
>> +                               & SPIBUF_RXEMPTY_MASK) == 0)
>>                        cpu_relax();
>> +       } else {
>> +               if  ((unsigned long) spi->controller_data)
>> +                       gpio_set_value(spi->controller_data, \
>> +                               (spi->mode & SPI_CS_HIGH));
>>        }
>>  }
>>
>> --
>> 1.7.0.4
>>
>>
>
>
>
>--
>Grant Likely, B.Sc., P.Eng.
>Secret Lab Technologies Ltd.

Ce message, ainsi que tous les fichiers joints à ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas être divulguées. Si vous n'êtes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier immédiatement à son expéditeur, et
de détruire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autorisée, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.

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

* Rif: Re: [PATCH] spi: davinci: Added support for chip select using gpio
@ 2010-07-01  5:59     ` raffaele.recalcati
  0 siblings, 0 replies; 8+ messages in thread
From: raffaele.recalcati at bticino.it @ 2010-07-01  5:59 UTC (permalink / raw)
  To: linux-arm-kernel


-----glikely at secretlab.ca ha scritto: -----

>Per:?Raffaele?Recalcati?<lamiaposta71@gmail.com>,?Brian?Niebuhr
><bniebuhr3@gmail.com>
>Da:?Grant?Likely?<grant.likely@secretlab.ca>
>Inviato?da:?glikely at secretlab.ca
>Data:?01/07/2010?01.03
>Cc:?davinci-linux-open-source at linux.davincidsp.com,?Raffaele
>Recalcati?<raffaele.recalcati@bticino.it>,?Davide?Bonfanti
><davide.bonfanti@bticino.it>,?Russell?King?<linux@arm.linux.org.uk>,
>Sandeep?Paulraj?<s-paulraj@ti.com>,?Cyril?Chemparathy?<cyril@ti.com>,
>Miguel?Aguilar?<miguel.aguilar@ridgerun.com>,?Thomas?Koeller
><thomas.koeller@baslerweb.com>,?David?Brownell
><dbrownell@users.sourceforge.net>,?Philby?John?<pjohn@in.mvista.com>,
>Sudhakar?Rajashekhara?<sudhakar.raj@ti.com>,
>linux-arm-kernel at lists.infradead.org,?linux-kernel at vger.kernel.org,
>spi-devel-general at lists.sourceforge.net
>Oggetto:?Re:?[PATCH]?spi:?davinci:?Added?support?for?chip?select
>using?gpio
>
>On?Mon,?Jun?28,?2010?at?12:47?AM,?Raffaele?Recalcati
><lamiaposta71@gmail.com>?wrote:
>>?From:?Raffaele?Recalcati?<raffaele.recalcati@bticino.it>
>>
>>????It?is?not?everytime?possible,?due?to?hardware?constraints,
>>????to?use?the?hw?chip?select?available?on?spi?port.
>>????So?I?add?this?possibility?using?a?gpio?as?chip?select.
>>????If?controller_data?variable?is?not?null?it?is
>>????the?gpio?to?be?used?as?chip?select.
>>????The?default?case?is?compatible?with?evmdm365.
>>????This?patch?has?been?developed?against?the
>>
>http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.
>git
>>????git?tree?and?has?been?tested?on?bmx?board?(similar?to?dm365?evm
>but?with
>>????gpio?as?spi?chip?select).
>>
>>?Signed-off-by:?Raffaele?Recalcati?<raffaele.recalcati@bticino.it>
>>?Signed-off-by:?Davide?Bonfanti?<davide.bonfanti@bticino.it>
>
>The?davinci?SPI?driver?is?getting?completely?replaced?(as?soon?as?I
>receive?the?respun?patches),?and?I?assume?this?patch?will?no?longer
>apply?after?the?fact,?so?I'm?not?going?to?pick?this?patch?up.??You
>should?coordinate?with?Brian?Niebuhr?to?get?this?feature?into?his?new
>driver.

I'm not very lucky with davinci-linux-open-source patching.
Thank you for the information.
The patch is really simple and so it will be not a real problem to up port
it.

I'd like anyway a timing roadmap, because,
if now the best kernel choose for dm365 is surely
http://arago-project.org/git/projects/linux-davinci.git
because of dvsdk (video codec) compatibility,
it is possible that next year 2.6.36 will be stable and compatible to dvsdk
(video codec).
The kernel of dm365 (that is a video processor) has to be compatible to its
video codec.
How to manage the transition?


>Cheers,
>g.
>
>>?---
>>??arch/arm/mach-davinci/dm365.c?|???10?++++++----
>>??drivers/spi/davinci_spi.c?????|???27?++++++++++++++++++---------
>>??2?files?changed,?24?insertions(+),?13?deletions(-)
>>
>>?diff?--git?a/arch/arm/mach-davinci/dm365.c
>b/arch/arm/mach-davinci/dm365.c
>>?index?a146849..42fd4a4?100644
>>?---?a/arch/arm/mach-davinci/dm365.c
>>?+++?b/arch/arm/mach-davinci/dm365.c
>>?@@?-677,10?+677,12?@@?void?__init?dm365_init_spi0(unsigned
>chipselect_mask,
>>????????davinci_cfg_reg(DM365_SPI0_SDO);
>>
>>????????/*?not?all?slaves?will?be?wired?up?*/
>>?-???????if?(chipselect_mask?&?BIT(0))
>>?-???????????????davinci_cfg_reg(DM365_SPI0_SDENA0);
>>?-???????if?(chipselect_mask?&?BIT(1))
>>?-???????????????davinci_cfg_reg(DM365_SPI0_SDENA1);
>>?+???????if??(!((unsigned?long)?info->controller_data))?{
>>?+???????????????if?(chipselect_mask?&?BIT(0))
>>?+???????????????????????davinci_cfg_reg(DM365_SPI0_SDENA0);
>>?+???????????????if?(chipselect_mask?&?BIT(1))
>>?+???????????????????????davinci_cfg_reg(DM365_SPI0_SDENA1);
>>?+???????}
>>
>>????????spi_register_board_info(info,?len);
>>
>>?diff?--git?a/drivers/spi/davinci_spi.c?b/drivers/spi/davinci_spi.c
>>?index?95afb6b..621ae46?100644
>>?---?a/drivers/spi/davinci_spi.c
>>?+++?b/drivers/spi/davinci_spi.c
>>?@@?-29,6?+29,7?@@
>>??#include?<linux/spi/spi_bitbang.h>
>>??#include?<linux/slab.h>
>>
>>?+#include?<mach/gpio.h>
>>??#include?<mach/spi.h>
>>??#include?<mach/edma.h>
>>
>>?@@?-270,18?+271,26?@@?static?void?davinci_spi_chipselect(struct
>spi_device?*spi,?int?value)
>>????????pdata?=?davinci_spi->pdata;
>>
>>????????/*
>>?-????????*?Board?specific?chip?select?logic?decides?the?polarity
>and?cs
>>?-????????*?line?for?the?controller
>>?-????????*/
>>?+???????*?Board?specific?chip?select?logic?decides?the?polarity?and
>cs
>>?+???????*?line?for?the?controller
>>?+???????*/
>>????????if?(value?==?BITBANG_CS_INACTIVE)?{
>>?-???????????????set_io_bits(davinci_spi->base?+?SPIDEF,
>CS_DEFAULT);
>>?-
>>?-???????????????data1_reg_val?|=?CS_DEFAULT?<<?SPIDAT1_CSNR_SHIFT;
>>?-???????????????iowrite32(data1_reg_val,?davinci_spi->base?+
>SPIDAT1);
>>?-
>>?+???????????????if??((unsigned?long)?spi->controller_data)?{
>>?+???????????????????????gpio_set_value(spi->controller_data,?\
>>?+???????????????????????????????!(spi->mode?&?SPI_CS_HIGH));
>>?+???????????????}?else?{
>>?+???????????????????????set_io_bits(davinci_spi->base?+?SPIDEF,
>CS_DEFAULT);
>>?+
>>?+???????????????????????data1_reg_val?|=?CS_DEFAULT?<<
>SPIDAT1_CSNR_SHIFT;
>>?+???????????????????????iowrite32(data1_reg_val,?davinci_spi->base
>+?SPIDAT1);
>>?+???????????????}
>>????????????????while?((ioread32(davinci_spi->base?+?SPIBUF)
>>?-???????????????????????????????????????&?SPIBUF_RXEMPTY_MASK)?==
>0)
>>?+???????????????????????????????&?SPIBUF_RXEMPTY_MASK)?==?0)
>>????????????????????????cpu_relax();
>>?+???????}?else?{
>>?+???????????????if??((unsigned?long)?spi->controller_data)
>>?+???????????????????????gpio_set_value(spi->controller_data,?\
>>?+???????????????????????????????(spi->mode?&?SPI_CS_HIGH));
>>????????}
>>??}
>>
>>?--
>>?1.7.0.4
>>
>>
>
>
>
>--
>Grant?Likely,?B.Sc.,?P.Eng.
>Secret?Lab?Technologies?Ltd.

Ce message, ainsi que tous les fichiers joints ? ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas ?tre divulgu?es. Si vous n'?tes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier imm?diatement ? son exp?diteur, et
de d?truire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autoris?e, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.

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

end of thread, other threads:[~2010-07-01  6:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-28  6:47 [PATCH] spi: davinci: Added support for chip select using gpio Raffaele Recalcati
2010-06-28  6:47 ` Raffaele Recalcati
2010-06-28  6:47 ` Raffaele Recalcati
2010-06-30 23:03 ` Grant Likely
2010-06-30 23:03   ` Grant Likely
2010-07-01  5:59   ` Rif: " raffaele.recalcati
2010-07-01  5:59     ` raffaele.recalcati at bticino.it
2010-07-01  5:59     ` raffaele.recalcati

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.