From patchwork Mon Nov 11 11:19:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13870621 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6107189BB0 for ; Mon, 11 Nov 2024 11:19:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323994; cv=none; b=F837pso5RulGcItqXLXUq2ZN4zlTXQE9+i16lOvxEa4pSDqczdnw/MBDRphBVIL3IDHkOcDA41HU9d/mN6pn7065teHcksTfbQkuJsCvPBh0+0ONINfTuXnZkS8vcW7JjMMWxhLXh6OzHm6v4UoYCP/k/7bLlhsY9ivNk+hAPQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323994; c=relaxed/simple; bh=yR0gR1vAjLhs0FBNDgPv2TANgg/seBwdhhtk/Rr/WUY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ejpV8vQD2tjnrW+ODC3TgTa+IgQzhNHPLX+7eBTcBPvKcLj1WBKRpileN9lHH3iOKQKvzKNI52GiNHIg8B0QWb7digH5jFSZy5oBKiWIUd9iJM1t82QjM+6qENfkNo+0K8EwgrtpNSGQAnKIDALMTEtby8wbhfAc5PyRxpeyWMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cd56O3Cl; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cd56O3Cl" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a9ec86a67feso770990666b.1 for ; Mon, 11 Nov 2024 03:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731323991; x=1731928791; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lMrSmta7fHOUctB/5AJidvIZnIncGO2UNey3bSwk2a4=; b=cd56O3ClrQQqh+cVp+RilHw0k0N93/nof5zTzryaawfrPVOpX2mARsqd4NZkkm8EPp ay/H8fy6CHt2JT1fWreAsX48AFx0tIWXiC/0nEMo3b9GOwmDyl2POliZ1X8TVehQItJb ofADAJSgnu+o1aMV566+hFX6LtfBR3kbzCC1tWNrHv0hqOMYMnmaOKbBFTBTQpFJyKDR +I+ZalIvxx+miZOcuavOlOhmzq325cGO9kDbSxIbs9y/HMmtxrfJCDRFKU8GU7Sm1MOI 48yJWzJO8s7pqQYjlU5SdTvKdGxxcRI+kqUMb+wd49bf416Pq5HiK47xla+vVmQxGuAX CyQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731323991; x=1731928791; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lMrSmta7fHOUctB/5AJidvIZnIncGO2UNey3bSwk2a4=; b=aayt2f+nieTc1Jox695109k9OLzyqcOGQXc9ilyOUVDtjCbbzG9XZItCBFnUZSn8rK nCK4tfKmqJw8dqfAeatxIb2mgFQLPgUanOXxRyreRgrD8QqYgqFu8WkEp4eh5GUMV1dc X/2xf81otKBWHC4doyLq6b62fRzFoJAFDCFaCzC6Jl6DfK0ysAb94xQfe3mFU7rAwpVb HmIjOzOisSAe3MX8AbYUdbNCtrRpDGOqrH0LsQfU0/5F8Vtn/vrbu7Q++/HlYPBHnMnO 1HluooKahokLDlPMOxjlrreVRpvJaVsemAi8wdmeSeBDhM01qM+y1fIl1yz/lUFxF2BX MizQ== X-Forwarded-Encrypted: i=1; AJvYcCWuZIxHN1PbziOFxjS/rb8eGXwIYpGER3EQGJOoQ+J1qVBF6Bo0OocvQ08sv2pmGu6Kxeg=@lists.linux.dev X-Gm-Message-State: AOJu0Yxnafg3isv16mMQULhbhiGSwd6RcHH3Dmbolix8UavFRb83QUwt KPmrODN40ItzIP2bkw3+1XiSzLYmx4vCl2rGgMW4UthTXaqvhBYV2Rsl1a32ONQ= X-Google-Smtp-Source: AGHT+IHOXkjlkrDrtvlnPceOnN5si90LVUaiVILWy4AO1guCrPxVvXLDLxRd0s7RMfvfwDzqJwxOIw== X-Received: by 2002:a17:907:3f13:b0:a9a:b9d:bd93 with SMTP id a640c23a62f3a-a9eefebd119mr1154918666b.4.1731323991120; Mon, 11 Nov 2024 03:19:51 -0800 (PST) Received: from 1.. ([79.115.63.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0e2e922sm582530866b.193.2024.11.11.03.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 03:19:50 -0800 (PST) From: Tudor Ambarus To: peng.fan@oss.nxp.com, m.felsch@pengutronix.de Cc: pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Peng Fan , Tudor Ambarus Subject: [PATCH v5 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Date: Mon, 11 Nov 2024 13:19:44 +0200 Message-Id: <20241111111946.9048-1-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1010; i=tudor.ambarus@linaro.org; h=from:subject; bh=/+Hab6B4EJ5Dh9SCHmRGYARDt8d1ozFiUUdntiL5/lk=; b=owEBbQGS/pANAwAKAUtVT0eljRTpAcsmYgBnMehSLAOWEq2QisQo/KwTNHCKeQe1lOWHd82ps 5T1iSUMhUKJATMEAAEKAB0WIQQdQirKzw7IbV4d/t9LVU9HpY0U6QUCZzHoUgAKCRBLVU9HpY0U 6RatCAC4xwOyECtAGIseOOgysDe7h7v7SgsjEr0sfn28ZspNaS/95AIqQMCfPSy2qy0reu67pKZ pCg8oRQQfb3u2HfTFOANgCtFAvUU7byNiliCO09Xw/vU9C9LdcuY8F6L/FvGyghiMvel2oXw9Ht jm506UJHfuIDMw1XINeUG68aULrEnhlGPJQfJIVn2XMCxiAq3u8l/3KN7r+bNbltYTHoiXnHXSA hKoSjlCj2GvfWO1ADnETrU7j9ckN4gikrHQvgxc2MSXGg6MDrI5p5PZJcsKjq+PjslQVcnEro6j sz+KTxRqSUMXxVLeIuVuiSw6EVHibHzUNsjqTuJGpAfOBm7O X-Developer-Key: i=tudor.ambarus@linaro.org; a=openpgp; fpr=280B06FD4CAAD2980C46DDDF4DB1B079AD29CF3D From: Peng Fan Introduce optional vcc-supply property, SPI NOR flashes needs power supply to work properly. The power supply maybe software controlable per board design. Acked-by: Rob Herring (Arm) Signed-off-by: Peng Fan Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- v4, v5: no changes Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index 6e3afb42926e..335f8204aa1e 100644 --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml @@ -96,6 +96,10 @@ properties: If "broken-flash-reset" is present then having this property does not make any difference. + vcc-supply: + description: + Supply for the SPI NOR power. + spi-cpol: true spi-cpha: true From patchwork Mon Nov 11 11:19:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13870622 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CE91189BBB for ; Mon, 11 Nov 2024 11:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323997; cv=none; b=IstqK9Yf0wd/zGFzuDoA7KOLfW1Pjfy4+oZBLjYy+Yk8WgT0SmDGeoFif8Cm5yEkiqLlXgn4m2497XiVpLU8KpRGylsrJ6IkJWxvLsqOYyMsmL+bKbGuR930reE/MwjtqiNaLIy8emUsl25fI/rUvEdwmLe3M6ZXGqMscKXJziM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323997; c=relaxed/simple; bh=xXAvRj8AmLSKWPBTJCUUr8yNr91DS97PKpc1oBmJELU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DYl5SB7B/9ae6j4ota6z35tS5aFP/bKdIvdov6Jnd9RmaWts/4CtLtMAHkE1vfxtMRgnV3Hho418vgU5WFGYu7lFpnUFSxrbVAekKzgZ3zEEhtLL/nFsAHDSAXC68gApicASh64tV0B7XpjWxGWvrhVvkR6hmi3P8OmLT3mcEDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nslGSmyS; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nslGSmyS" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a99ebb390a5so1005311566b.1 for ; Mon, 11 Nov 2024 03:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731323993; x=1731928793; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yq4v/gyj/fLO48IP0NaLXgCS56M3wS/277l+hJaYFIg=; b=nslGSmySak2yl14RwcMMlJCfugWhsrO3nHjORsFHeSI0bYZA4vuKsLUCkfbrX3dMIv 4USv+Rcu6YSRjVr98TLdHW1RVtWqUx0Rw41E5+Ld/+/DQUN8HxTsk4Ywavx5S45/r1zP 0qr46fGroi0rAWBj+6blEsSsD544t9OdeZ+94+lCgSYruha0OjgEzr1D7WcXJb91rqER ZaOKTgPvhIAw6Apak+2xaqTkH9vMbDPDYnt8Vr4C5/4DFaBkXei2gowfCfHc35yKT8DU +5+CABNG6WkSB9NSW1NIN6KVtbBF67LqD6m6xVrN6DMMG4WDbTbFF5KEosLX4lQxmXTe zhzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731323993; x=1731928793; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yq4v/gyj/fLO48IP0NaLXgCS56M3wS/277l+hJaYFIg=; b=oqEexND9HwBvKwjg09kUNsRdMu3sVpMVZVhmusbCjEsRpOeSHNpXxembtPoZMwKcl+ A279AwVS++dkZMeUv1JeDnY7lHy4KYGQ4d3zjFSMsfRWjO6Gg+mp8J621PxaV12NnKwR thp6zNs5lTqBBBvN/jbqvWZ70O/+BhdgMgrrRytDTtxPn4HGFyDzDwWKA/xewDyVWlNU P+A5gyxCaEF8m5Zj/gx/bcpGrgVrA7CVCMaM2yPCHf4z0ZdUQeafYW0hNLmK005L4g22 7qmnuyqEhxI64s+c77tO2yyHzyYHzOwB6n/aCkqYm0rF5RPQpOpWZlt4WBuD5bQiEH4N CmlQ== X-Forwarded-Encrypted: i=1; AJvYcCWZQ+JO4x6qofkgAO26YduFyuGGnqCffgtwjQoO6uQsF2hlk/8uNfClOCmAl538m3AqueY=@lists.linux.dev X-Gm-Message-State: AOJu0YwGBGyJ2GSId2jXiJE1b1iPUBuE4pnyHDmXepNsAk7+eOxihdFe r2O2OI7FzLfK5j1v++P7apsGw037AsA30WSwhJ0hO+bDBWm7i8BrxmgGwLj9mLg= X-Google-Smtp-Source: AGHT+IGuK2Mqhh/4a1qh5q0NmwjtNgZX29PbWEQEw3KvEot2jIrlM7uXsL6sEyoljZjEBiZjnawbgg== X-Received: by 2002:a17:907:96aa:b0:a9e:b5d0:4714 with SMTP id a640c23a62f3a-a9eeff934b8mr1161128666b.21.1731323993471; Mon, 11 Nov 2024 03:19:53 -0800 (PST) Received: from 1.. ([79.115.63.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0e2e922sm582530866b.193.2024.11.11.03.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 03:19:52 -0800 (PST) From: Tudor Ambarus To: peng.fan@oss.nxp.com, m.felsch@pengutronix.de Cc: pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Tudor Ambarus Subject: [PATCH v5 2/3] mtd: spi-nor: use local variable for struct device Date: Mon, 11 Nov 2024 13:19:45 +0200 Message-Id: <20241111111946.9048-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111111946.9048-1-tudor.ambarus@linaro.org> References: <20241111111946.9048-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1819; i=tudor.ambarus@linaro.org; h=from:subject; bh=xXAvRj8AmLSKWPBTJCUUr8yNr91DS97PKpc1oBmJELU=; b=owEBbQGS/pANAwAKAUtVT0eljRTpAcsmYgBnMehS9ebdJFKcsy5atBuVMxdS3C7109r1J/woe qFiYPTIviuJATMEAAEKAB0WIQQdQirKzw7IbV4d/t9LVU9HpY0U6QUCZzHoUgAKCRBLVU9HpY0U 6ZjVB/0WO+cX4vsaTdpLFXuKZKYDOuInLaBWEUgEPPZ/8cU4SDjiZKvr8yqh0UtViU1djsAGxrU lbbkvJAMmNKkIx66H4M55b1h6KMzypC7Gh2btvdMNc0kajfHClQULdOw/bmIgmUvlEGyMUaesei wMP4FzWZrVtgS990dISZi7Pb49XLFqGXQ+Ljbjhjh52HD0NDBRYPAY0GoVz2WfswymhIVH58lLn qM4IX/9b2evCs9iyAkAnuO6ihfSpfUSuoisuuY3nW3tEB9ewWucFstc9YWOmEQD/QN9wZiBRnk3 kFup7CWm/XBWyReXdRdjHbbjrhiBuF8zQinlnQoUIb61MhR1 X-Developer-Key: i=tudor.ambarus@linaro.org; a=openpgp; fpr=280B06FD4CAAD2980C46DDDF4DB1B079AD29CF3D Use a local variable for the struct device pointers to avoid dereferencing. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- v5: new patch drivers/mtd/spi-nor/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index b6f374ded390..2a329084505c 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3576,7 +3576,8 @@ static int spi_nor_create_write_dirmap(struct spi_nor *nor) static int spi_nor_probe(struct spi_mem *spimem) { struct spi_device *spi = spimem->spi; - struct flash_platform_data *data = dev_get_platdata(&spi->dev); + struct device *dev = &spi->dev; + struct flash_platform_data *data = dev_get_platdata(dev); struct spi_nor *nor; /* * Enable all caps by default. The core will mask them after @@ -3586,13 +3587,13 @@ static int spi_nor_probe(struct spi_mem *spimem) char *flash_name; int ret; - nor = devm_kzalloc(&spi->dev, sizeof(*nor), GFP_KERNEL); + nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL); if (!nor) return -ENOMEM; nor->spimem = spimem; - nor->dev = &spi->dev; - spi_nor_set_flash_node(nor, spi->dev.of_node); + nor->dev = dev; + spi_nor_set_flash_node(nor, dev->of_node); spi_mem_set_drvdata(spimem, nor); @@ -3628,9 +3629,8 @@ static int spi_nor_probe(struct spi_mem *spimem) */ if (nor->params->page_size > PAGE_SIZE) { nor->bouncebuf_size = nor->params->page_size; - devm_kfree(nor->dev, nor->bouncebuf); - nor->bouncebuf = devm_kmalloc(nor->dev, - nor->bouncebuf_size, + devm_kfree(dev, nor->bouncebuf); + nor->bouncebuf = devm_kmalloc(dev, nor->bouncebuf_size, GFP_KERNEL); if (!nor->bouncebuf) return -ENOMEM; From patchwork Mon Nov 11 11:19:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13870623 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5556B1925A9 for ; Mon, 11 Nov 2024 11:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323999; cv=none; b=p+bzKAPfHP7V0uvnxf2+1+YPGJUUvIYgUlRpPFy1nHX3mEokBdbbaYH05Fewb9P4TxJN2vjou0o3nFW43t6n3TtKTk+boZgu4FeWIxODQouaFQ8AVqliF8za27oeW63Fpi+Kn3h/4Iu1YALpkRXYZc7z4VWnZ48TUY0EjQsssGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731323999; c=relaxed/simple; bh=SrOU0DWf5Qo0VlyxfwgPrZKheynvQ+WBcg4n73EMMHw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ReyEnKujW3AUZid2THAwWEk8Md0yKFEAHOF0O92veoAv+gN0FGd0ksQftXrxnUPrFvRKLgvB7dDmQYvxASAaX09/aGwB3EX+rZZWTN1GnX38LZ2n+LbgTXUVfYnOq4CNmjDqNF4zKQ3uOfbEA07uyf7QzmQCRsHwll88h7kQRdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=eeEe2GAB; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eeEe2GAB" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso746604166b.3 for ; Mon, 11 Nov 2024 03:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731323996; x=1731928796; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fu/BrO8IXX6alWkTb0GYjGoZx8cl1iROqgITASLHOag=; b=eeEe2GABcqth3paccxksmFozW3RIVzNXJWnG+8XgplV74QCFHmy8mCDlg+skKy7ZAi /IxSZu8ye8BP7gkaMtA/Y4Dmn2EfGq9X1M88BR6oGCie4s319VNa1Ockb18KGXZGWCrP nRzpBqexoNx6ZwWFMazi/BRtuobl9DhkxusS0UiihvYG3L8lv+fykTr3fqk8h8o7ZiIi 0qOee9P3VAGkwXIR1LOEMgRNXldNs7ZOy+aFhwdR9ptNbrIKXjt1fizPXx3C/XBY4wws b4ZrvL1eg9UTT2VsloUQYxYyN54HbHiIaBEd6fVkvsG9cH9/kn2IYKQAVCUFpMz6PHxk mnZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731323996; x=1731928796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fu/BrO8IXX6alWkTb0GYjGoZx8cl1iROqgITASLHOag=; b=d0E1B8Rib0Z86KXftrqgsZybxaFyQ0JCMItwvrJwiuhCkj/hTeLqpsSENl0JFunYoT Uvg257nHxBtFg5mg4zt3AXkzw5eZvxSnTCGhc83IKKKO/RoLfxonMEMTqnXvsoKe1q2o 0d/1H48zfWMNXl0Deuy7SYXuOiHR+0/3ZiNBlDsJTNoWr4dboomdc2dkFCeZSOU82Xb+ BzAzWkBZjxHLs/Sxey6KwBSpQUHGXB7xUAX4Rqu8A3Xv2DzK4ZsffpOlrEJPmp7Ce6MW vBaEBHYd2Re8rh73dQkD7u1sKvNAkORUOk0bOHHFQT4FoVSQoAcpwVyCl+JTO1tiTnPf vU1g== X-Forwarded-Encrypted: i=1; AJvYcCVVkDQfi2kW1LWbzW5Ko9dx/yrh4GriN8j08zx60raxFXqy2IcUJ+CtV1uw4H1aRqfT7To=@lists.linux.dev X-Gm-Message-State: AOJu0YxMdiuBoLNX5w5Q8bJiIRL1ost6bmNOl5L7pWB7YdCHBzrey90b SwAcwJfQEdjesejKAvD7UMag/ddKHaGFdVn/xmPMg3v/NHPD7+Q9GkX3NvjBgEk= X-Google-Smtp-Source: AGHT+IETD0TTRXcK0fhtRcdkx1FK3e/NgS7iCgkGzVtCtOmSV30aF2EybWWflcXrw2+dh5CJKbTS3Q== X-Received: by 2002:a17:907:1c0f:b0:a8a:8d81:97ac with SMTP id a640c23a62f3a-a9eefeaf352mr1148302166b.4.1731323995661; Mon, 11 Nov 2024 03:19:55 -0800 (PST) Received: from 1.. ([79.115.63.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0e2e922sm582530866b.193.2024.11.11.03.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 03:19:55 -0800 (PST) From: Tudor Ambarus To: peng.fan@oss.nxp.com, m.felsch@pengutronix.de Cc: pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Peng Fan , Tudor Ambarus Subject: [PATCH v5 3/3] mtd: spi-nor: support vcc-supply regulator Date: Mon, 11 Nov 2024 13:19:46 +0200 Message-Id: <20241111111946.9048-3-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111111946.9048-1-tudor.ambarus@linaro.org> References: <20241111111946.9048-1-tudor.ambarus@linaro.org> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1447; i=tudor.ambarus@linaro.org; h=from:subject; bh=/f04QIpiuRXQZGFnfAnaIXlKFecFw5Gb/Nj7YVsESQI=; b=owEBbQGS/pANAwAKAUtVT0eljRTpAcsmYgBnMehSiUznsRKk7icK+iHmW5tJsygFpLEVcVVqy gWwSLj6VbSJATMEAAEKAB0WIQQdQirKzw7IbV4d/t9LVU9HpY0U6QUCZzHoUgAKCRBLVU9HpY0U 6ZCHB/9VoXfZlG0zTmKUX6uOfKEiomBJ3tfQ08Fz7JZbY9HNkY8ASnC7D3i/ne0kDCkVXmDdN/t truMWEiWIE1aEqbqieiySwIsqcizG8Ng8aLiNPni4zPgm6lAMLGq9pGPkvgQ+cFq+o3sEqK6ju1 teBSW2iQF+1ZFN/yIjDe8egf9CAcfouomGbsT3ezLCWmfzGyknfgU+SZm2MuI020jVlawX/8u3/ SdG44Hz6HjnrJkYXQyvKOVYGgxNXcow+G5b/UAbgcUNo9rVXbPNFG6etyN+bN2C9AgYC5BJaPb8 ApAAcl8bVmIqGIMm7hll4kkRejUfWBnUCOp+r6Vxabk66hCF X-Developer-Key: i=tudor.ambarus@linaro.org; a=openpgp; fpr=280B06FD4CAAD2980C46DDDF4DB1B079AD29CF3D From: Peng Fan SPI NOR flashes needs power supply to work properly. The power supply maybe software controllable per board design. So add the support for an vcc-supply regulator. Signed-off-by: Peng Fan Reviewed-by: Marco Felsch [ta: move devm_regulator_get_enable() to spi_nor_probe().] Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav --- v5: introduce the local dev variable to its own patch v4: move the devm_regulator_get_enable() call from spi_nor_scan to spi_nor_probe(). We no longer add support for the drivers under drivers/mtd/spi-nor/controllers/. Those drivers shall be moved under drivers/spi. drivers/mtd/spi-nor/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 2a329084505c..19eb98bd6821 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -3587,6 +3588,10 @@ static int spi_nor_probe(struct spi_mem *spimem) char *flash_name; int ret; + ret = devm_regulator_get_enable(dev, "vcc"); + if (ret) + return ret; + nor = devm_kzalloc(dev, sizeof(*nor), GFP_KERNEL); if (!nor) return -ENOMEM;