From patchwork Sat Dec 5 16:57: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: 7775791 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 44D1BBEEE1 for ; Sat, 5 Dec 2015 16:59:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7242F204F6 for ; Sat, 5 Dec 2015 16:59:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96162204D9 for ; Sat, 5 Dec 2015 16:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754191AbbLEQ5T (ORCPT ); Sat, 5 Dec 2015 11:57:19 -0500 Received: from mail-lf0-f49.google.com ([209.85.215.49]:35727 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754382AbbLEQ5R (ORCPT ); Sat, 5 Dec 2015 11:57:17 -0500 Received: by lfdl133 with SMTP id l133so129241955lfd.2; Sat, 05 Dec 2015 08:57:16 -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=2huU384pG2x99VnF1ggEOXr7ZgVzdumLvCy6fG5cqSM=; b=vQ372Hy35FNRAxYDwm2pj5WaNiUic9S8Ygw8s878JT65BOmF43zKyBllfBTfJak+P3 4JWjgMGQgAHq6exVcR2QblT6hOOCFGCYxsvFvLDEEUP57kduiIFNgq/SMcAriF+ekENv XxcNP4hsiVAKlP3LxkZCu3+pj/U+uX5/rSnvz+lXYzKoAZjGqAttPWBfTZ5L2TGvVBvh H4cBftcV42Krm5wt0FN6iPppJ7nDQYf3wMvMAAXDtm7K86Chncv1iP0tjR1eMro3SQD1 0uGTI3LLuiiSOSPVblaWy4ll8MQv8nlgYXVupC8Ciy0LDsIbfMlJ2QVvKMJ58dbDcsp8 omzg== X-Received: by 10.25.85.200 with SMTP id j191mr10348435lfb.131.1449334636262; Sat, 05 Dec 2015 08:57:16 -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 tv8sm164546lbb.27.2015.12.05.08.57.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Dec 2015 08:57:15 -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 v5 04/11] spi: imx: add function to check for IMX51 family controller Date: Sat, 5 Dec 2015 17:57:02 +0100 Message-Id: <1449334629-4715-5-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449334629-4715-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1449334629-4715-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. It includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index f811f68..363276d 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) 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) \ @@ -1199,8 +1204,8 @@ 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 - && spi_imx_sdma_init(&pdev->dev, spi_imx, master, res)) + if (is_imx51_ecspi(spi_imx) && + spi_imx_sdma_init(&pdev->dev, spi_imx, master, res)) dev_err(&pdev->dev, "dma setup error,use pio instead\n"); spi_imx->devtype_data->reset(spi_imx);