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: 10320367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9242860247 for ; Mon, 2 Apr 2018 20:06:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7449B289BC for ; Mon, 2 Apr 2018 20:06:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 649B928A71; Mon, 2 Apr 2018 20:06:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 322EB289BC for ; Mon, 2 Apr 2018 20:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755082AbeDBUGb (ORCPT ); Mon, 2 Apr 2018 16:06:31 -0400 Received: from mail-cys01nam02on0102.outbound.protection.outlook.com ([104.47.37.102]:4360 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753109AbeDBUGa (ORCPT ); Mon, 2 Apr 2018 16:06:30 -0400 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 Cc: Trent Piepho , Shawn Guo , Sascha Hauer , Fabio Estevam 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/I3wZXzW184Z7C7cY1+Rfv7auDLZYFN82UPmBk/uNXV5vbdKw6H/4Ft1iI5HofQ==; 31:d9PayLJWjAo0X30qQd8sb7/a3iBmv7xBxrSVhglKgx0ycxPq+uE/x0LcxRAhLWO7qay5IryrwnGVH3oxsTGGqVDVWNk2Nuuuw++eQMtNluKa/WLihF3UY3d4delkT3THmZrq5vQIMSJ6+++94k4rL3M3DINwh5LiUQidfICO5KYIa38JElYvg0uxDz54lS1QPYLQAm26zFT6Dmi3NbTqF7BdHaOpo57pUmkf7mEC0R0= X-MS-TrafficTypeDiagnostic: SN4PR0601MB3757: X-Microsoft-Exchange-Diagnostics: 1; SN4PR0601MB3757; 20:mVR/azQlJcYWjRPSoyqcB7ALMgrqEnNQTIaeWO1e9QPwRZzWVd6AxcEkY7CR8+fcqKybp5bi8InjzJ4pRagVsOujgDp8MwyhtstOWhdbz49ZfsayShSB9i8oZCG0/tW4cdzHFA5HyOlQjrhCqVnlb8ocjb19cEsY4F/A0lb5bgjEm12DsIcABC9cYIJq8/Np4wX+rYKrR6fj4WkwtAmw6YsloAXGS6ariG1SbDDz+J7KTppUt/di5yHzkQ6y1ARG98Dh/y5A4EFw3wE0fy9dMcZZL11JSsAuiAiB4ryr+JvHNuty3GDUPz+659whsTWFZ+szQcZTEbHwj3TjQO8FW8WQEKRkxA3YOIrVCQ3RPRStFRUka/vwUyZvDyXJNeUYbKnbwE76r2bARe46/nPr/SKyMqQKphnvTNbEwzTMx19bZvnKk1kcd1JJ79EM9f0kox9wCxljUeQmsIBnkM63sGzsz0RDJGZTdN8lFjyRpbKsAoVaNXJkWcYa6b9a7OH4; 4:4WgDa2V7ZFKRGdVosNsoFZsPGR2nz4anZQleuHtJqpoaM29J9ICc7NluRic2SsBgVbtEuXfbpKkZsMiZTn/J+4cmD1bRH0YBzS4J799UMnOs4m3FrM3t4gA+6eHdmBMxbWkSgyIx1U/t9/DtGVY7Nr65kN554Cgplud6h5xeb3dfQY8RXpqd2oF9zZXD9mqfZXhAIDW7lg3iJbpB+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?= =?us-ascii?Q?bogsDS7fdOJtwHcXd3XA7aW1QhYL5wuusR38radtLQOqwpS2rQT4qOoRSjMU?= =?us-ascii?Q?92hBZMExIxcbjf6W8hmAKKYIP/dG9+lQ0zf7413+zuohSE3NEAuI8KVLLRCk?= =?us-ascii?Q?V9NMkN7+6WgZm1P/hEpfZZ3yivb725TybZ2SeiVZkeVMaYNlyXPDdhHorU7A?= =?us-ascii?Q?rvbWp50uieitF8krBF3j1d5YybXltKT4ENoaU3vDogx7veV33Gvii5gJ/GGz?= =?us-ascii?Q?TsY0f4kxXYBhvhHeyQ9nzd3thWxHuzTbKP3pdeGCG4loUf22K6qq2CfIr29i?= =?us-ascii?Q?W5y0b76x0pvv9QzSVlwaALNsRqL2SLqLwxed+Lp3WHwcdN2oid3ZExAHR3J3?= =?us-ascii?Q?UmVd6qNwC5o2QAHXkCT37WZwjPva/sOxmxV3P0KZzkf7fFjBDdAQnL5VT3ke?= =?us-ascii?Q?qKZsUv1sDgCKHJY9oIMTF6VRa6w7090LETSz7kxQNCpTfd+KRWLEy3Yyf8oT?= =?us-ascii?Q?OQDw8nEUVMEVxOG0Yr6AOIJPjB3qxjzjkYJC/nEpq+7cj1ESjjm8lCF1rEAb?= =?us-ascii?Q?U2x1MNh6/Gt6IpiXCU7LFuiatCoXOoSCZbrGr5CyzTVihlOQ7i95ib43qMgK?= =?us-ascii?Q?joEEBjPbNllJst/4satjvzEgAhid4LZDesRn/3O3ZN0fCIninFkiOIEOStWg?= =?us-ascii?Q?Il1qvH8cAk14GC4cuh6PHZUDNJQhmgEar3tDPCN3rMROqeay+01ktZuqTQVh?= =?us-ascii?Q?X1hr0L8mnpEQEUfHTO26YPhwFv3sfQp09GtTqQ4be7JngVeKu6WnEbfMKfWg?= =?us-ascii?Q?GOU13+dXSmzNmcloaD6kEQ6eAWGnZnfze5C4dUPdp3ffb1xF9KG0vAwel3Yd?= =?us-ascii?Q?3uyVVRfa4stOFNsb0yL36bXeKLL7ldOiijrwdxJI/yHFb+je/wray66SMb4a?= =?us-ascii?Q?kMv9qABljZUb81+1/hw/+ozXr5bknxBCMEE6I1e5PUhC8rOK4TJWYeQ22QmZ?= =?us-ascii?Q?dX+Ol33hvqMgeLzoGu+4g+Bl0lz3fSSYs79HMxGKu6HJFbfJd3kzaKYDzd/l?= =?us-ascii?Q?uXqGUH/QNcCWtwUzl0/V+vn+s/F0cxeFflzWzXMZAZsHz+FqUg9vYsktsnL5?= =?us-ascii?Q?7pKchvlkVL25oKL89CcHao99WYdjbgWywdWS6trbE8HMR3Sy1f7r0iMfRGTJ?= =?us-ascii?Q?8d74J+xR059aNqRKfFdJVPmwFzIWlZU9ZU1TNh0+YxCkF1nVopA+djgDrK1/?= =?us-ascii?Q?+U7y39gpPLDKKlOjyYao=3D?= X-Microsoft-Antispam-Message-Info: 2uMUuX1b7nn90HotV3VN7bDcojjqnaimRUyWW9eVYIKPYwc74OUq4T/7kG+Z17Z6cQlQD2mOwqU8sAUk3Z0QI8xQsq/Mu44hfldUFdiUGg72DAONoJpHoPF/BJCEFpgYxTxBgwb3J7FNAupVF98fygNrWjwNQI9eq0TuUKaWi4GDvf/TNJftzKaHsIiDDeCe X-Microsoft-Exchange-Diagnostics: 1; SN4PR0601MB3757; 6:ebubFu+Ji+wx4epWUydWssMIZvnrCfLexHmSF62V8Q5fUesVsEjvvlZ9JUKhjZUB4W3eQ9jnSbci/e9i+2kfPQ9vtHhUIp3WSxOCKAvMAkqxJ+jbkuGSK4tZX1u7JUoJoqUcnIPRqoA1OUZzUoKTkB1bgfyoXaGHlK9kOcYL+tdlELTCgs5CapredDpiSLKwT6RVDj9agpHIAqesHF6X1Qu1T17bKdlT8nk8uBnqf0a8wE7xnA42oPHIyEEPYhjCf1M8wNUv4w6rrf+Zc6Jd8HCkz2ceGMT70eSVn+OVlfo4hdz724LHdjHCBb5YK8fjAGjTkoPXFXnq3TrEV6ta0q1X0H6Zhd4QdIBTJCMV14YSbdXv+mM7Id7EKPGQts9jbIDw8kvCWo+O8lLA66UzW3n+m7VZJLZAzGyPQuNkFAeol7vStQUDvpHKmz1XQGdd8lDHC1cX5aShUd6ViygLcA==; 5:NLx+wvP22sHADgPkzPMaSah+W3eprymfuB4tDdVMq9LphuLCYgMPeBfYtl/uKJSYiz4gH8C3W7t9UvbPhUpAgo4k6wYzduTij4VUkOuwxS7Wh2BvoHKern6z/9ujhRId9sWOgPDWLs7Dn2kWAH5T7Kg8oByYSToQ9xZkX8b2D6U=; 24:FacTv4iiFjaJ5C38jvf0UYNagr/MXk2NezSwlhcfrgGaaESPvC9gW4e33VkVaEjvRWhGxUTQ9Q9ogI/hjWX8932EJITJSF3yuJ+CDPpxfEc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: 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 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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_*/