Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp782919ybl; Wed, 11 Dec 2019 07:27:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzTVyURKjT+eudG7GSV9JRB5dEb7nqUXR3F0avBm5fkRx3tLMKP4Z7sxkqclmigkS6CC+jF X-Received: by 2002:a9d:470a:: with SMTP id a10mr2786409otf.370.1576078037121; Wed, 11 Dec 2019 07:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576078037; cv=none; d=google.com; s=arc-20160816; b=j96lOhmbrP2WY8TsBbs5CzBKkjxQjDTiO+txag8fwKth2XFO1YxLBjYDqzWDANWpkz dE1aqYzT/RzgFDWTKoN6rQXvjDBeqXnByoaa0VqWkJRpvyXF3fClVIsF3BZP/9AOuai8 Z0UlWMz1a6l5izgfIpowF/jnmAFND5ZLHoGAUkKEr/moFohFq9SDmPzIyuS0aNu2STn5 q5bHsBm3yeaQ65l7LahRwY6Su+tfbkvR+MBscSBYVHdmkH7tnD8o+6scTB6WmPBqJM21 LFHnmFIAjF/FTfNUMRkqAD9QEMeItZB9O96vLThXU1c7YGCoPqaN4v+Fcam40J0sbjNc fvHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xwPdnB8VboxvoKj0UrHaasRPoJDoQ6o0Ybty0et1lbY=; b=OJ6RC/vFWLcFGkXP5SVkApo9OT7cm8ZHwYieJdo3vs4v6bhzTwvaqyfCBAPzgQI49p dtPAPZlQqH/X/dIOmauHLJN0T7gsEsAowOFK3RVxsD3a+XsJft9VYBEL+ovLLGnWZIRc 3eMq/gRoCRRtGK6rwIGSYH2sjrcIMbX3vFza2Whr4kP//f4pRsdP6TfXvTFfyLPD1+BR YtYXLVzi+Ki1NPjNo5nYL/P0YIZIFOlFBL8nQSbFSU8mP+/8Dy8PhHPyEqQzLdXsHNR1 hQkxgajQpZA3E/Kf60Foi8nHJ1s5gFGEGLjcZ4zWzOWL6DutYwVz/gDZsqx8j15jHe1y 9c7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x3eASnZI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j70si1317926oib.219.2019.12.11.07.27.05; Wed, 11 Dec 2019 07:27:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x3eASnZI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733143AbfLKP0e (ORCPT + 99 others); Wed, 11 Dec 2019 10:26:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:59908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732953AbfLKP0c (ORCPT ); Wed, 11 Dec 2019 10:26:32 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0C9832173E; Wed, 11 Dec 2019 15:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077991; bh=dRn+yS+kPoAvTsY/Yg5x1owoX167NMGs9lLA9+q0DJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x3eASnZINM+qLhr2TdZs0YqddRn5H9ZISSil0fRtLrHurbqzkvDKWZ8hI/3Jtmwxp KsQSnEgVZEegsDIDruaAsg0IVs6q2F8oVhH5tXmeGNOTRqWcRAczu4T2aPIrLADArG +SjBjHO6nzbcoP0phkKmqo8pbhLq4u/ee5kPhJ84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gregory CLEMENT , Mark Brown Subject: [PATCH 4.19 235/243] spi: atmel: Fix CS high support Date: Wed, 11 Dec 2019 16:06:37 +0100 Message-Id: <20191211150355.196921973@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gregory CLEMENT commit 7cbb16b2122c09f2ae393a1542fed628505b9da6 upstream. Until a few years ago, this driver was only used with CS GPIO. The only exception is CS0 on AT91RM9200 which has to use internal CS. A limitation of the internal CS is that they don't support CS High. So by using the CS GPIO the CS high configuration was available except for the particular case CS0 on RM9200. When the support for the internal chip-select was added, the check of the CS high support was not updated. Due to this the driver accepts this configuration for all the SPI controller v2 (used by all SoCs excepting the AT91RM9200) whereas the hardware doesn't support it for infernal CS. This patch fixes the test to match the hardware capabilities. Fixes: 4820303480a1 ("spi: atmel: add support for the internal chip-select of the spi controller") Cc: Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20191017141846.7523-3-gregory.clement@bootlin.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-atmel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1193,10 +1193,8 @@ static int atmel_spi_setup(struct spi_de as = spi_master_get_devdata(spi->master); /* see notes above re chipselect */ - if (!atmel_spi_is_v2(as) - && spi->chip_select == 0 - && (spi->mode & SPI_CS_HIGH)) { - dev_dbg(&spi->dev, "setup: can't be active-high\n"); + if (!as->use_cs_gpios && (spi->mode & SPI_CS_HIGH)) { + dev_warn(&spi->dev, "setup: non GPIO CS can't be active-high\n"); return -EINVAL; }