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: 7532181 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D798BEEA4 for ; Sun, 1 Nov 2015 14:42:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9D52206CD for ; Sun, 1 Nov 2015 14:42:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8E6B206A7 for ; Sun, 1 Nov 2015 14:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751895AbbKAOm3 (ORCPT ); Sun, 1 Nov 2015 09:42:29 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:34947 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684AbbKAOlt (ORCPT ); Sun, 1 Nov 2015 09:41:49 -0500 Received: by lfbn126 with SMTP id n126so51926637lfb.2; 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 Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir_zapolskiy@mentor.com, jiada_wang@mentor.com, s.hauer@pengutronix.de 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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");