From patchwork Wed Oct 14 09:02:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Hundeb=C3=B8ll?= X-Patchwork-Id: 11837081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8609E61C for ; Wed, 14 Oct 2020 09:04:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1827220878 for ; Wed, 14 Oct 2020 09:04:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d+jclaxv"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="QcYSlGx8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1827220878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=geanix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=xWuiWb4myFQbt/p+jTmmfw5tzC0cPk3yaZ4pZ7eh/Ac=; b=d+jclaxvqmvvGcHlsbhBqvLiJd aVTDXBHxgBw+Mc413B6AzNNJxH6pwvZD15YI8B4k0F9M32aCXxI1MLNxTGibw3dSTCuAISmvtf9D0 d0mNxoLI4cPapXxeVZQ4TLoL/bfmdfWA8C1GBcwveTTUijhc2lrDAQoYZ+k4ls1kiCTtf0S/03my0 3qnEqnelZfF9ASQko/tDfBFvfMmBNbZYmVq4ijezXiS3+AqPfiKNhzLROs7XRi7y6OP26My02Q/Yg WFu4+THvZHvLebXzNKM4InTFQMqIKnCSRrOvdhE0GPTY8P7xtSPiGhVugpIwVnJ5CbQwoEKE7gYrQ QIaz0ODQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kScgN-0003yi-RD; Wed, 14 Oct 2020 09:02:51 +0000 Received: from first.geanix.com ([116.203.34.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kScgK-0003xs-KW; Wed, 14 Oct 2020 09:02:49 +0000 Received: from zen.localdomain (unknown [185.17.218.86]) by first.geanix.com (Postfix) with ESMTPSA id 05D16F41496; Wed, 14 Oct 2020 09:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1602666165; bh=aUqpmVAAjoLv03iR1lJWlTTuq3Ra9mS4JJvcrMl80zQ=; h=From:To:Cc:Subject:Date; b=QcYSlGx8F2sB7kmz03FAAv1M7+kRXre/GguSc7U4PJJ8+IIe8Dh94yJ53k2fI8XYF a5sRm/MWvWXFODTETN/HObcw8Ol5k5UQj6SeZhQCd9dbs+ErMBzpluhuYnI5SEuBxi 2P9tzE8NSOIiraaIhoufXXsiwr18KzNjHCMtYrvmoySnSNG4NzaYKjOwGKBXftW7Ae rT/J80Cy/ANS8+OrZKg2oIyC5xEhwAPbT2b6gy0GKro/p+diILKXmUGqBaPdpeqNiM EgCmac227s8YKodVqSBuCE70rwYm+4tPgvPBOaCcu3AvI/H5hl/AqLHG6cWhO7cn20 Q1+83MApLj99w== From: =?utf-8?q?Martin_Hundeb=C3=B8ll?= To: Mark Brown , linux-spi@vger.kernel.org Subject: [PATCH] spi: bcm2835: fix gpio cs level inversion Date: Wed, 14 Oct 2020 11:02:30 +0200 Message-Id: <20201014090230.2706810-1-martin@geanix.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=4.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ff3d05386fc5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_050248_883531_44B39173 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: , Cc: Florian Fainelli , Scott Branden , =?utf-8?q?Martin_Hundeb=C3=B8ll?= , Gregory CLEMENT , stable@vger.kernel.org, Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Ray Jui , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The work on improving gpio chip-select in spi core, and the following fixes, has caused the bcm2835 spi driver to use wrong levels. Fix this by simply removing level handling in the bcm2835 driver, and let the core do its work. Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS") Cc: Signed-off-by: Martin Hundebøll --- drivers/spi/spi-bcm2835.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index b87116e9b413..9b6ba94fe878 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1259,18 +1259,6 @@ static int bcm2835_spi_setup(struct spi_device *spi) if (!chip) return 0; - /* - * Retrieve the corresponding GPIO line used for CS. - * The inversion semantics will be handled by the GPIO core - * code, so we pass GPIOD_OUT_LOW for "unasserted" and - * the correct flag for inversion semantics. The SPI_CS_HIGH - * on spi->mode cannot be checked for polarity in this case - * as the flag use_gpio_descriptors enforces SPI_CS_HIGH. - */ - if (of_property_read_bool(spi->dev.of_node, "spi-cs-high")) - lflags = GPIO_ACTIVE_HIGH; - else - lflags = GPIO_ACTIVE_LOW; spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select, DRV_NAME, lflags,