[PATCH 1/2] i.MX SPI: Setup SPI chipselect to inactive state while initializing device

Alexander Shiyan shc_work at mail.ru
Wed May 16 08:02:55 EDT 2012


To avoid unnecessary preset initial state chipselect lines for SPI, set it to
inactive state when adding devices to the system.

Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
 drivers/spi/imx_spi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
index 3b33b66..42358f2 100644
--- a/drivers/spi/imx_spi.c
+++ b/drivers/spi/imx_spi.c
@@ -145,6 +145,10 @@ struct spi_imx_devtype_data {
 
 static int imx_spi_setup(struct spi_device *spi)
 {
+	struct imx_spi *imx = container_of(spi->master, struct imx_spi, master);
+
+	imx->chipselect(spi, 0);
+
 	debug("%s mode 0x%08x bits_per_word: %d speed: %d\n",
 			__FUNCTION__, spi->mode, spi->bits_per_word,
 			spi->max_speed_hz);
-- 
1.7.3.4




More information about the barebox mailing list