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;