From patchwork Mon Sep 30 09:22:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13815725 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 6273ACF649D for ; Mon, 30 Sep 2024 09:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WJxXxrlHpwX/Eu/ZiLTbL4cMsexhdhsIJLEthRe+9nA=; b=ImU8f8zWlu0NgEJltWLtFYyG4s XuFAn1l9UiT2H2qejnZayKhC75PbJZ106lkVxk/G9mdDpYq2w38xsMl/z+KZJ+D3ltfhnLAawSlnk Fa1Cvs6dWr+Vi2U0WSC6LSPE8ulorMfTzMTsH93AOmsfvfoHieb0uQLMMvJfGECiTnckxNvt9gfdx y2ccp1kn4CuJURyD7GTa3ApgrOp7kSw83xBQwmQSDm5SArv4GbsY4I0ioZSDE4u79XofxDOwh0HXO 2bWX52rJnnzJBEQf787SpPbUkJ4c/AKMYLNnjMrpX8BzHdyBM2KgY4mjlhHDqkH5jVZLF1q6RENYz zmrBczUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svCZW-0000000GUCa-0zJs; Mon, 30 Sep 2024 09:20:02 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svCTs-0000000GSVL-0SPj; Mon, 30 Sep 2024 09:14:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K/S5084/Vw77jFCBdFXjFPcefuZcc94uXKtSDlXtboh1fXWyDvq2Tpw+yIOUmafVPK57+RIO+4h/hq3Dj0kea1kzSD9cLSfGyBxb7n3t4q2Rl8UUH9psgJ2zo+p9ZedhFkT7ztew1ylHUsuKdBSRcXPrZH6uzGmJ1K5aH+lQL/HExOD/69+tRQQGfrQmJ+LyS2OHU9fXyOdcIO5Nwl37as6iKEGkF6cCGJkCTK+3mozFknmIY82/xqteLzuDs84Z57GabnPEhJMObDkwBWQOXWukgle7lmGkatjLn+v69ihGZef7HMxAfWXx0wIKyv6k30A8uKtt6C/+dCCIkaOdVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WJxXxrlHpwX/Eu/ZiLTbL4cMsexhdhsIJLEthRe+9nA=; b=g6M+a8hxCRH5/PuLe01eYEHCEvnoctncSTbLNWIwQprnsfWMOP12Y0xtXL1Z9m2wWpsZSD5dB0t2e6bBo/Ct0/aA/sKI+/oaKifxVGDqr6OhvIgWEsB2Uf7SvAO4IBbaKxNoNG+DFtq6OoUBeMd6VFx4kaz96tI3IRMGIHdZGVejLFww0hpJLmFE7HDZ6tXqqrR0Kk75TALgKvHObBdYgy2y5LJR3NPkhwh3AWXPOpP1YLbFhiGSqrBtcC/I7v1g8CX3a1iXSeQ9vTs2DiCneOg26h1hdXmtvntAaGtcyE3lm2gfjkWXFiaL01nwKbJQbf5hRJSBn2Fkao1ZTB6J1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJxXxrlHpwX/Eu/ZiLTbL4cMsexhdhsIJLEthRe+9nA=; b=lz7JRPybhoRcrpZAK7Jz8X5SzmJKuOka2tk7l1gCViHiglusFqBpQZSH5ObNaRtmF/jBDWclF84IFcCb1xuxHJIZMRWD4zhvbTmwxXhYJwFalg3Z85HxitfSUKKA1wT8Ve4BXCFjzJYOvPiiftnZrpo1SZ+pryf/1Ai17DQ+JAEGs+EM8RbQCXFVeDO+Q/8FJgpzAJshQOF58AT71bpwqG4oPOGMzmohqcBo3OXu4fPN7sDBLbpuWgxTMhlHplBgyQsCnMXl7lGMNaeCT74ThUorHv91HdIojx/Y4s0sGfwwTOcwbimHg00f/CXZUmZkVQ3j5Fu5fgqYyZxDM3da2w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by AS8PR04MB9173.eurprd04.prod.outlook.com (2603:10a6:20b:448::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Mon, 30 Sep 2024 09:13:54 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.7982.018; Mon, 30 Sep 2024 09:13:54 +0000 From: "Peng Fan (OSS)" Date: Mon, 30 Sep 2024 17:22:25 +0800 Subject: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Message-Id: <20240930-spi-v2-2-ed7f6bcbe0df@nxp.com> References: <20240930-spi-v2-0-ed7f6bcbe0df@nxp.com> In-Reply-To: <20240930-spi-v2-0-ed7f6bcbe0df@nxp.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Marco Felsch Cc: 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 X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727688153; l=996; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=dVCNuxQH9oNdFfF5MUkgWc3vVRweKipeFuo1LvEXrzs=; b=bR8UGuXmbJo6ucaUTXB5Ri2jK2TqHJcrvfJ9PkDVOqmld5U412wSFY53kUJtRMMKgp5QG7b6q ZtCmBHxRbl5DH/BZKc5Ix8KbdxI1LWSf2q4aAq2Rb9ctQGoPvqMVOCS X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR01CA0017.apcprd01.prod.exchangelabs.com (2603:1096:4:191::19) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AS8PR04MB9173:EE_ X-MS-Office365-Filtering-Correlation-Id: f755ef97-398c-4c49-5778-08dce13034fe X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?l2+eiSSDXaZa65YtMMFwX5TT4dtmjgD?= =?utf-8?q?qL5ssnZ8ko7HuEdYRgVIVGg2eQr+kSnFhSE/1gMoDIcb0ESjnWnR1mcXQyCU0rsuz?= =?utf-8?q?GwuCv3KPJaChRhvo5hFOOVuSdcuUlYN8ds32t4cZpfm07QKvRO6qPj128HDcv3gMK?= =?utf-8?q?IiI5rWTLhNOXCRoPL46BHZYf+16SnCD7fFLRH2KGBAAEGEYTkK/4JzoEU1pc4v/Dr?= =?utf-8?q?9xlTOH9euukRmPwOUTgEnpZmIXtH5mPymo2ooHQN81b7Gv76cP45FIVJtJ1/zmD+3?= =?utf-8?q?CyAMKjeWtS467kkWPZAxNEUndz2O7CDaZWcOSlGyvezTPdZMDtmfgdr5ymwYA1m5q?= =?utf-8?q?toD3HGDxi+5EOSpMohMnnwpkJvuLXFCS3kYz+FjT81HwfpB2M70XorftII4DlbVPA?= =?utf-8?q?rlBbgvzgODwqHX+qKiDk4IrEM7xhHLrjRMNpzzY0Uv7OWMpU+WT4kYU4Nxis605Mp?= =?utf-8?q?TehD+UngF1xIeE6KYes2YM05jTVj9G+0JnGGukTlYlHVwpTa4CuWVxEvB4VyddVQY?= =?utf-8?q?97ocnRr5wBxqxGOaoYF+kdgntE5HOpQOHCAKMsF7fHBwwHy+eoBStfGOnJRW1EC4U?= =?utf-8?q?KLcF87wR2GzpMCjXmvNRNCjTl0Tr4KLRSyq8VURer4fRUfS4F6Yk1hnZDZhnpiqva?= =?utf-8?q?u6cpxgrF8RQfK/mGbgbNU2snXOmsEABE0o+f558RLGJnJ+xeRskttyisjBZwv0rof?= =?utf-8?q?sLr+mnFjIiNmlOTL+diggumrCfmwYQsYKmcK2/+y+a5WtXDrlOmeN4QdTfTCfO542?= =?utf-8?q?8+gMsHGEdlW/Jf7ufkD0Ho3wiQ/Ze1xlkolD26XFmCVfG3XoV2bnZijZgqOzurAAj?= =?utf-8?q?PtvowKiCd/s+rkzlhJUUUHXEqnOdxyn7Y5O97cyIN1CSe1+BnCjvTc1fk6Lqn0EcR?= =?utf-8?q?QJnFTAyV8+NXuOUt9RcWyJ4Khhtdz9DLIv1j5G6MgZgiR7tQLRvaOIUWbDUL9udGd?= =?utf-8?q?O2M8M58LSEwKT6dC1j/kAfz5ht3JDkxJ5E9gqzVGCxDHWPSQrs8OSKJf1UfAeFrZF?= =?utf-8?q?xeCNfZl3S/Rm055CqjVsj8+aYYbrblYExocK0r/sWf/S4IU2TBapZU8uFVxJYAr9O?= =?utf-8?q?CA3Pv2CKEOUEjwgeQ9VobqjBvSkx0+WCIPwO6B6GmfS0biCsrIzZBjEedVsD3WJux?= =?utf-8?q?igbNzh5+WJ9MFx+d72/mFJcM4dMo+07cJMRg1F06XT4DVDsco62XOwXP7zzNRzTch?= =?utf-8?q?LCoZj/J1EIhfOPPo7Z/lRGD6iFHsytxZr/D4mP9XPMseedoYqcV3LjIZzA/5K4sgS?= =?utf-8?q?nL3sDnFTQktCMwRHYTCLWSj3+t64pxeKOVMg7H7mIVPbirztwgsA1GukFwIC8AfZH?= =?utf-8?q?e6onyIxZGBW8scslLtM6KIWI192OGzjEVkwW+ybcwLEmSiaxHQRjohA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IV3WY3xXjG934fsXlAp/8YZyLA3s?= =?utf-8?q?9BmSr3WUtQNLB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j4lvkMy4lz1yv3T5xOfLfK7cDirKk7p1ea681?= =?utf-8?q?VlWHWbN3wQTkCoYFagzaWuQ4sWcuIOLWVtedTWhOlbPMUeqzdOraGH8dnjbtveggT?= =?utf-8?q?LJ3tEuG7685osoxhC50STBGDbSi2C1qE5SEsMkNPVuidmcFhlxoOE42jHr3CjY1B0?= =?utf-8?q?wR5nkxnoEvcI2FScX8K/nCOzKpDCi8ccfF7/1D0oxtk8/jIn47yKSUcvuN/6Ftwb3?= =?utf-8?q?5Hz0qY6WsNJsIOCpi4+48Xm4em6Q+KkGbV0iYJr1jkmQEkrL/6AD5rVN/DglxoZQe?= =?utf-8?q?vFg9MGA0urZJDLaZN/7/KVLSGczYHxePOAvkJQZha/5FQbZLZiYim0C+5LTg8/l1S?= =?utf-8?q?FXf6dYdAaeS12CBzsF7gie9li8xypD/OAdssrFOjhl7feXL8cbpznqJPKFP8gwJmX?= =?utf-8?q?foJw8MszJUzMQ01nyIW+qvH6j//YTlGNarq4XcGy04BztwSuTLZZEvpnf3XIxhiuy?= =?utf-8?q?lQSRc3ZnhWdEtoECozgu6gjQl2wgVY7iyOLsmMqrJ+6wEMsnGc1DqR11mPc9J8wZm?= =?utf-8?q?bsXuw1BLErCc7tSFdk7UR/5jRuWfT9qvnRE56rCy8kOPq5O2qAHt+ynJjKBtl4Y6u?= =?utf-8?q?gCOkRo5TLSUR?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f755ef97-398c-4c49-5778-08dce13034fe X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 09:13:54.4931 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jxK/NdDT5iH+5A1ApJGD4Rm/dmIuVSayVJVIgbfj4k7ZpylebPDk1mK3JzQkL7UtadW+fCby0/nT1ZIydHe97w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9173 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_021412_193609_5AEB5898 X-CRM114-Status: GOOD ( 10.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 9d6e85bf227b..5249c8b13916 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 @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (!nor->bouncebuf) return -ENOMEM; + ret = devm_regulator_get_enable(dev, "vcc"); + if (ret) + return ret; + ret = spi_nor_hw_reset(nor); if (ret) return ret;