From patchwork Fri Nov 27 23:16:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7715751 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 52C4BBEEE1 for ; Fri, 27 Nov 2015 23:18:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 785EF2067A for ; Fri, 27 Nov 2015 23:18:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D66220676 for ; Fri, 27 Nov 2015 23:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750774AbbK0XRC (ORCPT ); Fri, 27 Nov 2015 18:17:02 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:34989 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbbK0XQO (ORCPT ); Fri, 27 Nov 2015 18:16:14 -0500 Received: by lfdl133 with SMTP id l133so141783623lfd.2; Fri, 27 Nov 2015 15:16:12 -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=iH735ho9OWrdEywjHcVfV3vPqhgbf+Vqm9E9ZW1teyA=; b=ym01Vj5bSvTchycq9fJeaQt2sqyRO/uX+nq9E6hJn/pEmxI3S6JfjSf3+qQ4GzJ5qw zhBF9wAuvWIpQ5gUhN0QiaOVHGgyRZ/3BZJo1wBygJAaDOchvsLgtyaYY2tCKvr0HURu QP1TnOtwDLbMROmGpREQVMbXUwDzelO0vaCx0FfssDEeOs7fffET6lWJV6H01W8yIKnM kUpSI3lm9CeHcLz+yifTc1SSjutMNLy9ILLBXr6LU+o6s8na5i9fQl92XQVAxeSCursi 7nYxA04HWq1QThAAkc2oJ/CnJYBlXfKeqL/hsQDd7pQe82uIGX7nH2uesxc822jKf3yr 5dbw== X-Received: by 10.112.159.202 with SMTP id xe10mr15585605lbb.122.1448666172838; Fri, 27 Nov 2015 15:16:12 -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 ru9sm254625lbb.3.2015.11.27.15.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Nov 2015 15:16:12 -0800 (PST) From: Anton Bondarenko To: broonie@kernel.org, b38343@freescale.com, s.hauer@pengutronix.de 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 Subject: [PATCH v4 4/7] spi: imx: add function to check for IMX51 family controller Date: Sat, 28 Nov 2015 00:16:02 +0100 Message-Id: <1448666165-7473-5-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448666165-7473-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1448666165-7473-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 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 740583a..4cd8550 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) \ @@ -1321,7 +1326,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");