summaryrefslogtreecommitdiffstats
path: root/drivers/spi/imx_spi.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-07-31 14:07:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-31 19:59:50 +0200
commit5f7811292054b39a82109da66e8d1e79e862b758 (patch)
treec72b8c9e2781c194b7c234c9e0613f139b7063f3 /drivers/spi/imx_spi.c
parente8bbacab05d8a8e7e86e31e9208457409bcbb1b0 (diff)
downloadbarebox-5f7811292054b39a82109da66e8d1e79e862b758.tar.gz
barebox-5f7811292054b39a82109da66e8d1e79e862b758.tar.xz
SPI i.MX: Add support for i.MX6
The i.MX5 does not have a valid function to get the spi clock. This patch introduces a function for i.MX6, and moves the bogus spi clock speed to the speed-imx5*.c. Not nice, but preserves the current status quo for i.MX5 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/spi/imx_spi.c')
-rw-r--r--drivers/spi/imx_spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
index 42358f2e6a..2e59b3c8dd 100644
--- a/drivers/spi/imx_spi.c
+++ b/drivers/spi/imx_spi.c
@@ -374,7 +374,7 @@ static void cspi_2_3_chipselect(struct spi_device *spi, int is_active)
if (!is_active) {
if (gpio >= 0)
- gpio_set_value(gpio, !gpio_cs);
+ gpio_direction_output(gpio, !gpio_cs);
return;
}
@@ -384,7 +384,7 @@ static void cspi_2_3_chipselect(struct spi_device *spi, int is_active)
ctrl |= CSPI_2_3_CTRL_MODE(cs);
/* set clock speed */
- ctrl |= cspi_2_3_clkdiv(166000000, spi->max_speed_hz);
+ ctrl |= cspi_2_3_clkdiv(imx_get_cspiclk(), spi->max_speed_hz);
/* set chip select to use */
ctrl |= CSPI_2_3_CTRL_CS(cs);
@@ -521,7 +521,7 @@ static int imx_spi_probe(struct device_d *dev)
version = SPI_IMX_VER_0_7;
#endif
#ifdef CONFIG_DRIVER_SPI_IMX_2_3
- if (cpu_is_mx51() || cpu_is_mx53())
+ if (cpu_is_mx51() || cpu_is_mx53() || cpu_is_mx6())
version = SPI_IMX_VER_2_3;
#endif
imx->chipselect = spi_imx_devtype_data[version].chipselect;