From patchwork Wed Apr 6 13:36:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12803446 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 B482AC433F5 for ; Wed, 6 Apr 2022 13:37:27 +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=+CNyS3YWQR0mYu23aVM8maAVAy/gPwSoPTs0p+zyIW8=; b=msdkqXIkzLuYUI TX+Oi/CJ3gL5P1cC+upq8hOkU2AADmSS6JRTjrhhzABvQkGOqIvhCJ2JTZAgV9S1M++7DE4ONlIC9 0iX1nbHL8/ef4lMUwVpl6zCUmr8eHY1XouofWw3ahZFNLe50pVoKFV9wSg37OBJzgwPxwslTE6tR7 1h1f32T8M+XhFMVIROcH8RYZZd+GvJU+4D2xljBJnU91apTbv6Jrt9/8NgEdUoxU040I8cVKa/4wi x3bstELlNe5QomjiMKqwqyJrNUbyC1RJBlKxWKQ6JErSLYjTBFjJJidxA7WDMLFJ3PFaDh3KekATT VO5V9Y5shma0FM7CMJPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc5pc-006KVH-5b; Wed, 06 Apr 2022 13:36:20 +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 1nc5pV-006KT1-6K for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 13:36:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649252173; x=1680788173; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dY3I42F8Fmle57bb/MnsyT2f27MUv242lzfRVo6wB7E=; b=ZyeKg4pZ9iIo4bAim10XmhEMfdYHnq7GOaZsiAB6icdq8jYOPEbwm537 HIKAq01xBunH9QaF/bEiofrw/nE8iucA+587Z4rR6/GkwQLDbr6LtfMyQ 92MPX7arkTYPOZNqBotAoLznTmh2J7x3JNOnIAoKXrC3S3+/fxEEcAU0E Q27ux4taDjmmZJ4QHYqRpDDAncrUmPhNhmhKxPcXRSklBkWAXIcgkK8iG MjTiMftNVDGOX3J3/BsVEnOxoOiT4F7JcCe1KKmDPz/DrF/G3J5UKVdUS MoJso/rk9CF7vbMXhP1/5M/Q1Fw/CQhggzz/iFsOL/shGU6WDvE3YGN6W Q==; X-IronPort-AV: E=Sophos;i="5.90,239,1643698800"; d="scan'208";a="151734981" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Apr 2022 06:36:12 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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 06:36:11 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 6 Apr 2022 06:36:09 -0700 From: Tudor Ambarus To: Subject: [PATCH v2 1/2] spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller Date: Wed, 6 Apr 2022 16:36:03 +0300 Message-ID: <20220406133604.455356-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_063613_405796_6548D197 X-CRM114-Status: GOOD ( 10.25 ) 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 --- v2: amend patch's subject, s/"spi: atmel-quadspi.c:"/"spi: atmel-quadspi:" 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;