From patchwork Wed Apr 6 10:03:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12803112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6335FC433EF for ; Wed, 6 Apr 2022 10:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=64vnXRStGMa2TdzsRZe8g7vWxGTHNVoX/mLphPdSydA=; b=n4/UihUQW8HVOU 8Zw3kRzAibaq9kkAcwcJXaHCM3q3ga4GvNKZZYqBc5IqmRIWHxjRhfsO2lNEMZsJoAPTpGAwbEEgA mTIK8CCVpNvwOhJWU0zYIPOXvYFbE9MLRdVdlmHD8Bj2gUB+ptI+iO/EvDVuaU+q34cKaOvRwdT+j Db4mezpKjzcSqZ+bed7T6ItvmGIe9mPil4MxE0t2bB42qtLdCkxFqpSpsCAlcaXuG4MGTn6Ma1PWv 7BZy2msuEDu6tQpZmzbqj0iVb0cBAw6lTG2NTcOtMAh0xhayHnt63Jgm2t0QVi1W8wtQh65eRWASN 7LdQ8AFdwop8wbvQKCKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc2jd-005Iwo-Bw; Wed, 06 Apr 2022 10:17:58 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc2Vv-005DaH-2g for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 10:03:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649239426; x=1680775426; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UzpLkLsQSybYrDctDJM7hazMV+345ZJBUluwhHnkHow=; b=ELQiipAxQn+5ALGLEQhe+PSR+IKvW+NoLW10g+5YrRj96s8lwFtKp6x5 pqz6qiPhqwXDR6IE22mwtyIt+W0vk1EmKGD0/9j3fHuB38vfU/pj10ErP nvgWuE2rdz7L2jUaCZtObQw51l2Z/NbiesFr8RZkBw4Ovdl6xfKI4IntE +RE0rC6cpSwrnYi78rnYdi0SSCGvgBpPjY1OEuLKlvYk+HxOaknGsKF+m e6L2ooMpVJOIvMIzjmQTcOlYfmkJ+t4Yrx758IGbq0a8+dirKqmd6kOw/ W377A81SvH2FB87eiqE1qXZlSfDRguM1qxS7I6jRkMq83e+BYcEPvAh4y g==; X-IronPort-AV: E=Sophos;i="5.90,239,1643698800"; d="scan'208";a="91453048" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Apr 2022 03:03:45 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 6 Apr 2022 03:03:44 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 6 Apr 2022 03:03:42 -0700 From: Tudor Ambarus To: Subject: [PATCH 1/2] spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller Date: Wed, 6 Apr 2022 13:03:39 +0300 Message-ID: <20220406100340.224975-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_030347_223336_CFF4919A X-CRM114-Status: GOOD ( 10.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-spi@vger.kernel.org, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the spi_mem_default_supports_op() core helper in order to take into account the buswidth specified by the user in device tree. Cc: Fixes: 0e6aae08e9ae ("spi: Add QuadSPI driver for Atmel SAMA5D2") Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 92d9610df1fd..938017a60c8e 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -277,6 +277,9 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op) static bool atmel_qspi_supports_op(struct spi_mem *mem, const struct spi_mem_op *op) { + if (!spi_mem_default_supports_op(mem, op)) + return false; + if (atmel_qspi_find_mode(op) < 0) return false; From patchwork Wed Apr 6 10:03:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12803113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F5CBC433EF for ; Wed, 6 Apr 2022 10:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gpqP+9fcKTmLc71J8zVCvx8Gb8Pb88nm+GUG4u+2jEM=; b=jysEmtj/MMHCm8 IuJ+jnhtM1ogDqnlFmlYtTcnqt67rcbLPFp/LDgZQCMWtq5BHjQlAJoG0nWm+oNNXEhlIb17fJpMa E0a3sKos+8UqemqgvI1E3SubmsV2UpHeLLpdaFtqYdB3l4f89Yx9VSF/H3fWAKyYzJ0HhIAXoVoUI DpAOYK4L6bQOlTrV6mhgqbAyyT9PaJKPgZ0NV979AOMGNjKXoKhfn12m6zUvMVIbfVEUsQ0Dmrlgp f5mutaj1c20G9Phx3tauC29gTi3PcR323I1kd5g0QtMTha0BYXTlDzjy2aIDdk6XaKGzH5lzgDV1k S8pDVzI7k60XikB5f52g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc2ku-005JR6-2c; Wed, 06 Apr 2022 10:19:16 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc2Vy-005Dbc-GC for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 10:03:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649239430; x=1680775430; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YPQ9VGLSnWsFaAo16s8N0avyz4Em8x1yBOhaaJvn2Ic=; b=PnIYyj9PctU6XZFI59M0dL635UaP4+If0YnpyksYS68f1jxuGWd2HZkL CiJRLkjQXVs3KCYMalKvNDTilnzd1jPzdwSc1VFfFYwmjIah581it6UMG Iw4m42x46mr24oFbyd+XTs8R8cMR6qbcuky5dyDjwhwcgL5Vqcyl5qLJZ 7Xg+nTLTDogtwJy4+/f33OPZvfHdH9yDoJ1Xc+psaXz4ntP87vGa7R+Qx ztxuo7C+bW29AbqYMgsTmlzdPb5n3u+D1NELfM5wEa0eEyH1am3PLBY5d N2JWN0FnLMQas1LsL2Fb7RlxV8LEH/mChGA7zY0w758Xg49hC2xfDV37P A==; X-IronPort-AV: E=Sophos;i="5.90,239,1643698800"; d="scan'208";a="168611982" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Apr 2022 03:03:47 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 6 Apr 2022 03:03:47 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 6 Apr 2022 03:03:45 -0700 From: Tudor Ambarus To: Subject: [PATCH 2/2] spi: atmel-quadspi: Remove duplicated DTR checks Date: Wed, 6 Apr 2022 13:03:40 +0300 Message-ID: <20220406100340.224975-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220406100340.224975-1-tudor.ambarus@microchip.com> References: <20220406100340.224975-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_030350_571365_BA36AA74 X-CRM114-Status: GOOD ( 10.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the DTR checks as they are already handled in spi_mem_default_supports_op(). This code removal was intentionally not done in the previous patch that introduced the use of the spi_mem_default_supports_op() core helper and fixed the buswidth adjustment between SPIMEM and the SPI controller, so that the fix can be easily backported to stable kernels. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 938017a60c8e..480c0c8c18e4 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -288,12 +288,6 @@ static bool atmel_qspi_supports_op(struct spi_mem *mem, op->dummy.nbytes == 0) return false; - /* DTR ops not supported. */ - if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr) - return false; - if (op->cmd.nbytes != 1) - return false; - return true; }