From patchwork Sun Nov 1 14:41:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7532331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B6AA59F2F7 for ; Sun, 1 Nov 2015 14:44:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E85A7206A7 for ; Sun, 1 Nov 2015 14:44:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5781206CD for ; Sun, 1 Nov 2015 14:44:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZstqT-00060i-K0; Sun, 01 Nov 2015 14:42:57 +0000 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zstph-0005k2-Lf for linux-arm-kernel@lists.infradead.org; Sun, 01 Nov 2015 14:42:11 +0000 Received: by lffz202 with SMTP id z202so52233585lff.3 for ; Sun, 01 Nov 2015 06:41:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9L0/DArQBpwTKpoyvXjJCfnqxXRMO0TWp/tebovfAH8=; b=QulRRb354lnA+l7bMOfO1AfNHZM3DLaSYQrHNESsP+SIqpplgNxWK66SS1rvyUdpC7 KkZ/DsIs24o39Zm9UIEpDP3SRKYpRY1s4xUlKvpiRioytGy2CZrO1tTyW9Dd9v1hp8qU pGsFdnh1l+NVOXhXMjCfeFZihJlqASAhPXuiqfYr+dq1qB2jmWGRZ/UeZ1srPdq0jYsc HSwQgwl8A+nbkYvbH0WlTV1OC3Br/HtelQWlGUDiwJMxkXAOwc9dFRIHP1crhzficK7L GBT/wianK8niPwO3hBJmQSPbGv0qVZePHueTceRSkkZpXEYbunR/A9zBJseDErBdKBBF Fp1g== X-Received: by 10.25.147.74 with SMTP id v71mr5352834lfd.102.1446388907708; Sun, 01 Nov 2015 06:41:47 -0800 (PST) Received: from localhost.localdomain (c-89-233-200-205.cust.bredband2.com. [89.233.200.205]) by smtp.gmail.com with ESMTPSA id oy8sm3091607lbb.39.2015.11.01.06.41.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Nov 2015 06:41:47 -0800 (PST) From: Anton Bondarenko To: broonie@kernel.org, b38343@freescale.com Subject: [PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller Date: Sun, 1 Nov 2015 15:41:38 +0100 Message-Id: <1446388901-6073-5-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1446388901-6073-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1446388901-6073-1-git-send-email-anton.bondarenko.sama@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151101_064210_097076_88A47FA8 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiada_wang@mentor.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir_zapolskiy@mentor.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anton Bondarenko Similar to other controller type checks add check function for IMX51. This also includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- 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");