From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF7C3C433FE for ; Mon, 23 May 2022 15:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238043AbiEWPkb (ORCPT ); Mon, 23 May 2022 11:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238069AbiEWPka (ORCPT ); Mon, 23 May 2022 11:40:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C2413E0B for ; Mon, 23 May 2022 08:40:29 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntAAV-00086m-NM; Mon, 23 May 2022 17:40:27 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1ntAAV-0005nZ-A2; Mon, 23 May 2022 17:40:27 +0200 Date: Mon, 23 May 2022 17:40:27 +0200 From: Oleksij Rempel To: Mark Brown Cc: Fabio Estevam , Sascha Hauer , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, NXP Linux Team , kernel@pengutronix.de, Shawn Guo Subject: Re: [PATCH v1] spi: imx: mx51-ecspi: fix clk polarity and phase configuration for CS > 4 Message-ID: <20220523154027.GD20227@pengutronix.de> References: <20220523073143.778664-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 17:33:08 up 54 days, 4:02, 74 users, load average: 0.23, 0.17, 0.11 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On Mon, May 23, 2022 at 02:27:15PM +0100, Mark Brown wrote: > On Mon, May 23, 2022 at 09:31:43AM +0200, Oleksij Rempel wrote: > > > - /* set chip select to use */ > > - ctrl |= MX51_ECSPI_CTRL_CS(spi->chip_select); > > + if (spi->cs_gpiod) { > > + chip_select = 0; > > What if someone mixed GPIO and regular chip selects and 0 is one of the > in use chip selects? Ideally we should check for an unused chip select > here, though the current change is still an improvement since we'll at > least only write in the chip select field. In case some HW variant has real issue with it, we will need to reduce amount of supported HW CS and use blacklisted one for GPIOs. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |