mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] spi: add bits_per_word to proxy structure
@ 2011-07-05 22:14 franck.jullien
  2011-07-05 22:14 ` [PATCH] spi: unregister dev if master->setup fails franck.jullien
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: franck.jullien @ 2011-07-05 22:14 UTC (permalink / raw)
  To: barebox

From: Franck Jullien <franck.jullien@gmail.com>

During the creation of a new spi device, we need to
have the possiblility to give the bits_per_word value
to master->setup.

As a matter of fact, spi master could check the spi
device bits_per_word and compare this value against its
capabilities.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
 drivers/spi/spi.c |    1 +
 include/spi/spi.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6456897..5f3272b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -75,6 +75,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
 	proxy->chip_select = chip->chip_select;
 	proxy->max_speed_hz = chip->max_speed_hz;
 	proxy->mode = chip->mode;
+	proxy->bits_per_word = chip->bits_per_word;
 	proxy->dev.platform_data = chip->platform_data;
 	strcpy(proxy->dev.name, chip->name);
 	proxy->dev.type_data = proxy;
diff --git a/include/spi/spi.h b/include/spi/spi.h
index ac2013a..948e050 100644
--- a/include/spi/spi.h
+++ b/include/spi/spi.h
@@ -15,6 +15,7 @@ struct spi_board_info {
 	 * where the default of SPI_CS_HIGH = 0 is wrong.
 	 */
 	u8	mode;
+	u8	bits_per_word;
 	void	*platform_data;
 };
 
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH] spi: unregister dev if master->setup fails
  2011-07-05 22:14 [PATCH] spi: add bits_per_word to proxy structure franck.jullien
@ 2011-07-05 22:14 ` franck.jullien
  2011-07-05 22:14 ` [PATCH] Nios2: Compile bootm only if needed franck.jullien
  2011-07-06  8:26 ` [PATCH] spi: add bits_per_word to proxy structure Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: franck.jullien @ 2011-07-05 22:14 UTC (permalink / raw)
  To: barebox

From: Franck Jullien <franck.jullien@gmail.com>

If the device setup executed by the spi master fails,
unregister the created device.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
 drivers/spi/spi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6456897..aefb916 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -91,6 +91,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
 	return proxy;
 
 fail:
+	unregister_device(&proxy->dev);
 	free(proxy);
 	return NULL;
 }
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH] Nios2: Compile bootm only if needed
  2011-07-05 22:14 [PATCH] spi: add bits_per_word to proxy structure franck.jullien
  2011-07-05 22:14 ` [PATCH] spi: unregister dev if master->setup fails franck.jullien
@ 2011-07-05 22:14 ` franck.jullien
  2011-07-06  8:26 ` [PATCH] spi: add bits_per_word to proxy structure Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: franck.jullien @ 2011-07-05 22:14 UTC (permalink / raw)
  To: barebox

From: Franck Jullien <franck.jullien@gmail.com>

Fix an error when bootm support is not choosen during
the configuration.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
---
 arch/nios2/lib/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/nios2/lib/Makefile b/arch/nios2/lib/Makefile
index fc9d4d7..3affc45 100644
--- a/arch/nios2/lib/Makefile
+++ b/arch/nios2/lib/Makefile
@@ -2,6 +2,6 @@ obj-y                      += board.o
 obj-y                      += libgcc.o
 obj-y                      += clock.o
 obj-y                      += cache.o
-obj-y                      += bootm.o
+obj-$(CONFIG_CMD_BOOTM)    += bootm.o
 obj-$(CONFIG_EARLY_PRINTF) += early_printf.o
 
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] spi: add bits_per_word to proxy structure
  2011-07-05 22:14 [PATCH] spi: add bits_per_word to proxy structure franck.jullien
  2011-07-05 22:14 ` [PATCH] spi: unregister dev if master->setup fails franck.jullien
  2011-07-05 22:14 ` [PATCH] Nios2: Compile bootm only if needed franck.jullien
@ 2011-07-06  8:26 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-07-06  8:26 UTC (permalink / raw)
  To: franck.jullien; +Cc: barebox

All applied to master.

Thanks
 Sascha

On Wed, Jul 06, 2011 at 12:14:48AM +0200, franck.jullien@gmail.com wrote:
> From: Franck Jullien <franck.jullien@gmail.com>
> 
> During the creation of a new spi device, we need to
> have the possiblility to give the bits_per_word value
> to master->setup.
> 
> As a matter of fact, spi master could check the spi
> device bits_per_word and compare this value against its
> capabilities.
> 
> Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
> ---
>  drivers/spi/spi.c |    1 +
>  include/spi/spi.h |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 6456897..5f3272b 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -75,6 +75,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
>  	proxy->chip_select = chip->chip_select;
>  	proxy->max_speed_hz = chip->max_speed_hz;
>  	proxy->mode = chip->mode;
> +	proxy->bits_per_word = chip->bits_per_word;
>  	proxy->dev.platform_data = chip->platform_data;
>  	strcpy(proxy->dev.name, chip->name);
>  	proxy->dev.type_data = proxy;
> diff --git a/include/spi/spi.h b/include/spi/spi.h
> index ac2013a..948e050 100644
> --- a/include/spi/spi.h
> +++ b/include/spi/spi.h
> @@ -15,6 +15,7 @@ struct spi_board_info {
>  	 * where the default of SPI_CS_HIGH = 0 is wrong.
>  	 */
>  	u8	mode;
> +	u8	bits_per_word;
>  	void	*platform_data;
>  };
>  
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-07-06  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 22:14 [PATCH] spi: add bits_per_word to proxy structure franck.jullien
2011-07-05 22:14 ` [PATCH] spi: unregister dev if master->setup fails franck.jullien
2011-07-05 22:14 ` [PATCH] Nios2: Compile bootm only if needed franck.jullien
2011-07-06  8:26 ` [PATCH] spi: add bits_per_word to proxy structure Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox