Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp817954ybl; Wed, 11 Dec 2019 07:59:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyeBbj8KVEZqnCwu+1DtksBW0c2yRoFuIQIagsKYXjjSR5LWLSCe//nEY7PZolKeOchNDxk X-Received: by 2002:a9d:3b23:: with SMTP id z32mr2646747otb.159.1576079985703; Wed, 11 Dec 2019 07:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079985; cv=none; d=google.com; s=arc-20160816; b=p/O4cUFFrlne+vpI/yb60gTj3KCZmPk9gUagUfjmFTHEyIHE/MHCX1yH5w8ExB/XXp Pep4pG+xrwNq97ZqmWCE4jXOM2o42vcszwskec8P1/UhaWvSfKgB/pU3ZaJep8KxNTb7 NYWaJn1lH21zWR9f4FN/xOcTLf5eb4FEj34UHPDgx1D7BX0cDgrxQqNrDrsVesjqRbJk 1KIIRgAfiIPpPaVTzQ+sMhpc2nggkQzAAw6F/OZ55uHauR7+oOXe5rnLnEF7vaxh9Yqr 8TUTabBEApNpnlkkVCyzl9fdgl07ldDfFt33aB4yj8omCe5mMjF2TIIS1t1U7BUGbVnK VC+w== 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=EJBQGnH6zWM+TQ0Gi+tAPSEOIFOI/++4gJ3CEskNRd4=; b=bQUHUPGnqOF0k7Z1GCjYLU9nnXBq90rnm9WUrWyDKNdbT9bMsQJo1QeIOu3jqcCjqL bYpb6CMTgjUDnCUMHDU1GkzjcJQzNzJfeHDFz3nfPGLth2rPh405OqG9hT3qsOEePHw/ gPFCoCf3ulcGZ05jUZkFZQXz3ZrtG+ryqS88T8IsTT0yuddp0UpFQFfoIdUu2/jPNiGP sJWtvK6Orptt+PXNnIioj0R/CpeIR7Fgg66OqwpS1iCWPi8xe3NQyycW9dhKulYGqB1Y L2klFnZjT2nalZJzlxeSI+qaTXHVszQHloon6+IGc5pzkuliXJwfkigDLTWd22fIH4HS OuNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nM3wAg5C; 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 l131si1444506oib.174.2019.12.11.07.59.33; Wed, 11 Dec 2019 07:59:45 -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=nM3wAg5C; 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 S1732076AbfLKP53 (ORCPT + 99 others); Wed, 11 Dec 2019 10:57:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:40932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731719AbfLKPPF (ORCPT ); Wed, 11 Dec 2019 10:15:05 -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 EE14620663; Wed, 11 Dec 2019 15:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077305; bh=XbKuNasBmPbrtd60IDb/eU5UqdPMSal8akdyx3GHlvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nM3wAg5CH/94xw61jxSXViSD550Opx848pr9YSzIyzlriezp5Ts9ZGatEZoLrE28s Nre6xv3BDw7Y2i0KGvOCatI+9wUsCnvZixzRMVtfFeuaCpcvUTfScneg8dSlre6SUM 4KGCWX4V8QVnMVLiqDfEg6vvbwnmlq1kNz2TIp2g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gregory CLEMENT , Mark Brown Subject: [PATCH 5.3 095/105] spi: atmel: Fix CS high support Date: Wed, 11 Dec 2019 16:06:24 +0100 Message-Id: <20191211150302.100629315@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@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 @@ -1182,10 +1182,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; }