summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/imx_cspi.c24
-rw-r--r--drivers/spi/imx_ecspi.c33
2 files changed, 6 insertions, 51 deletions
diff --git a/drivers/spi/imx_cspi.c b/drivers/spi/imx_cspi.c
index a4a3049..438ab8d 100644
--- a/drivers/spi/imx_cspi.c
+++ b/drivers/spi/imx_cspi.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -30,31 +30,13 @@
#include <imx_spi.h>
+extern s32 spi_get_cfg(struct imx_spi_dev_t *dev);
+
static inline struct imx_spi_dev_t *to_imx_spi_slave(struct spi_slave *slave)
{
return container_of(slave, struct imx_spi_dev_t, slave);
}
-static s32 spi_get_cfg(struct imx_spi_dev_t *dev)
-{
- switch (dev->slave.cs) {
- case 0:
- /* cpld */
- dev->base = CSPI1_BASE;
- dev->freq = 25000000;
- dev->ss_pol = IMX_SPI_ACTIVE_LOW;
- dev->ss = 0;
- dev->fifo_sz = 32;
- dev->us_delay = 0;
- break;
- default:
- printf("Invalid Bus ID! \n");
- break;
- }
-
- return 0;
-}
-
static s32 spi_reset(struct spi_slave *slave)
{
u32 clk_src = mxc_get_clock(MXC_CSPI_CLK);
diff --git a/drivers/spi/imx_ecspi.c b/drivers/spi/imx_ecspi.c
index d9345da..1e86cf1 100644
--- a/drivers/spi/imx_ecspi.c
+++ b/drivers/spi/imx_ecspi.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -53,40 +53,13 @@ static void memdump(const void *pv, int num)
#endif /* DEBUG */
+extern s32 spi_get_cfg(struct imx_spi_dev_t *dev);
+
static inline struct imx_spi_dev_t *to_imx_spi_slave(struct spi_slave *slave)
{
return container_of(slave, struct imx_spi_dev_t, slave);
}
-static s32 spi_get_cfg(struct imx_spi_dev_t *dev)
-{
- switch (dev->slave.cs) {
- case 0:
- /* pmic */
- dev->base = CSPI1_BASE_ADDR;
- dev->freq = 2500000;
- dev->ss_pol = IMX_SPI_ACTIVE_HIGH;
- dev->ss = 0;
- dev->fifo_sz = 64 * 4;
- dev->us_delay = 0;
- break;
- case 1:
- /* spi_nor */
- dev->base = CSPI1_BASE_ADDR;
- dev->freq = 2500000;
- dev->ss_pol = IMX_SPI_ACTIVE_LOW;
- dev->ss = 1;
- dev->fifo_sz = 64 * 4;
- dev->us_delay = 0;
- break;
- default:
- printf("Invalid Bus ID! \n");
- break;
- }
-
- return 0;
-}
-
static s32 spi_reset(struct spi_slave *slave)
{
u32 clk_src = mxc_get_clock(MXC_CSPI_CLK);