From patchwork Fri Oct 27 01:08:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 10028947 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 29ECB602D6 for ; Fri, 27 Oct 2017 01:11:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17BCA28E5D for ; Fri, 27 Oct 2017 01:11:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AEC828E8C; Fri, 27 Oct 2017 01:11:41 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 54BE528E5D for ; Fri, 27 Oct 2017 01:11:40 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=HObRuoAZpeye11AxvJtil7rTCFfFJHO1T0zB3TTGMlk=; b=LNMcr2CmV6zXJr uQaSzqf8aA+mHd/x9yB0ZG0MooUehN0mvF/rBlLl+OzYXWAt1caBzd8+et8XSvJDEn9hOE49sTeII R+OyJcF7I1s3QN6VT/CvzkVyDQY0M6RqWlfxjakM5Mjo/vg+VWkl92WDjoZyRwmIK6V036Rpz1NhO JN7uQJQH2YDzGAqIgxMtnCHNSoeR/STJQwY2Yy1gudrRMC66E9n6Y1N7ToEbKhMNblWnJN6Y7xCQK ZJYMKKRtFHJ5PyX0ZY6txS80zkR5iKrALDgAhFLwDj51etdkflxiAVeTPYVeOLIURlzO/Lz2rJWJA 7Es/V3s2R3eXDozJGddw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e7tBT-0007zm-Di; Fri, 27 Oct 2017 01:11:39 +0000 Received: from mail-by2nam03on0106.outbound.protection.outlook.com ([104.47.42.106] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e7t9z-0005Um-Q9 for linux-arm-kernel@lists.infradead.org; Fri, 27 Oct 2017 01:10:11 +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=OyP60RKjlYRuORf2Vl3CQQBwOWTmSG2xrcbXC61wgm4=; b=jj450jOA+wvnh8Sz8xgpOOUe+VNuDWleJGF8gN+kGUJJKwnTog8ukWK2aRxRQ0Spqui6n0ws8PRX2Qkih+iE2UATkngLQ2lfoc5TeFhhI/Y3SQuGlves3vDbu7jG7zRIwn9AIfK0o4nocdJikELGX2MNltklCxuK0uQMDMbysLg= Received: from impinj.com (216.243.31.162) by CY4PR06MB2805.namprd06.prod.outlook.com (10.175.117.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Fri, 27 Oct 2017 01:09:26 +0000 From: Trent Piepho To: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH v2 4/4] ARM: imx: Update spi_imx platform data to reflect current state Date: Thu, 26 Oct 2017 18:08:41 -0700 Message-Id: <20171027010841.28624-5-tpiepho@impinj.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171027010841.28624-1-tpiepho@impinj.com> References: <20171027010841.28624-1-tpiepho@impinj.com> MIME-Version: 1.0 X-Originating-IP: [216.243.31.162] X-ClientProxiedBy: MWHPR14CA0045.namprd14.prod.outlook.com (10.171.142.159) To CY4PR06MB2805.namprd06.prod.outlook.com (10.175.117.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 746e5694-45de-4867-0d86-08d51cd75e33 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603238); SRVR:CY4PR06MB2805; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2805; 3:GvLVYVAfQFsQCLBz8c8vuZNX045PUL8lzflpNFU5qLgaCnnkneKm66zOe3BN+pJRnIyw28qd/Sd6UW4KZIVXp741/I6RopRtUWIzvuJ+aXZIVAi8TnzpFGKlnJ73wpco+UFy8HdOEhlk3dlaJ1v3q9XoFGMbAroomhoImzB98Ik9f5kECvt9QtKTnMkRkzH9KiOcnT/rfdCKJu/5BBdf63USBjuQvvesyw44Wz5U/pnL3lEe9fLsNH6w7UlccmrO; 25:yY1S6pitgTTJQGkkcAXPN8HqZ0Tn8+65nR6WP5ukHwwQ4ALiB2QPh6unQsKwhGz81zz2Na1fGOxxU2hD+OtebBCc7ycymHTfkPDlD8E1QWDEx9qU2Z9sZQqN6jToeOo/gC9OhiufTQLfi1hPzZDwgSy0B416KvACGdmdoO14fvAH+12/Qiox4VlGfKQFqQ2U0kJjEOkfaokamy8T2MBEjs7DM3GjAxeNknihk3f7RiuFciTW8Jfr3Cvs770QTqhPJ/SBe+uAs1+i4N08NW/C+uoH97uWafitEszwmDXur9I1y2hX4y5vMO6whc6XbEuqVlapkS7GOfLpojoqsaqZDA==; 31:AoN/yDLtlIl4vZZz8K2IyjBeWIbf9HKJjZjFw+a+WvOe2T+JHJJuZTOGvh7uBR/TS5m37qaI6DFDRKwDHev+XCtnV1fTk0a+bP95GDMxSIrm4/ojBlVZ71Pg8ThR2gCQxUsPu+GuuN0nkLKYEa3G/8e4DfGXxpe0e3Bm5y9bArOpyzTVf5kwSpZEjsshI8pkufPKYpPYnQ1HPlfri13F9M3h69oNxBS67eG26mn5j3s= X-MS-TrafficTypeDiagnostic: CY4PR06MB2805: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2805; 20:wCIGJZq5xQHLcNf7NrnHi+4jByz4q3rLltdJDdVfx9TzLw/0NHuGAX5bwNzV9X11bc7bSmdaINuKppTprbh0zNuk1nuMlmsmEK3Ay2VsUI5AFvAmiKpcX7yRkoVSkVxMlLWkMsO/i6w+6L0EElFEgvdUs1qiEkxBLpu4vnKmuDkwJIEcfYfhb8g2VO7Vq+T80jMCGSlIDox+hzqn0J2gDtfmganwu4d+1d1og+uoRRo7tML4a7b2phSrC2RxV4m7KOIOqoGCvuya/9Qx18pTn/B9N2DnC8+tmT4VvT90VUkIPu+VD8sdv6ILzJCaJ2pd+7ZZBmflF8fzToEBGkg3NRgbBmq+vgYnZdXvCYcHn7qCjE5Mfs01DlptOo20korEZhvlBqRnCEVjQ1thWsoomqhY+EGyHFk+SQM/pOupEOnnzWDlLUNjDFuvwOtH0gAxysIhySSYp0oKjUZcxaUxuOsnkxpDdfb5Zpb9m5jbw2uYEhvdVM72a/d78iEe6ZHQ; 4:+1azSs6HRGbQi08B4qhAJDUEEsMmf7fEwbegca88/9hvcJis5L1bhoQCWbiz1m+LqazXneUaSFpGDkjHaVjxkvIBvAjpG5Egqp3wacy/GB26gbsq1+vD829OSHIz82JZvZ3GfqSMzXl5f7ZJukZHmDssY2nWz/83p2o3ipRMLKH4YmWfsrnrf/bkJ6lanovgn5BYVh6tgLKzNhV6ssnAX0FraSM0bt57wD4881eGW/WbVGt2a2abxGHY5TB/qkknj3Cg6oZWCMcwfIxY9ufbZY0n3qzVJlS/wLZNV7zCU/Bo3DMG2UCM4BfEBaJ9z7W8 X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3231020)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR06MB2805; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR06MB2805; X-Forefront-PRVS: 0473A03F3F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(346002)(376002)(39830400002)(189002)(199003)(15650500001)(25786009)(53936002)(3846002)(189998001)(21086003)(101416001)(50986999)(8936002)(6116002)(33646002)(1076002)(305945005)(7736002)(97736004)(2950100002)(8656006)(5660300001)(16586007)(16526018)(54906003)(4326008)(6666003)(69596002)(478600001)(68736007)(36756003)(5003940100001)(86362001)(316002)(81156014)(2906002)(50226002)(81166006)(106356001)(8676002)(105586002)(76176999)(55016002)(48376002)(50466002)(47776003)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR06MB2805; H:impinj.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: impinj.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR06MB2805; 23:GHIeQFnRqUcN8KvDkrFcV7VWPpCn8ps333S+ZnRhH?= =?us-ascii?Q?Ar5uthvi/AzBtCe/NpKt7CrzCbqjdG2ln/D0Q7taMXZHmprBrgBfht5sMuJ+?= =?us-ascii?Q?Ce1p9RJZguh5S5pLr28Q90X4326RionukWAkgKvnY+kjKj4ctomciqgeCxmD?= =?us-ascii?Q?70n/+G72YEajfAUFE9LEy3jLb0xyYpEicfJR3xGWQIx7iD2OmxPqyLi6Tege?= =?us-ascii?Q?qQ2xuDQ+dcCkVULgYILl7xopnaidFLzWydsTMwXl/W+h+dRrxeNlLeHYCkMJ?= =?us-ascii?Q?a/aazSQHQSiosR4fdOpuS/kRVE3mksAmkyrJZokIFg1eaftr6BRKGqkxOoKI?= =?us-ascii?Q?wQhRy9CF/C9z+NfUTtzLnKoXIHsag3CqsJTuuX9YCTjSDPqWKxmKNJpYlHTX?= =?us-ascii?Q?HlaDkrOHRSUxceusPT79G6cnBJweGBtSjLrtNCFrO7wzCUszssdxe5qyiKdT?= =?us-ascii?Q?oNaiKTydGUzaRLA3x0T1JHm4JBtC2p6+r8ODcBUKgbZ82f0neS9X3z2FeAmx?= =?us-ascii?Q?hOj1mJODxqtGHyFmXieGHo2FLRPu2pIRvWcQja3dmwybG0lY/uFFV3wZin3O?= =?us-ascii?Q?rZDt+gDPzqo23vcCZ2mRtig1AnNtCaLXlacN9KKhLObQw73fCl/bIBMt887H?= =?us-ascii?Q?FSiQAQfvHbTex82Q8uWbWt++jwX2j6MuJJwTs13hwnS/rfBJ3udarQ0YrSbd?= =?us-ascii?Q?BnMx4MI/5yateL+0z4AhJusd0smqRYWyW666qDpNw8wROSZaLZs0Qf8A/4vl?= =?us-ascii?Q?FOgTnwF84BD52lKWZSw/xXkM94ce8wlWZw09oaLvV3U7ln9noOALDqoagFjl?= =?us-ascii?Q?o7T8AN/AMtm3PVSa1dL5YoWtkoR078QpWLCbUJFcpwyYBiBLyjMT/JXHuxfv?= =?us-ascii?Q?RuqIAErvdtxoXnJUSv/ewa89MYRO65w6u+7TvJeya9ECjknZuqu+5Z4DM9jT?= =?us-ascii?Q?UVXv7Vma78yoAOwj3Rt1ZYZ4ijxSsxblsGbe3cqxf8QV3jrfJa9TrvmNBXj0?= =?us-ascii?Q?x+Bndewr1fjjCB5FkPyydYAzV+b6fjWqtSpaHDNwYixWCRYt33KUFEu5wSsN?= =?us-ascii?Q?I2z7EG6SAO7hJpnmT5j3F+VnDACWVq3x1EPej0Z354Bn4EbahW479oxBqvyh?= =?us-ascii?Q?+knVk+siIDzDOsIU8Ou8p5ChZW8FjfuBuE5WniRMhh37+cHCoyTTg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2805; 6:YMDHs09cCFwiP81qWkfdgf/VTjpaMBV4Mg7QaUqZ32xx8SyqF9uyTePRVzVu3jozOnr9sUBLaReXqN/zvSpKUlP1wCcI1DOIAK6A2wEdG00BxVm2MA2FdArNu1TBAztL7gwJctzWpf9VCXt89fLkUUJSwol6nadRIZEL4Sdy29qs962AncLo8N/DtV/Bs55wWi0w8nisX1aQrtLRfc2D7lH5eCElaNn8GPNYCuHde5C80NsuLwxOGbXXGyXTKZ6XpNFIECRo3XM/j/yplj/VvDi1P8IygwILPWo+rtwOILu80Xh/N5kaxGcZfoWOeX0DWoS9qgqjbvZle/O14aZm+3QmMdQYxamCTmero6mEVp8=; 5:4jPQW6Ar3lRnBLF7oOL1R5vrdOdLkT38iEE3gALg9L8qSAaXprvHgte5VgRAPDieS2Pux23SebOPxSHZS4G0RgxcXtHGKo1F+hhzgs6yRpjkCPAEJl+ilWihe3M3CGZCMULgw7PtciyBQMHqd9qIZ43ZOlzGT/7YsDCUhKF1XWM=; 24:vWFIUDfa4bKO00pgpsDwqlObTt2O8e1xycF5SLE6oTA66ezj4YRnCQC8MAzp59C94nVCWBPu0ocfh82GUFsYMPsQlbIitGFI/EL0erYrFVc=; 7:xOhAUHPgUhWnFA0TRa9NFWrcZrXpPj6IsrKCAgm7PQ4O+Xe65Bd8Z0j0WDZAzFXwMFVnx+/oYj0IJIIs72vJjhWpWpkmka+YrdZDKGpgFhEKEygShOLzHkUY2G0FUIfKIysIvi+MMiKPq9wMVGNubQph3/QLK7fugjGni3/Nh7etxCBlJo0fWgDW1HOKU1cVyPuSj4MhVVnZFe3CCiyn2gCv96EJ0g9vGCNV0ASE/cy+MCAuIyyDmi0oZg9yco6+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2017 01:09:26.4556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 746e5694-45de-4867-0d86-08d51cd75e33 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR06MB2805 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171026_181008_000575_F7454417 X-CRM114-Status: GOOD ( 16.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Signed-off-by: Trent Piepho --- 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 f033a57d5694..fcbaf0070ccf 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 08be445e8eb8..9b2ed66ef7a2 100644 --- a/include/linux/platform_data/spi-imx.h +++ b/include/linux/platform_data/spi-imx.h @@ -4,24 +4,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_*/