Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp52018ybg; Mon, 8 Jun 2020 16:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6dGtdKWgGx39vqUrQx4y+Ij5w4kWT9402wVy4jESycsjNktx+1I2xRUh1PZ/QUAYZp/Jf X-Received: by 2002:a17:906:af62:: with SMTP id os2mr22818129ejb.345.1591657891447; Mon, 08 Jun 2020 16:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657891; cv=none; d=google.com; s=arc-20160816; b=jILd1SMKc8bmPQCwSev30CgC/vNtqbiznkze9qnGzOgyjhKDibzuMoVoo9wzACKWuX VbWwgVy9XBtKgaIBpRBQ74a6mR8xyqh3e5dXeTLRshZKD1149r56MMtv+ezl3y297hE0 nRsd+81mWCS37bw4YuEPiVd4mAORZNdvFvUYA/Hl43mIg2t/Zf+b815J5nipbcxdMzOz MCqebw/zS/haq75rx7iNWjgJjxgj8yDieT9dMpNSYYPc/43xMqabYZd2jsfqGHDudWus v3LoyI2TQoMMWEXw6VJu+a38bsR1paGVVfK3mgPsPgj//Jmu74DFjob6ivuIeZCMTSSV BU1Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BHH6s6pRnyW9A5KJYWZlLHE0qbVmdeOTTeo0kIdQX2w=; b=yo3MXveMC196JqNXaQqsOsejI9OtjOjAaOo/ZI0XPL8E/pAaBL2hYlWncNZzP/GE3l QoEID3rRxvPvqRodiCGKZ7YXf3wNO0JVNn9/d2c5mPuaz66KxTJpJtbPiaA1w2zAeWom GdCoIdARi7rHgE2vUxF/y2l/ArnuAK6r04YkzN839kwAYfaNMcZWRlyddLCWpfxzlyhx ljYN2ISm7m2Bfl0nFWHaLC4T2EhAn3MYt8DDMqd8x5bSflkL439IlwBgkBlSkcNfHqBm 8JZ76JeHRE7bntAK6OK9r+u/BLVqya+FPQDxXXQmyA62Gp4vTjKjdseQA9HIWV0O+FyC Krow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SWuAW5ks; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh18si8894610ejb.487.2020.06.08.16.11.08; Mon, 08 Jun 2020 16:11:31 -0700 (PDT) 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=SWuAW5ks; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbgFHXGw (ORCPT + 99 others); Mon, 8 Jun 2020 19:06:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727004AbgFHXGb (ORCPT ); Mon, 8 Jun 2020 19:06:31 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC83D20774; Mon, 8 Jun 2020 23:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657590; bh=zJyy96p/S5Lp67gqr1bh7mhGEJc1LIXF5relYqsc5RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWuAW5ks9URcrPAuqgZb08nUkOdo+EE+XPtSAzshPhJXKNbwntu1Ho+tltJAo/wyT Zq5Vqp2wEt392zhL20zb0UdqZR2b2Iam1TLVYcvSYPu/g+sZHugHLIMvKAzvpbCc7l PDn2I+0/9pqeRF8ULlyV/QlMjkDqg0s6l6Sifw68= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Geert Uytterhoeven , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 018/274] spi: spi-mem: Fix Dual/Quad modes on Octal-capable devices Date: Mon, 8 Jun 2020 19:01:51 -0400 Message-Id: <20200608230607.3361041-18-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ Upstream commit 80300a7d5f2d7178335652f41d2e55ba898b4ec1 ] Currently buswidths 2 and 4 are rejected for a device that advertises Octal capabilities. Allow these buswidths, just like is done for buswidth 2 and Quad-capable devices. Fixes: b12a084c8729ef42 ("spi: spi-mem: add support for octal mode I/O data transfer") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200416101418.14379-1-geert+renesas@glider.be Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-mem.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index adaa0c49f966..9a86cc27fcc0 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -108,15 +108,17 @@ static int spi_check_buswidth_req(struct spi_mem *mem, u8 buswidth, bool tx) return 0; case 2: - if ((tx && (mode & (SPI_TX_DUAL | SPI_TX_QUAD))) || - (!tx && (mode & (SPI_RX_DUAL | SPI_RX_QUAD)))) + if ((tx && + (mode & (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL))) || + (!tx && + (mode & (SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL)))) return 0; break; case 4: - if ((tx && (mode & SPI_TX_QUAD)) || - (!tx && (mode & SPI_RX_QUAD))) + if ((tx && (mode & (SPI_TX_QUAD | SPI_TX_OCTAL))) || + (!tx && (mode & (SPI_RX_QUAD | SPI_RX_OCTAL)))) return 0; break; -- 2.25.1