From patchwork Fri Oct 27 01:08:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 10028939 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 1C9C9602D6 for ; Fri, 27 Oct 2017 01:09:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DBD228D4D for ; Fri, 27 Oct 2017 01:09:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0226B28E5D; Fri, 27 Oct 2017 01:09:27 +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 7F1B028D4D for ; Fri, 27 Oct 2017 01:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932482AbdJ0BJ1 (ORCPT ); Thu, 26 Oct 2017 21:09:27 -0400 Received: from mail-dm3nam03on0110.outbound.protection.outlook.com ([104.47.41.110]:6512 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932364AbdJ0BJ0 (ORCPT ); Thu, 26 Oct 2017 21:09:26 -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=X8AO+0c5+kCIGubTNeov1A0e92f5hQ4ZkVoztOt8HUo=; b=o0b+IKZ+aw4zPtIb2Q198ywb0EazgfAddW6XNXnEibykaKJPS6I3SBfl+fzrUlP4OV+86+qtnhQu3Uc1AALs0VdgUgEQKfz7bI5kF2XvHj2wB6CbrICvA3lxybt7dtGX25dB2lUFZ6oD9+pQ1yOnvzm5fohgO4Qr+TDMFiT3i/I= 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:24 +0000 From: Trent Piepho To: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Cc: Trent Piepho , Shawn Guo , Sascha Hauer , Fabio Estevam , Mark Brown Subject: [PATCH v2 3/4] spi: imx: Don't require platform data chipselect array Date: Thu, 26 Oct 2017 18:08:40 -0700 Message-Id: <20171027010841.28624-4-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: ce4528af-ce56-4937-3f21-08d51cd75d42 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603238); SRVR:CY4PR06MB2805; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2805; 3:OZqgc+HgyD9/FkYJRFmOVz42jqNRO4p0MxyRoPxv/RDdFCZijclURVTa+2GDKQgPIhZUj98Oatj6HE4bBK3lNYKqQM+N6pnx8C5qkrshI7KYm3atcJjffyxzgTycVjCTDMOIcr4gHjLUum1cLRRLkROzDU/04Vd+GuOvYnQIRwMs9APUvOYITvy/gloKhyEqhBjQ/+eaIftggvkA5t/yqAtuA2W+8uxTxT1cM9xSnQqY4USnimC+gCFN+5Hu+L+i; 25:BkALT3AsGmlyqakbOJT10kiXzbKUItmSw5V2iKgvE/DirLTNz4KcC6/ppfeX42ephRZAv+6w4V41c+l+Ay9uAzrARBVabSNVYUo9cNo8PO4MfOx8VDRSNWr39ajhb7rXfFUuJ0E461cWiu/SizlfLqqrMDWhU0HINkeqZY0ud6YA4//SYGgJuzvF9itqGGu68INzF1sxu+6eScCQTREo5/CQr6tWx3+LMQXezSXHpf238N0bQ2nak+wUbDyqyqQfK2HAF/TN0Lqhl1W3LetFbyUkdc4CpB+Lu2wdDSKnTrvUZlvDSyKVxCLbvZarQh3j0w04jlPW86h1ch6yzPyjHw==; 31:TsN6s/6S/DA4fsSRNcfLG4dNvRLEoQ6MlQj6Du05PmFrm7dUETEWu7VqTyF7jMpH9YglNUccfHrPQwaBKOUjRxHXopb6AX4bELJNQbmT6Zc71XvTDHxWEniAo4PT+0BPqDzwtG4FuvEbVX1azh60p++mvEsTD5NO/4S6gVp0tnDOuC4mqFzQ6Uy5dD2ZR7cw4Xg4aK+GIF1vYjBB4c5EJSumvhMIrj6BNcxqnXpU2ks= X-MS-TrafficTypeDiagnostic: CY4PR06MB2805: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2805; 20:h2tyDRKN+txXZxl81Uyxqoyb7GlipPqIPz12OpPdHtGNd4Xz6/Xy3gru9AZMNqXCK6cu5Y4/mss3XIGmQgWZOD2+VYzeM86x5ppZyKUjmQK1Sg5PcbKTPjBnZ6kMgAbKoOFEUgm5OXWT3vDvKKQrjjywRbp2BAJPNUjDpbuB5fZSHLJtN6ton2puwVrUNEKgck2hYzbffZkB3XNiDM9ZjA4p9VJbR95EggOzn/gq6g9XPmhg17cFSIcLCDm5AuGOA9lJPoKg0sCPkgS8OeE3t0XVbyX1zSrKaqKDayt9ZTLg54tFBpd2SUnt6Z01E/FZa5AeAkeP6kwyBAQr0TW2tjx8fpENgK0lfw8Mv9/b05YwED9GdQy45fLTPNVQX7ZXVTE+moIFkF7/x21FIVZsDUiPW6fkh4efKct4A9jW5oJAOxRvG3syC3OToBpa1ZQxXPTdsmx3R3p24DDeRDXBS7wT/yMEm0wibxsjp8qsNN9MCd4qCVMiDbUsc6U7ayan; 4:CZ81CsnbNkemc7pUdC+ia2gBA38uiFnzYsf8INsSc4rnDnP9wPYECfbWhdLCHCaJN/eGWYnhyFUZWZMNy5hNGBMuQPswNqKAeub5U9NUY1KFUHdEJYTqhCJsBhNi5LfZbAarG+wBsk+xZ5jTZ6Ij5zq7Z3JAU7Ff9ywRTdMW+FnLj5bwg4yugTfa9CLRUD3srac2VJQRM1yhwhy6fDmfoCWxtGNgjEPzXkuEwzsPz+p7ae/PJRqqbOzEHnY8YX+h8EXCzrL4rTECYytKh7blYtyIgpTr7FG7/k4NZ8fUpQfqvdtpL5M2x+YwFRfS+MYo 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)(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:/LhCFHiAemSnawhNvksnhDPvoroBNMtb8roxT9guZ?= =?us-ascii?Q?2pGQeUNx7Ms0oNm0umVj8UbtoJPVOYXC/GR5Mr+WLcBR6APP2jtnEetQ7kba?= =?us-ascii?Q?2kbT3C0es84ACNKp1knsZ4JqNkPn8RLo0SyDm2rNyw5bZCTCswbuSDWn+9ZT?= =?us-ascii?Q?SI+qyKzCFAj6NWk9A44Ye33mtA501Fe2Cu3tmoDd9tPBy3IdEis0KO5GNj0K?= =?us-ascii?Q?73BeG7P2ms8r5p5d3D1+oZ8QhXqo0H1E+QWtAHX3nNzIjaaEpPnlMdVpxzPx?= =?us-ascii?Q?kkWAqbMHA+sHwErOdrg3BoFk3rr2EZbqSfCN6IrgjiHmjPbxRH5FGB175x9B?= =?us-ascii?Q?X+qfs52ZtdEu9y/4YmhLTPs0rPiSnwwJa497Xj05/nWjpdc+4TcytmA455ys?= =?us-ascii?Q?oUPIbYxwpiVrDmze3Rj3BvYyJzqHO9RdiYkQtHqwi+PakhLdPqYKoqzAY32A?= =?us-ascii?Q?knS16kTohnZTbHnHthDteAO6cJpgah+Xk1lNCS9CIua5RFkemoojra/vD9W5?= =?us-ascii?Q?UtMn0J3ScPiuRSus0KRBqpgBzR5cCuKJJagCB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qc1Q62EGIPupbhzTAWuNN+0Nnqnxz6BRYxNS8DeoLF6NOyJlt8OWWgg=; 5:9Rbp0I08iXCS3q0ociPc1xMnFEiHe8ekvD9JgEc4vE0tEidMg4DjJJDypzt9f5a2wVzGFIJSQRCjKPa9q++T71tVlaYe/b4eA4J1rhUkXthAJSkepJa+OtrdNxJNU9i+QAhshHqZw3YI4eP5uF8VYysdXji53dcbCm9aplcZtJM=; 24:fUj/HeYCB9KZnK0i+aX0j9k3xNmlsbbXKybtwgrqwDvxZKj8zuDlLA4uWlBgDJYo2m4c65BRf3uDgmuM5xZKYI9cRX3QJIWMCfAuIlNDelU=; 7:6xaHmSQQ0O5VQ0QNbCdxGjjzzjeY7GyN1spOhPx1x8I7CeYIAJjq8PqwkyayhsWdKYob0xDdHHASgDTK5mCP0ZSrppnS/BfmDSEbDVeZ15idK2anGf6Y87/OjWJp38lWvNHOcWKl4RtcAf3mdczS4EL6LOii7H3eUW3h9g4nDqOrz8pLGpgsCtjP9/PZNjF4gtfNsrkwLDy5jbcM53gjbCVQz5QG7Dej+KK8QQumlRCdA/YQhvPpYSOk1XAIuZHs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2017 01:09:24.8305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce4528af-ce56-4937-3f21-08d51cd75d42 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR06MB2805 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 If the array is not present, assume all chip selects are native. This is the standard behavior for SPI masters configured via the device tree and the behavior of this driver as well when it is configured via device tree. This reduces platform data vs DT differences and allows most of the platform data based boards to remove their chip select arrays. CC: Shawn Guo CC: Sascha Hauer CC: Fabio Estevam CC: Mark Brown Signed-off-by: Trent Piepho --- drivers/spi/spi-imx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index fea46cbf458a..535378ebab18 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1362,8 +1362,7 @@ static int spi_imx_probe(struct platform_device *pdev) spi_imx->devtype_data = of_id ? of_id->data : (struct spi_imx_devtype_data *)pdev->id_entry->driver_data; - if (mxc_platform_info) { - master->num_chipselect = mxc_platform_info->num_chipselect; + if (mxc_platform_info && master->num_chipselect) { master->cs_gpios = devm_kzalloc(&master->dev, sizeof(int) * master->num_chipselect, GFP_KERNEL); if (!master->cs_gpios) @@ -1371,7 +1370,7 @@ static int spi_imx_probe(struct platform_device *pdev) for (i = 0; i < master->num_chipselect; i++) master->cs_gpios[i] = mxc_platform_info->chipselect[i]; - } + } spi_imx->bitbang.chipselect = spi_imx_chipselect; spi_imx->bitbang.setup_transfer = spi_imx_setupxfer;