Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2299388ybl; Thu, 19 Dec 2019 11:12:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzLjar6t886HIpZt9vnHqFU8ezzarQSmhZr0N0hGoS15LLglvLTkBHrcjaJyE/j3WSIUZ8/ X-Received: by 2002:a9d:7a4b:: with SMTP id z11mr10498303otm.46.1576782754902; Thu, 19 Dec 2019 11:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782754; cv=none; d=google.com; s=arc-20160816; b=I6L4broZ5PZ9QvvtxFcpHrMypbTRcX2mPHWpMpc3kKkUprm6xQJW/I3gMUaHS755SS OswGsAJPIeN9mWUrAbE8Fv/roCFImOVbQW5Z5OAIr3iSjhXzKLsFTRnY7EI3jb/LZlBL FEzx8BbGomYgO4WppudTumBpZ4JJIM3Yy8ehgqPwIDtOeS6adEBQPQ8NWn8ZGJM5Omz4 uY1nnaManReoVnPZbC+GRgxn9jW4H1wMDcD8HsucGIc4Jq3PiZuT7Lsax2k33TOdFV2q Fruyc4OH+G9x/aIbKollaUVYY0eqbrBGjs5aRS0+QnT7teVOoF3Nsw2zScRc1KlDMxMd N/7Q== 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=+Tr3FAaP4s6jwbxr0pNMzyA/tRgk2jhw0DE4ozyyBZk=; b=vd3W1PRU4GrsgNDn24QuPKx2swzgvWUBN0MGj9qyHlvi94HbS3iSykXc1ctjy2UFWd 53lFnD4Pt76OUQlu1jWApa/1tAhz1OClYhHgJz5cjYK2ev++8mLb2I85Sxu2lqXMYHmc O5Sp/Dg/DtL+x69z3BWuMEP+f5uGxzmOULI8HRe6NM91BEzMyAvCBa3zDkg+jXnI6Lm/ W4zB4MVpBx33B5I0Za4O51nqe2S59Czm+WeTZSwClaM2ANcxXtOUl9i5y6bxXP7voGFS Fnb6WCA1P/A9o0Zi0wpxdyXxTsC/38ruHYN9NGIPr0XQRM+UUv+QQYWP3gslk7VLax3u mgAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l5fALnar; 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 d17si3289380oij.136.2019.12.19.11.12.21; Thu, 19 Dec 2019 11:12:34 -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=l5fALnar; 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 S1728016AbfLSTLl (ORCPT + 99 others); Thu, 19 Dec 2019 14:11:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:55720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbfLSShy (ORCPT ); Thu, 19 Dec 2019 13:37:54 -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 5000A222C2; Thu, 19 Dec 2019 18:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780673; bh=1HKDtvWYNVyMJcPdD5ufXrP3BQadBttkknjlLK6HduI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5fALnarnEv6Pyb3Ei8YVEyV5oYH2nJ1U1SKbvJs5E0l+z2qV9pfqyTkU3CmWWWfN tQ6WtroHqxnCNL4oo71wGUgImVlPSrtTd1MZ0vQTuG8WZfa1XVBLj4ISGJuD+huvUx NGZpSV5771FaGJa5k0VW1xN3zkU33+y7jjy6Eeio= 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.4 068/162] spi: atmel: Fix CS high support Date: Thu, 19 Dec 2019 19:32:56 +0100 Message-Id: <20191219183211.968120548@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@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 @@ -1209,10 +1209,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; }