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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72CA1C433DF for ; Thu, 14 May 2020 10:25:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B923206B6 for ; Thu, 14 May 2020 10:25:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NLXPbLYh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QmjHinNg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B923206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D0M3LDgOOBvmH60ukqhFON/+ASCjXiYGaAtK//pmg4Y=; b=NLXPbLYhj8pwcVz7SyronmOzx HP90GH8WudhEuX9xqHrnrFETWfJFpAq1uPgxbi9fNze9L62BOUy9hqFmqkyKgiAiqK83vs3RVIyYD 8friRzJDpObJ+PZq9a+WL7yKMgXR4D3nVcZvxgoQoquN/Z8Y5bxzoj1KGHRMuepT6q6HaOpoVFk6n 7QrGQKrYLLcGVRFIU1a4BcHF7M7FOPVQsdO6mAS8BmvaxTZVQZH3L/gMl3AwZXx1Z05v7F+zWEb3W ex09ipRZl9Y6VJyIb90CYV+M3+7PMMHAq9LB9hV1qIvGalei4GwuHP6HXYSoYRY29amEUQHOoeuXE h6iBvy7rQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZB3K-0007M7-R2; Thu, 14 May 2020 10:25:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZB3H-0007L6-Mw for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 10:25:20 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD9CE206A5; Thu, 14 May 2020 10:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589451919; bh=5nwmS+KTbr3sSObZfnbM+iwQhP3voPRrqRowGVTGoCg=; h=Date:From:To:List-Id:Cc:Subject:References:In-Reply-To:From; b=QmjHinNgj6gY9z1qjHeBghNERl7zN6UbfUjokiOvSPJS8KViIGLEY88TcmmdSGoRH FCQcqIUOj8gmee82Ibs8+4so7LsNhvI6/IZkCxCaJh5HEzNU9otRDJO5Mn2j36nbNU gSTVsaj3U4GizjvJFh4h2aggsLHrSQMEoWnPI/Kw= Date: Thu, 14 May 2020 11:25:16 +0100 From: Mark Brown To: Lars Povlsen Subject: Re: [PATCH 07/10] spi: spi-dw-mchp: Add Sparx5 support Message-ID: <20200514102516.GD5127@sirena.org.uk> References: <20200513140031.25633-1-lars.povlsen@microchip.com> <20200513140031.25633-8-lars.povlsen@microchip.com> MIME-Version: 1.0 In-Reply-To: <20200513140031.25633-8-lars.povlsen@microchip.com> X-Cookie: I think we're in trouble. User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_032519_773219_D8788B11 X-CRM114-Status: GOOD ( 12.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, SoC Team , Microchip Linux Driver Support , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============2804382108406206793==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2804382108406206793== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WChQLJJJfbwij+9x" Content-Disposition: inline --WChQLJJJfbwij+9x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 13, 2020 at 04:00:28PM +0200, Lars Povlsen wrote: > +static void dw_spi_mchp_set_cs_owner(struct dw_spi_mchp *dwsmchp, > + const struct dw_spi_mchp_props *props, > + u8 cs, u8 owner) > { > + u8 dummy = (owner == MSCC_IF_SI_OWNER_SIBM ? > + MSCC_IF_SI_OWNER_SIMC : MSCC_IF_SI_OWNER_SIBM); Please write normal conditional statements to improve legibility. > +static void dw_spi_mchp_set_cs(struct spi_device *spi, bool nEnable) > +{ > + bool enable = !nEnable; /* This keeps changing in the API... */ No, it doesn't. The API has not changed for more than a decade. > + } else if (props->ss_force_ena_off) { > + if (enable) { > + /* Ensure CS toggles, so start off all disabled */ > + regmap_write(dwsmchp->syscon, props->ss_force_val_off, > + ~0); What's all this force_ena_off stuff about? The controller should not be making decisions about management of the chip select, this will break users. > + if (pdev->dev.of_node) { > + int i; > + > + for (i = 0; i < dws->num_cs; i++) { > + int cs_gpio = of_get_named_gpio(pdev->dev.of_node, > + "cs-gpios", i); > + > + if (cs_gpio == -EPROBE_DEFER) { > + ret = cs_gpio; > + goto out; > + } > + > + if (gpio_is_valid(cs_gpio)) { > + ret = devm_gpio_request(&pdev->dev, cs_gpio, > + dev_name(&pdev->dev)); > + if (ret) > + goto out; Set use_gpio_descriptors and let the core manage the GPIO. --WChQLJJJfbwij+9x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl69HIsACgkQJNaLcl1U h9Aw9Af8DHFCOUCYIqBXZKPsZmTsKPTCHD++MbKsFPg1h25hnM7mZkbXpXWbVvvO FGaPEjHqVXh7XOs/oKcQxxYqqmLQ0Xz8IvRbKlu40uhPsiMNLXN7PUdjn6Nr8m4B Q0BtnJeYnxTi7EopeR7ikkqqFRB8TjpHDluMeFaHJiB4zCeUKD0/tHwhK1MegIUy wgkeoe1oZG31GUhvqFz/WfPnZs1O3dDeduVv8XrUkDG3XqkHwN9y/wwXK3KcxN2Q Mly4vcbofus2CoGU1kN/poPnnQ61Ddb17ybFLhTO7bZ6BuEC+p+vdjkhVLvIvljT qv6UDWYjXH32KDg+2vhur23u9WDP+w== =JCbC -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x-- --===============2804382108406206793== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2804382108406206793==--