From patchwork Thu Feb 21 15:59:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10824283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F5D71390 for ; Thu, 21 Feb 2019 16:00:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 735A931778 for ; Thu, 21 Feb 2019 16:00:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6598A3180C; Thu, 21 Feb 2019 16:00:09 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E715331784 for ; Thu, 21 Feb 2019 16:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728453AbfBUQAI (ORCPT ); Thu, 21 Feb 2019 11:00:08 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:49958 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbfBUQAI (ORCPT ); Thu, 21 Feb 2019 11:00:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zPD78fCYTtci38h67MfWuvO01OttSR+7Tm/Kh8ZQyrI=; b=acaSCdYWUq7Dp7fXuFkqTIYEas 0yBVYnJpB2s6YjIK0HUUACCBGVFI64kbgOQR4EqSJaNUoPfI6sTbZKa/uBjpUQ7+tHj/ORb14WkHh QsZsSRDpTKRmpXpddodjZ7OWlZxbrcJHNNd9RLGS49haYlyno59XbPv8TyjzYrC2dxWv1m4DBKmR0 kD7gs9SIc3IIav+nLpSqRmGq/41KrFN6OnC/zhha3EfoJ+d9uTbtDrH1pKTnVOJymG2f573DD6KS+ 2s1i5uahu0LZSQcvNyWf3Y4Ofj3VJSl1anNH5BXal9e2m0pTPGq87zW376ZeLWhwpQcaMbEqvqgpt w6/w55Ig==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:46824 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gwqlT-0003hr-IP; Thu, 21 Feb 2019 15:59:59 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gwqlS-00053l-QU; Thu, 21 Feb 2019 15:59:58 +0000 In-Reply-To: <20190221152459.axrjce7yqkjmedgl@shell.armlinux.org.uk> References: <20190221152459.axrjce7yqkjmedgl@shell.armlinux.org.uk> From: Russell King To: Mark Brown , Lorenzo Bianconi Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH] spi: spi-gpio: fix SPI_CS_HIGH capability MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Thu, 21 Feb 2019 15:59:58 +0000 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 spi-gpio is capable of dealing with active-high chip-selects. Unfortunately, commit 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE support") broke this by setting master->mode_bits, which overrides the setting in the spi-bitbang code. Fix this. Fixes: 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE support") Signed-off-by: Russell King --- Patch against 4.20 drivers/spi/spi-gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 45973ee3ae11..2d7cfe3c7732 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -410,7 +410,7 @@ static int spi_gpio_probe(struct platform_device *pdev) return status; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); - master->mode_bits = SPI_3WIRE | SPI_CPHA | SPI_CPOL; + master->mode_bits = SPI_3WIRE | SPI_CPHA | SPI_CPOL | SPI_CS_HIGH; master->flags = master_flags; master->bus_num = pdev->id; /* The master needs to think there is a chipselect even if not connected */ @@ -437,7 +437,6 @@ static int spi_gpio_probe(struct platform_device *pdev) spi_gpio->bitbang.txrx_word[SPI_MODE_3] = spi_gpio_spec_txrx_word_mode3; } spi_gpio->bitbang.setup_transfer = spi_bitbang_setup_transfer; - spi_gpio->bitbang.flags = SPI_CS_HIGH; status = spi_bitbang_start(&spi_gpio->bitbang); if (status)