aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAnton Bondarenko <anton.bondarenko.sama@gmail.com>2015-12-05 11:57:02 -0500
committerMark Brown <broonie@kernel.org>2015-12-07 14:53:35 -0500
commitf8a876176f38e00aab200d308506ca4a4ba57b39 (patch)
tree246a59bbc7269205e8c33eb35b7c8cebd1729796 /drivers/spi
parent0dfbaa8932a6c4ffd83a6459f247bf06b4652543 (diff)
spi: imx: add function to check for IMX51 family controller
Similar to other controller type checks add check function for IMX51. It includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-imx.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index beba40b08ed1..410522fdd4c9 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -122,9 +122,14 @@ static inline int is_imx35_cspi(struct spi_imx_data *d)
122 return d->devtype_data->devtype == IMX35_CSPI; 122 return d->devtype_data->devtype == IMX35_CSPI;
123} 123}
124 124
125static inline int is_imx51_ecspi(struct spi_imx_data *d)
126{
127 return d->devtype_data->devtype == IMX51_ECSPI;
128}
129
125static inline unsigned spi_imx_get_fifosize(struct spi_imx_data *d) 130static inline unsigned spi_imx_get_fifosize(struct spi_imx_data *d)
126{ 131{
127 return (d->devtype_data->devtype == IMX51_ECSPI) ? 64 : 8; 132 return is_imx51_ecspi(d) ? 64 : 8;
128} 133}
129 134
130#define MXC_SPI_BUF_RX(type) \ 135#define MXC_SPI_BUF_RX(type) \
@@ -1210,8 +1215,8 @@ static int spi_imx_probe(struct platform_device *pdev)
1210 * Only validated on i.mx6 now, can remove the constrain if validated on 1215 * Only validated on i.mx6 now, can remove the constrain if validated on
1211 * other chips. 1216 * other chips.
1212 */ 1217 */
1213 if (spi_imx->devtype_data == &imx51_ecspi_devtype_data 1218 if (is_imx51_ecspi(spi_imx) &&
1214 && spi_imx_sdma_init(&pdev->dev, spi_imx, master, res)) 1219 spi_imx_sdma_init(&pdev->dev, spi_imx, master, res))
1215 dev_err(&pdev->dev, "dma setup error,use pio instead\n"); 1220 dev_err(&pdev->dev, "dma setup error,use pio instead\n");
1216 1221
1217 spi_imx->devtype_data->reset(spi_imx); 1222 spi_imx->devtype_data->reset(spi_imx);