From nobody Sun Oct 5 01:50:04 2025 Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AB2E2D662E; Mon, 11 Aug 2025 19:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.246 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754940815; cv=none; b=DKPT1mTqahRj0qV9WDFLKBmJw8xerHVIFtxJRWnqzFZuqnPlQnYPIDeBi+XVJ8i586aRNYkXh/h6HOgV76NCvuutHvGOP/Hh++YJ/S7+zUjawbFmXYp8JrPacuHl2l1xAbtBM2gyoW43DzzQgA+WL/7m5EDw+L+Hc6U3G/uovOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754940815; c=relaxed/simple; bh=o5mEf0wKLmJbk2hwJ6vSHDVbjiGp9Ghm5NGCX2ZXEIA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hlXWJ32fJFx1iLb+9dvutSx0HSMH7Hw1YD2YoipWPdntNl1TY/0/vpFj6uMNNNe2PHxLHIdbQB6e0OLFzWoa1FmKSDuoSdz5/515GNehdyuCG0qc/4UzQoFqJHpKpkQOd19wwZeAtqeH/kcxaNFQehNWjOZ8eK4HF0t/jdePgQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=IJy263T4; arc=none smtp.client-ip=198.47.19.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="IJy263T4" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57BJXKl01609393; Mon, 11 Aug 2025 14:33:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1754940800; bh=11ROVwz5O/XLyUNvqIWUa8IJxyUhmbImPXBSiHjpbt4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IJy263T4ALh0QVjGntSpkJ1TZ4ELjhTQojCaFJbrjU+vBi2mABZuYEsxLiStA/ncv BLBG3hdk6+7NLRPRX18m9GxfyeccoWEXL1QogonvgCXMQkL1SPnk9yLpV28Q+3tLvc IiEZ0/6649b5OVQifbyrt4Q8cMlhWwbtM7ZJb4DE= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57BJXKPM2910901 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Mon, 11 Aug 2025 14:33:20 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Mon, 11 Aug 2025 14:33:19 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Mon, 11 Aug 2025 14:33:19 -0500 Received: from santhoshkumark.dhcp.ti.com (santhoshkumark.dhcp.ti.com [172.24.233.254]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57BJWq1s3690681; Mon, 11 Aug 2025 14:33:15 -0500 From: Santhosh Kumar K To: , , , , , , , CC: , , , , , , Subject: [RFC PATCH 05/10] spi: cadence-quadspi: Move cqspi_readdata_capture() above all operations Date: Tue, 12 Aug 2025 01:02:14 +0530 Message-ID: <20250811193219.731851-6-s-k6@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250811193219.731851-1-s-k6@ti.com> References: <20250811193219.731851-1-s-k6@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Move the cqspi_readdata_capture() above all the read and write operations as PHY can be enabled for writes as well, in future. Signed-off-by: Santhosh Kumar K --- drivers/spi/spi-cadence-quadspi.c | 46 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-qu= adspi.c index bb90fbdd641f..da5823bcc1ea 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -444,6 +444,29 @@ static int cqspi_wait_idle(struct cqspi_st *cqspi) } } =20 +static void cqspi_readdata_capture(struct cqspi_st *cqspi, + const bool bypass, + const unsigned int delay) +{ + void __iomem *reg_base =3D cqspi->iobase; + unsigned int reg; + + reg =3D readl(reg_base + CQSPI_REG_READCAPTURE); + + if (bypass) + reg |=3D (1 << CQSPI_REG_READCAPTURE_BYPASS_LSB); + else + reg &=3D ~(1 << CQSPI_REG_READCAPTURE_BYPASS_LSB); + + reg &=3D ~(CQSPI_REG_READCAPTURE_DELAY_MASK + << CQSPI_REG_READCAPTURE_DELAY_LSB); + + reg |=3D (delay & CQSPI_REG_READCAPTURE_DELAY_MASK) + << CQSPI_REG_READCAPTURE_DELAY_LSB; + + writel(reg, reg_base + CQSPI_REG_READCAPTURE); +} + static int cqspi_exec_flash_cmd(struct cqspi_st *cqspi, unsigned int reg) { void __iomem *reg_base =3D cqspi->iobase; @@ -1259,29 +1282,6 @@ static void cqspi_config_baudrate_div(struct cqspi_s= t *cqspi) writel(reg, reg_base + CQSPI_REG_CONFIG); } =20 -static void cqspi_readdata_capture(struct cqspi_st *cqspi, - const bool bypass, - const unsigned int delay) -{ - void __iomem *reg_base =3D cqspi->iobase; - unsigned int reg; - - reg =3D readl(reg_base + CQSPI_REG_READCAPTURE); - - if (bypass) - reg |=3D (1 << CQSPI_REG_READCAPTURE_BYPASS_LSB); - else - reg &=3D ~(1 << CQSPI_REG_READCAPTURE_BYPASS_LSB); - - reg &=3D ~(CQSPI_REG_READCAPTURE_DELAY_MASK - << CQSPI_REG_READCAPTURE_DELAY_LSB); - - reg |=3D (delay & CQSPI_REG_READCAPTURE_DELAY_MASK) - << CQSPI_REG_READCAPTURE_DELAY_LSB; - - writel(reg, reg_base + CQSPI_REG_READCAPTURE); -} - static void cqspi_configure(struct cqspi_flash_pdata *f_pdata, unsigned long sclk) { --=20 2.34.1