From patchwork Fri Apr 8 08:37:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1614775 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=KLC4Wrpf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KZWpB0zfMz9sG6 for ; Fri, 8 Apr 2022 18:37:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B737683ABC; Fri, 8 Apr 2022 10:37:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="KLC4Wrpf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C6E438205B; Fri, 8 Apr 2022 10:37:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 313328205B for ; Fri, 8 Apr 2022 10:37:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Tudor.Ambarus@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649407030; x=1680943030; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ig6O9i11UWKnxM3NBuMinC2iWuS8i3vrWUfM71Clh04=; b=KLC4WrpfR4AHKq5XVy9g1kOcgDqeebITIgIvgNjb0DbCotWq6DhETP5B 21UlpXuruvJtgucwYgOREOGtyp45eLRg6ObTQ5PdhE1PhgNTf5Xlx1wL1 Okg8rVwENvgjnciwjkR0dE2O7wYtbWjaIanWqaEjT/WvB0xaliksvI5ci IAIDAz4/qsL7RcZtiw+04F7k5nQCijYbURm4MSIq+710lk7ze8tg+oOVT aD+uec0ObKFLoA0W4EdQ7Mxdv55cSZ62hqj/GW4r2Ba7vKmGzCBHaEnYe 0DuEfr3IpMHghE+37dZxcuXOwVhMpa+QhRpXdZ8IChydzTQnI3+2es7oJ A==; X-IronPort-AV: E=Sophos;i="5.90,244,1643698800"; d="scan'208";a="159839275" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 08 Apr 2022 01:37:07 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 8 Apr 2022 01:37:07 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 8 Apr 2022 01:37:06 -0700 From: Tudor Ambarus To: , CC: , Tudor Ambarus Subject: [l4m-2022.04][u-boot-at91] spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller Date: Fri, 8 Apr 2022 11:37:04 +0300 Message-ID: <20220408083704.733723-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Use the spi_mem_default_supports_op() core helper in order to take into account the buswidth specified by the user in device tree. Fixes: 24c8ff4684 ("spi: Add Atmel QuadSPI driver") 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 098298336d..cb64119f97 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -438,6 +438,9 @@ static bool atmel_qspi_supports_op(struct spi_slave *slave, { struct atmel_qspi *aq = dev_get_priv(slave->dev->parent); + if (!spi_mem_default_supports_op(slave, op)) + return false; + if (aq->caps->octal) { if (atmel_qspi_sama7g5_find_mode(op) < 0) return false;