From patchwork Mon Apr 2 20:06:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 894373 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=impinj.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ab8s5fXv"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=impinj.onmicrosoft.com header.i=@impinj.onmicrosoft.com header.b="Sk3wOz14"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40FNXp1Qrcz9s21 for ; Tue, 3 Apr 2018 06:06:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JL/nILM/9rUAuP5zh233186D7FWX7YmxLOs3XVIonUg=; b=Ab8s5fXvQSuJsS vEbSEqqNLDVQlVN7ojWyi2aUa5wf5R0Q/XwT8xLdAajExmPAYuKDggVkJDC9kdTjzrDTxx2V+TUN5 B52S8rvKChKjH3DVi91rs/uHax16FCdDDS3kRow5kTNCRy9frbcQYGITjpL6g6biUU/qVgonbEqIR r+ivIwxS50u3/q9hVFtQZEq3urC838N9WV8d5nojSFYcJPqfTkCCU7mpvOiseU0dzqjRDGmgppiyj 63fDQ2fepxbCoTZN8+XA9m2EHI4ENme0NcNdUkoEc4WJ4voSF+gcnzmMfEa2zTgzZrgjaMi4YBSEA bYGvkGnys4RtZizljZJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f35j4-00056g-NC; Mon, 02 Apr 2018 20:06:46 +0000 Received: from mail-cys01nam02on0728.outbound.protection.outlook.com ([2a01:111:f400:fe45::728] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f35iz-00054F-Vw for linux-arm-kernel@lists.infradead.org; Mon, 02 Apr 2018 20:06:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=impinj.onmicrosoft.com; s=selector1-impinj-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LaOwlMFw0ENMk0e4Cjv13hxPchhq+i93tWz6i5L6oBI=; b=Sk3wOz14p0cDrkwPKEwpOONBmEILH7+MGuuY/gDYKfNrbgH5ORQLqPAooWTSWidTqjv9jHfZXCHR2AAeDWAH42M2/yVMBxkiWJubV0YL1/yEkaRChR9u3VvLbXq3hfvzuS5UcQf2TsL6aH5Sq+qsQegQJfnWqjRRNfiwHmy06G4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; Received: from impinj.com (216.207.205.253) by SN4PR0601MB3757.namprd06.prod.outlook.com (2603:10b6:803:4c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Mon, 2 Apr 2018 20:06:28 +0000 From: Trent Piepho To: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5] ARM: imx: Update spi_imx platform data to reflect current state Date: Mon, 2 Apr 2018 13:06:05 -0700 Message-Id: <20180402200605.13050-1-tpiepho@impinj.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [216.207.205.253] X-ClientProxiedBy: MWHPR08CA0039.namprd08.prod.outlook.com (2603:10b6:300:c0::13) To SN4PR0601MB3757.namprd06.prod.outlook.com (2603:10b6:803:4c::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a0114bf-3550-493c-9317-08d598d538a6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN4PR0601MB3757; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0601MB3757; 3:MJMDXW22yXj6gFdD/JS7hnVuj1fkWu9ntDmeV3kSvLTWQVPac9ZmIAzXugEhFExoxGB/mXQxRj2XGxYVGxhL9NaMzm246+ycTd0lbOfjz8sIxfAxk7CL2/M5UTv75PywYx2CosX+uCbD1sPE1cLsX6BRGhQ2gT9AV8Bc/R1ZNuaM0SLQ+Na+J7FF8F52ee9PN/39DpsRu3rrDlLkTYVliGkhR/Wasaikq+kl2TbUzQpgK4MctguA4+SrpKbkWoDH; 25:tBYZbMlUNwqRSQjme6VZdggom7dYFLCRarG8ogkJJQg8lnZ+QEB6LztY8jKOaZPlDLo9hm/ZBwWAONJylXb9IOC+KMiOm2hCkjEzb08stfMyXTO8JbtrwlcvF4JIktf1Ql0IT1EWXNgufYhsoMpunZqn62KZfU8w0uDKOHq01Pvse2JDuA6LaLfGmoB75yYg+8ajCpEfI6bedjs6VOAKvPReLiOqAL+u09U1Ypr8jHk/mkhAxXspSdIPvIp14w2vljO3f9wXTGNyJLSJVG6myUR/I3wZ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IDW7lg3iJbpB+T9c9uTAZSvhyOlR1tbCL6ZUrEw9vMRgfZ4I/WKODSwLN7USGgErxnJkEGaRNl6j/unHIwA1NBIYXdyKdOn1uAiUgvmeXd64n89fpLtd5BARib21 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231221)(944501327)(52105095)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:SN4PR0601MB3757; BCL:0; PCL:0; RULEID:; SRVR:SN4PR0601MB3757; X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(366004)(396003)(376002)(39380400002)(39840400004)(199004)(189003)(81166006)(48376002)(50466002)(55016002)(105586002)(81156014)(8676002)(47776003)(3846002)(6116002)(478600001)(68736007)(7736002)(305945005)(8936002)(53936002)(2906002)(86362001)(50226002)(1076002)(106356001)(66066001)(4326008)(21086003)(386003)(25786009)(69596002)(186003)(97736004)(8656006)(51416003)(59450400001)(956004)(26005)(316002)(54906003)(2616005)(486005)(16526019)(52116002)(7696005)(6666003)(15650500001)(476003)(486005)(36756003)(5660300001)(16586007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN4PR0601MB3757; H:impinj.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: impinj.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR0601MB3757; 23:Me5v8RFfiA1g1b8M8VNimcD+0qRO+jrkxiS56/c?= bogsDS7fdOJtwHcXd3XA7aW1QhYL5wuusR38radtLQOqwpS2rQT4qOoRSjMU92hBZMExIxcbjf6W8hmAKKYIP/dG9+lQ0zf7413+zu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adata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN4PR0601MB3757; 7:wYilvxs0Ncntzh6/ggGs0XQIvUMpss9429ZoioqaYyvlVXFLXOSlDnZsMmBsgKYJg2uLCZ3nwEjo5RLxKkNGOfwXk9FRcAwvDndxDBauQRkM8HzjRZ7vTtRBvOwnqUuenOpK4hw0BUlVkv2wzBOG9bhA63GlO3XPeh3QhOK66jlthG4Vr8xkrRWcgtR9BNnGsdQlhvyyKZvJEXcNUsmIK6XWAHtwMBCoBsyjspL4uKC1Zg1b/YzGtWNKo4O0O5DO X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2018 20:06:28.4471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a0114bf-3550-493c-9317-08d598d538a6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0601MB3757 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180402_130642_208311_9F735D4E X-CRM114-Status: GOOD ( 15.55 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a01:111:f400:fe45:0:0:0:728 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabio Estevam , Shawn Guo , Sascha Hauer , Trent Piepho Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The docs for the spi_imx platform data still refer to a -32 offset used to specify a native chip select. This was removed in commit 602c8f4485cd ("spi: imx: fix use of native chip-selects with devicetree") and no longer works as documented. Update documentation. The macro MXC_SPI_CS() is no longer is needed. If a board uses all native chip selects, then it's not necessary to specify a chip select array at all, as all native is the default (this is how device-tree configured SPI masters work too). Most of the spi-imx platform data users have their chip select arrays removed by this patch. This patch also fixes a bug in mx31moboard introduced in the '602 commit. When that board was updated in commit 901f26bce64a ("ARM: imx: set correct chip_select in platform setup") to reflect the SPI change, only SPI bus 2 was updated and SPI bus 1 was left with non-sequential chip selects. The mc13783 spi device on bus 1 had its chip select updated as if it were on bus 2. CC: Shawn Guo CC: Sascha Hauer CC: Fabio Estevam Acked-by: Greg Ungerer Reviewed-by: Oleksij Rempel Signed-off-by: Trent Piepho --- Changes from v4: Ported to current linux-next with no changes. This patch no longer has any dependencies that are not applied in v4.15 arch/arm/mach-imx/mach-mx31_3ds.c | 18 ++---------------- arch/arm/mach-imx/mach-mx31lilly.c | 12 ++---------- arch/arm/mach-imx/mach-mx31lite.c | 16 ++-------------- arch/arm/mach-imx/mach-mx31moboard.c | 17 +++-------------- arch/arm/mach-imx/mach-pcm037_eet.c | 5 +---- include/linux/platform_data/spi-imx.h | 29 +++++++++++++++++------------ 6 files changed, 27 insertions(+), 70 deletions(-) diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 68c3f0799d5b..9d87f1dcf7bb 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c @@ -374,26 +374,12 @@ static struct imx_ssi_platform_data mx31_3ds_ssi_pdata = { }; /* SPI */ -static int spi0_internal_chipselect[] = { - MXC_SPI_CS(0), - MXC_SPI_CS(1), - MXC_SPI_CS(2), -}; - static const struct spi_imx_master spi0_pdata __initconst = { - .chipselect = spi0_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi0_internal_chipselect), -}; - -static int spi1_internal_chipselect[] = { - MXC_SPI_CS(0), - MXC_SPI_CS(1), - MXC_SPI_CS(2), + .num_chipselect = 3, }; static const struct spi_imx_master spi1_pdata __initconst = { - .chipselect = spi1_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi1_internal_chipselect), + .num_chipselect = 3, }; static struct spi_board_info mx31_3ds_spi_devs[] __initdata = { diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c index 6fd463642954..8bf52819d4d9 100644 --- a/arch/arm/mach-imx/mach-mx31lilly.c +++ b/arch/arm/mach-imx/mach-mx31lilly.c @@ -226,20 +226,12 @@ static void __init lilly1131_usb_init(void) /* SPI */ -static int spi_internal_chipselect[] = { - MXC_SPI_CS(0), - MXC_SPI_CS(1), - MXC_SPI_CS(2), -}; - static const struct spi_imx_master spi0_pdata __initconst = { - .chipselect = spi_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), + .num_chipselect = 3, }; static const struct spi_imx_master spi1_pdata __initconst = { - .chipselect = spi_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), + .num_chipselect = 3, }; static struct mc13xxx_platform_data mc13783_pdata __initdata = { diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index a3250bc7f114..a3cbba6c955b 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c @@ -83,15 +83,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = { }; /* SPI */ -static int spi0_internal_chipselect[] = { - MXC_SPI_CS(0), - MXC_SPI_CS(1), - MXC_SPI_CS(2), -}; - static const struct spi_imx_master spi0_pdata __initconst = { - .chipselect = spi0_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi0_internal_chipselect), + .num_chipselect = 3, }; static const struct mxc_nand_platform_data @@ -133,13 +126,8 @@ static struct platform_device smsc911x_device = { * The MC13783 is the only hard-wired SPI device on the module. */ -static int spi1_internal_chipselect[] = { - MXC_SPI_CS(0), -}; - static const struct spi_imx_master spi1_pdata __initconst = { - .chipselect = spi1_internal_chipselect, - .num_chipselect = ARRAY_SIZE(spi1_internal_chipselect), + .num_chipselect = 1, }; static struct mc13xxx_platform_data mc13783_pdata __initdata = { diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 7716f83aecdd..643a3d749703 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c @@ -152,14 +152,8 @@ static const struct imxi2c_platform_data moboard_i2c1_data __initconst = { .bitrate = 100000, }; -static int moboard_spi1_cs[] = { - MXC_SPI_CS(0), - MXC_SPI_CS(2), -}; - static const struct spi_imx_master moboard_spi1_pdata __initconst = { - .chipselect = moboard_spi1_cs, - .num_chipselect = ARRAY_SIZE(moboard_spi1_cs), + .num_chipselect = 3, }; static struct regulator_consumer_supply sdhc_consumers[] = { @@ -296,19 +290,14 @@ static struct spi_board_info moboard_spi_board_info[] __initdata = { /* irq number is run-time assigned */ .max_speed_hz = 300000, .bus_num = 1, - .chip_select = 1, + .chip_select = 0, .platform_data = &moboard_pmic, .mode = SPI_CS_HIGH, }, }; -static int moboard_spi2_cs[] = { - MXC_SPI_CS(0), MXC_SPI_CS(1), -}; - static const struct spi_imx_master moboard_spi2_pdata __initconst = { - .chipselect = moboard_spi2_cs, - .num_chipselect = ARRAY_SIZE(moboard_spi2_cs), + .num_chipselect = 2, }; #define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0) diff --git a/arch/arm/mach-imx/mach-pcm037_eet.c b/arch/arm/mach-imx/mach-pcm037_eet.c index 95bd97710494..15bc956d466b 100644 --- a/arch/arm/mach-imx/mach-pcm037_eet.c +++ b/arch/arm/mach-imx/mach-pcm037_eet.c @@ -56,11 +56,8 @@ static struct spi_board_info pcm037_spi_dev[] = { }; /* Platform Data for MXC CSPI */ -static int pcm037_spi1_cs[] = { MXC_SPI_CS(0), MXC_SPI_CS(1), }; - static const struct spi_imx_master pcm037_spi1_pdata __initconst = { - .chipselect = pcm037_spi1_cs, - .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), + .num_chipselect = 2, }; /* GPIO-keys input device */ diff --git a/include/linux/platform_data/spi-imx.h b/include/linux/platform_data/spi-imx.h index 6f012fefa1a2..328f670d10bd 100644 --- a/include/linux/platform_data/spi-imx.h +++ b/include/linux/platform_data/spi-imx.h @@ -5,24 +5,29 @@ /* * struct spi_imx_master - device.platform_data for SPI controller devices. - * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio - * pins, numbers < 0 mean internal CSPI chipselects according - * to MXC_SPI_CS(). Normally you want to use gpio based chip - * selects as the CSPI module tries to be intelligent about - * when to assert the chipselect: The CSPI module deasserts the - * chipselect once it runs out of input data. The other problem - * is that it is not possible to mix between high active and low - * active chipselects on one single bus using the internal - * chipselects. Unfortunately Freescale decided to put some + * @chipselect: Array of chipselects for this master or NULL. Numbers >= 0 + * mean GPIO pins, -ENOENT means internal CSPI chipselect + * matching the position in the array. E.g., if chipselect[1] = + * -ENOENT then a SPI slave using chip select 1 will use the + * native SS1 line of the CSPI. Omitting the array will use + * all native chip selects. + + * Normally you want to use gpio based chip selects as the CSPI + * module tries to be intelligent about when to assert the + * chipselect: The CSPI module deasserts the chipselect once it + * runs out of input data. The other problem is that it is not + * possible to mix between high active and low active chipselects + * on one single bus using the internal chipselects. + * Unfortunately, on some SoCs, Freescale decided to put some * chipselects on dedicated pins which are not usable as gpios, * so we have to support the internal chipselects. - * @num_chipselect: ARRAY_SIZE(chipselect) + * + * @num_chipselect: If @chipselect is specified, ARRAY_SIZE(chipselect), + * otherwise the number of native chip selects. */ struct spi_imx_master { int *chipselect; int num_chipselect; }; -#define MXC_SPI_CS(no) ((no) - 32) - #endif /* __MACH_SPI_H_*/