* + spi-imx-fix-initial-chipselect-settings.patch added to -mm tree
@ 2009-09-30 23:53 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2009-09-30 23:53 UTC (permalink / raw)
To: mm-commits; +Cc: s.hauer, dbrownell, g.liakhovetski, u.kleine-koenig
The patch titled
spi-imx: fix initial chipselect settings
has been added to the -mm tree. Its filename is
spi-imx-fix-initial-chipselect-settings.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: spi-imx: fix initial chipselect settings
From: Sascha Hauer <s.hauer@pengutronix.de>
We can only setup the gpio pins in spi_setup time when we know the
SPI_CS_HIGH setting.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/spi/spi_imx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff -puN drivers/spi/spi_imx.c~spi-imx-fix-initial-chipselect-settings drivers/spi/spi_imx.c
--- a/drivers/spi/spi_imx.c~spi-imx-fix-initial-chipselect-settings
+++ a/drivers/spi/spi_imx.c
@@ -478,12 +478,18 @@ static int spi_imx_transfer(struct spi_d
static int spi_imx_setup(struct spi_device *spi)
{
+ struct spi_imx_data *spi_imx = spi_master_get_devdata(spi->master);
+ int gpio = spi_imx->chipselect[spi->chip_select];
+
if (!spi->bits_per_word)
spi->bits_per_word = 8;
pr_debug("%s: mode %d, %u bpw, %d hz\n", __func__,
spi->mode, spi->bits_per_word, spi->max_speed_hz);
+ if (gpio >= 0)
+ gpio_direction_output(gpio, spi->mode & SPI_CS_HIGH ? 0 : 1);
+
spi_imx_chipselect(spi, BITBANG_CS_INACTIVE);
return 0;
@@ -532,7 +538,6 @@ static int __init spi_imx_probe(struct p
dev_err(&pdev->dev, "can't get cs gpios");
goto out_master_put;
}
- gpio_direction_output(spi_imx->chipselect[i], 1);
}
spi_imx->bitbang.chipselect = spi_imx_chipselect;
_
Patches currently in -mm which might be from s.hauer@pengutronix.de are
spi-imx-rename-source-file-to-spi_imxc.patch
spi-imx-update-state-correctly.patch
spi-imx-fix-initial-chipselect-settings.patch
spi-imx-setup-mode_bits-we-can-handle.patch
spi-imx-no-need-to-assert-bits_per_word-being-initialized.patch
spi-imx-initialize-complete-config-struct.patch
spi-imx-strip-down-chipselect-function-to-only-drive-the-chipselect.patch
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-30 23:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30 23:53 + spi-imx-fix-initial-chipselect-settings.patch added to -mm tree akpm
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).