Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3204222pxb; Mon, 9 Nov 2020 05:32:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwABEofcMK9oupyRDY0lZMtO3wZT9GQ2VdtF3HJAUMbUSBU0h1lJdw+RqlitLF+BI1p9WKO X-Received: by 2002:a17:906:8145:: with SMTP id z5mr14368537ejw.461.1604928752811; Mon, 09 Nov 2020 05:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928752; cv=none; d=google.com; s=arc-20160816; b=taV2LNIggq3VyNiMjwcbIEPltOk1xBOMs71eql/oWLoue1ucxIhjtdBU9Ja2LGT97i 6u72itkRva/7b+mSx5vKDsv/vK7Jy3tQ4RtgLH6XRZ/71iyfXHPlkoI3xwdTV/Z5M2gb OjA0w+w+tsZ+C6IqIEGPk5Sp30B2Y5P1SOfNz8gAiqsYj1j4/9rDvHmAuSldiIBb5tYw pm80T2QqMVpT7aJ8ncDxuxG4pHoDUMMlf3I5Seigb4bsb6vyWHqE+SGH/cumUSAHpwcu OmBqNCxmbyWtYy5oIOwp/z9fJYTrrvwKJolA6bkV4ZuZ4uq8c0ZScsQ7nQx9WQlslxS+ q/4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1YoS21I3wrt4ujfsEcsg/OMhUkGqMIEoEEOW1dk1LI0=; b=HM9GAgZK8Mhtv0WWGYNtTqsR4LIx9OfXnwqCBVKUT2q2xNeQuSg+pgASEzQu3S47kq qIh8JjDMVuzWt+SXqM3ICemtZNmfBqxJFrC6I6NX2CqovT3HsCaeA4t4gDD6DuQQxqYg PjmWuh5rzif3ds9avWaGHYi9/K5qbHdDK5wM9Bi/CmSfmukh0vVjJ8ht2D/6k7lel004 ow/rYa8HY1PBF4Ld9j3P5opZQpCLUgvqR55p/W4B6mOOUf1ApBNk4dV/D8icQNHz5P04 T/I21xElbN6w5PksTrshqs4ftP1EZUfdSLtPtcrSnHfMeSRKtbnw43h6U2SCUygPLjJH yHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=befigCPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt18si6856266ejb.602.2020.11.09.05.32.09; Mon, 09 Nov 2020 05:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=befigCPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732823AbgKINNM (ORCPT + 99 others); Mon, 9 Nov 2020 08:13:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:38926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732867AbgKINNG (ORCPT ); Mon, 9 Nov 2020 08:13:06 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9A5E820867; Mon, 9 Nov 2020 13:13:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927586; bh=/wHBwqn5w1NOF3XMl5ZV5K9HZa/eE6X7dhUJFFY+5OY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=befigCPRfv8awpIz0BDT3slJBmskQUEnMwGG6GHXDkIT1oYo6zs+P29C+7W+7bJxu KfdpwUfi2SjSUauWsNpzdl7+w+ltmLMnT9GK7K/fzyVSlAPetYxik4+meNuAJVcMqi AS6MXIeN0cQa9OjVvYZR4zomk9HpKDOK79C7iBLY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= , Mark Brown Subject: [PATCH 5.4 39/85] spi: bcm2835: fix gpio cs level inversion Date: Mon, 9 Nov 2020 13:55:36 +0100 Message-Id: <20201109125024.465850684@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Hundebøll commit 5e31ba0c0543a04483b53151eb5b7413efece94c upstream. 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 Link: https://lore.kernel.org/r/20201014090230.2706810-1-martin@geanix.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-bcm2835.c | 12 ------------ 1 file changed, 12 deletions(-) --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1245,18 +1245,6 @@ static int bcm2835_spi_setup(struct 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 GPIOS_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,