Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1260175

[PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller

From Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller
Date 2015-11-01 15:50 +0100
Message-ID <qq27f-166-7@gated-at.bofh.it> (permalink)
References <qq27f-166-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Anton Bondarenko <anton_bondarenko@mentor.com>

Similar to other controller type checks add check function for
IMX51. This also includes IMX53 and IMX6.

Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com>
---
 drivers/spi/spi-imx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 06f52c3..48fdfa1 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -127,9 +127,14 @@ static inline int is_imx35_cspi(struct spi_imx_data *d)
 	return d->devtype_data->devtype == IMX35_CSPI;
 }
 
+static inline int is_imx51_ecspi(struct spi_imx_data *d)
+{
+	return d->devtype_data->devtype == IMX51_ECSPI;
+}
+
 static inline unsigned spi_imx_get_fifosize(struct spi_imx_data *d)
 {
-	return (d->devtype_data->devtype == IMX51_ECSPI) ? 64 : 8;
+	return is_imx51_ecspi(d) ? 64 : 8;
 }
 
 #define MXC_SPI_BUF_RX(type)						\
@@ -1334,7 +1339,7 @@ static int spi_imx_probe(struct platform_device *pdev)
 	 * Only validated on i.mx6 now, can remove the constrain if validated on
 	 * other chips.
 	 */
-	if (spi_imx->devtype_data == &imx51_ecspi_devtype_data &&
+	if (is_imx51_ecspi(spi_imx) &&
 	    spi_imx_sdma_init(&pdev->dev, spi_imx, master))
 		dev_err(&pdev->dev, "dma setup error,use pio instead\n");
 
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/7] Improvements for SPI IMX driver for Freescale IMX51, IMX53 and IMX6 Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
  [PATCH v3 5/7] spi: imx: Add support for loopback for ECSPI controllers Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 5/7] spi: imx: Add support for loopback for ECSPI  controllers Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
  [PATCH v3 6/7] spi: imx: return error from dma channel request Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 6/7] spi: imx: return error from dma channel request Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-05 10:00 +0100
      Re: [PATCH v3 6/7] spi: imx: return error from dma channel request Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-05 17:10 +0100
        Re: [PATCH v3 6/7] spi: imx: return error from dma channel request Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
        Re: [PATCH v3 6/7] spi: imx: return error from dma channel request Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
  [PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 4/7] spi: imx: add function to check for IMX51 family  controller Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
  [PATCH v3 3/7] spi: imx: add support for all SPI word width for DMA transfer Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
  [PATCH v3 1/7] spi: imx: Fix DMA transfer Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-04 22:10 +0100
    Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-05 09:40 +0100
      Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-05 18:00 +0100
        Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
  [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine is pending Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine  is pending Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-05 10:00 +0100
      Re: [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine  is pending Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-05 17:20 +0100
        Re: [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine  is pending Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100
  [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated one Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-01 15:50 +0100
    Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated  one Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-05 09:50 +0100
      Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated  one Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-10 21:30 +0100
        Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated  one Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-11 09:20 +0100
          Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated  one Anton Bondarenko <anton.bondarenko.sama@gmail.com> - 2015-11-14 11:10 +0100

csiph-web