From nobody Tue Feb 10 03:39:13 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 D872836A008; Fri, 9 Jan 2026 17:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767979122; cv=none; b=uoAvDd+4zPRsCVwH1b+1rfPIPVcraQiDnO21ju/z5/MfTVXlcQGY2Cvp1uQXvUSXnQyBk+GM/LtjnapfE3i5nlM24zz0ZwSkdKvJ0GWKO6KIlPtl3iTJ0FUPwGwmDP4y0T3IQoY0hCkGrVVG+10c0pogccRM5uzX0Pn6UHGAWgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767979122; c=relaxed/simple; bh=d1pMPXsc/NAovDeL8jPYfcli3yV5fT4o3GBUJY0bytk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J7L+QKLAyYWxmoSnIFYZMVAZtO+nEtxYpsyX1zO9Rwb74VUEbXEst/cOZyzH1h2I/IP5XvKyLNLVBPk8y4xTsNw9SvGtBmjsdLGPael/axRIXaT+/EaG/tKYRh89XC/NLi7kUgImIPELv5qDc2uQoidOK2zHS4/jQhmQMHKbfOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=eWq7ZINq; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="eWq7ZINq" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 3517EC1F6E8; Fri, 9 Jan 2026 17:18:07 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7E0CD606C6; Fri, 9 Jan 2026 17:18:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 14557103C89B3; Fri, 9 Jan 2026 18:18:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1767979112; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=NApdv+R1wOE2XRRRWrScngg2KW6iyNx4NagI1wj3CIc=; b=eWq7ZINqBmxQKnbAIdh+fc87X4R8a1h+hotvDIEgf/WeidwTbGcvB7SHRvLgCc7ZHw1rXF xKWplgE9mZlSrs41/y90QX0x2kpdpcViHdv6E4qp+VMlAIVCiBTuhTe4JNJcPoMNPLejQB bM5mUNQLrT+yzl6mhZf5/a3+9X+YqjBPUWrcaSFvpsbvfXpsscZ6Vcxl+ycNkWrzjTg0gj ThNDdNHDCQ1DvRL4s7g+mKkXhY3dtr/mj+Eu09BcGkufkkwRxJygVzoKHWJjYWCyH/nJ4F BabNS4t26ZnNepvU49LzbYZyFVkzSkVtEokb2SZ6ClwfYavdbAe6ZJ3N5+A/vA== From: Miquel Raynal Date: Fri, 09 Jan 2026 18:18:10 +0100 Subject: [PATCH v2 12/27] mtd: spinand: winbond: Convert W25N specific operation to SPINAND_OP() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260109-winbond-v6-17-rc1-oddr-v2-12-1fff6a2ddb80@bootlin.com> References: <20260109-winbond-v6-17-rc1-oddr-v2-0-1fff6a2ddb80@bootlin.com> In-Reply-To: <20260109-winbond-v6-17-rc1-oddr-v2-0-1fff6a2ddb80@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra Cc: Tudor Ambarus , Pratyush Yadav , Thomas Petazzoni , Steam Lin , Santhosh Kumar K , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Winbond W25N* chips require a vendor specific operation to select the target. Instead of defining this op only in the function that needs it, hiding it from the core, make it a proper define like all other spi-mem operations, and implement the necessary spinand_fill_*_op() helper to make the SPINAND_OP() macro work. This way we can use it from any function without any extra handling outside of this helper when we will convert the core to support octal DDR busses. Reviewed-by: Tudor Ambarus Signed-off-by: Miquel Raynal --- drivers/mtd/nand/spi/winbond.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c index bfec5d037f25..dde59f8f63f5 100644 --- a/drivers/mtd/nand/spi/winbond.c +++ b/drivers/mtd/nand/spi/winbond.c @@ -87,6 +87,18 @@ static SPINAND_OP_VARIANTS(update_cache_variants, SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0), SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0)); =20 +#define SPINAND_WINBOND_SELECT_TARGET_1S_0_1S(buf) \ + SPI_MEM_OP(SPI_MEM_OP_CMD(0xc2, 1), \ + SPI_MEM_OP_NO_ADDR, \ + SPI_MEM_OP_NO_DUMMY, \ + SPI_MEM_OP_DATA_OUT(1, buf, 1)) + +static struct spi_mem_op +spinand_fill_winbond_select_target_op(struct spinand_device *spinand, void= *valptr) +{ + return (struct spi_mem_op)SPINAND_WINBOND_SELECT_TARGET_1S_0_1S(valptr); +} + static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section, struct mtd_oob_region *region) { @@ -119,12 +131,8 @@ static const struct mtd_ooblayout_ops w25m02gv_ooblayo= ut =3D { static int w25m02gv_select_target(struct spinand_device *spinand, unsigned int target) { - struct spi_mem_op op =3D SPI_MEM_OP(SPI_MEM_OP_CMD(0xc2, 1), - SPI_MEM_OP_NO_ADDR, - SPI_MEM_OP_NO_DUMMY, - SPI_MEM_OP_DATA_OUT(1, - spinand->scratchbuf, - 1)); + struct spi_mem_op op =3D SPINAND_OP(spinand, winbond_select_target, + spinand->scratchbuf); =20 *spinand->scratchbuf =3D target; return spi_mem_exec_op(spinand->spimem, &op); --=20 2.51.1