From patchwork Fri Sep 20 08:54:07 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: 13808355 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 6E274CF58F5 for ; Fri, 20 Sep 2024 08:57:25 +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=kKT+WjcRy2Jdf9Ju7fmeJI7MqkqP2sH/kdhJMlZ4Jsw=; b=1OHbl89GlKug1nwIhSb9X47uOz B7yqBWB58RbL0BjdgRH0Yk1HYBmma9FmE7skqG4KDcIHNN1Hqgna8cHF70MRUmsq5bpaZsLoUbkUE 4K8Q35ymiK+OOrqovaFhTy1zdCOi3ZoKE/kP2wmoJNzwyroWxsP2ZqNrY0YrLFDTmqpM3JmELgwxs FpYqgjQzsM/ZLEkvqxD59j/jbdoRmr0ZqPLXKZjn3z7KPQoakME2y1ieezgFIGEp2+wN/6l/yD7fH DoEo22/poEVjJ5gNHa+EAwJOLjHNkKBUS/snKW5iklXa1J8jXgQWPEIMSqybg8TuVyPF9usvMo1rB WINwtYIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srZRy-0000000Br6F-0EFb; Fri, 20 Sep 2024 08:57:14 +0000 Received: from mail-am6eur05on20609.outbound.protection.outlook.com ([2a01:111:f403:2612::609] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srZGq-0000000BoeZ-0xcC; Fri, 20 Sep 2024 08:45:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gWNIblSmNE2SCTlPNIpOvySE/j71dFl8M967VZuOXYiZyEmwi1hU6r4eTlq+NXkLHyztO4+6Exerw8bziXRUdzjnRTTWIEsjtns2my4iAp4/ROemztKRh+d1tqNd16MdANbh4B2TIzsN6YsjV/+cHUlkrb8NK1/cdwoPgn3fVujmQGRtjoZ8w8HjdZp8+Zlq0M8X5Y3dqwomp0D2BCdc/++80EUN+A7Y+tsukNKi4j3biYLmHAs87PPQjRdP/L8ZV+MlYk0STOwTkq9KKmL+YiQXX/A3HYnk3t8pFhAzb8DS3FupEejp2HmqrKTJ6BDoFPasVvhf9UtnQD9fS6ThVQ== 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=kKT+WjcRy2Jdf9Ju7fmeJI7MqkqP2sH/kdhJMlZ4Jsw=; b=L1frqQzXdwIkzO4tbpImzc7Ws8urNmAY0jJZ+z2jWXj1eWUTWjOk7jKqxjs3WplPT+VtKRYG6K+8M0Wq8Zl/o+tvEIPlEJPzL5YuAY7txpAViuATYc/zFW0QrtkKJ57DirWRrXnGaSSx+Q59tyygybs6rnDSUuO6o7rr2Jp0AxmLSUPkpXYw9+KyjxiPGrBBvzg8ZnNVAdI3VzuVZmF3EFNykIyINAT6D41P9KanRgtBfQ/3J4bJQW5ah+PukrY3idCHC5K7kv4CwJx+9w+r8PEDpWaJS2RQLpYwP2ZWsMdq9qEEUTvOy2j+3cIlDEJ8m0ckQ47J11dllHevHUMUeQ== 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=kKT+WjcRy2Jdf9Ju7fmeJI7MqkqP2sH/kdhJMlZ4Jsw=; b=oHjbftqhRlrwPD6tRJUqdJClA9aSX+F5C96flMvQheSWmI7xl6XyaLSLf6xGclM2gWfmr+HsTmv4U/Dn7PcwlW69f0nNZqyxjrh7yZES6re2M4TaiEwvKdHIgEwxwtK1du3AwfjJrIOM/zYg/4W3+RhjannMGDr7IBgNexUaeAOvi9dz/0deARHosB2XZlwdTJm9mu2aW6pRThKFPYRoAPQ70zOtUft94IeoVbkcWVUppmFBnTacPFQ035p/5vzWaMUza38WabzKbwJKbvU3a7e+6ua4BbKngYxOKgVP6bnNZTXMG7dMCcuoq9Z4W+XNw1F8JY19aWFAN6L1nvFjdg== 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 VI0PR04MB10613.eurprd04.prod.outlook.com (2603:10a6:800:25f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Fri, 20 Sep 2024 08:45:32 +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; Fri, 20 Sep 2024 08:45:32 +0000 From: "Peng Fan (OSS)" Date: Fri, 20 Sep 2024 16:54:07 +0800 Subject: [PATCH 2/3] mtd: spi-nor: support vcc-supply regulator Message-Id: <20240920-spi-v1-2-97f220c2e10c@nxp.com> References: <20240920-spi-v1-0-97f220c2e10c@nxp.com> In-Reply-To: <20240920-spi-v1-0-97f220c2e10c@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 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=1726822454; l=1012; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=3PKCZ8dMAK7a/VbQbbFq/RL7XYZ1/SiYfBLf6uYUjBc=; b=e/bcw0WOzkxxJnJofth9F7KBbBqUL2V3ptQz/kmqt4yClw2HvJB7vXAhmYZZ5AxNnIsXAAZcL oTehqf1YfmXCncQIg8zZEkUu44KYg8GvfpKmNon3JOOcrgwL9Bx7O+i X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0035.apcprd02.prod.outlook.com (2603:1096:4:1f6::8) 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_|VI0PR04MB10613:EE_ X-MS-Office365-Filtering-Correlation-Id: 58f76eaa-cb89-4484-fa66-08dcd9509671 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|376014|7416014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?LLK8Ns0A24zql5RjkxjZmDtw/hKysDy?= =?utf-8?q?IPbaWVvXks3ZCQs4E/XVaWYumnkcDFk0JLlYqw1O/uaCQ5PwCGoXITeb5/vwxPgeT?= =?utf-8?q?Ky2hIXFUefNvC+rCFJCwk7LniKNXqhWVFwjEmYQPwM96CGY7io9n71zYYBYyzvxb2?= =?utf-8?q?9HbAySaMOF+bENHKu6ECjLPzUC0muSsre7zSMYLLFOG0pU8a+QJY53S+fzxrdhAHI?= =?utf-8?q?K6emsi0EsckxIhMNQHpxS/rDUMB9zb4vVo6BJtwcYpUlfCeFX0FqnhpfM/Cgp4IgF?= =?utf-8?q?w+wDPGbBiHW4ymWzorvqx7OUu5whyQIYWn0W5IWWDlbm2vpMusGJJbR1LQvjFU9JQ?= =?utf-8?q?rvESjCYfzaIH4TnNDRrsZRabAwSKTFwxW6Cc2cqxOvjeTzkjKbufxufE0Q8bnOmZQ?= =?utf-8?q?suliTPb/hz+V8qPBT6HIXDbH8vNkIBXEdVTqGjhTamvoIWBKAW/91R0fF62EGOIrm?= =?utf-8?q?bCs+qopeFY3bGuGy4tyZaUoX4us2NULvYW0lQSP/D8RCfQxS9KJwk4tFDkk7dMM5D?= =?utf-8?q?WNvTM2TDQa7dfqCKjqYtOekVJGmUOzPYzK2b7hjvUeBjjkQww6MxKaOp7mvpzGFa5?= =?utf-8?q?Ow15C9eKd/TsNjfXOnxl7kBZG9rd5wvag/ZcF65lzLAi/dUofJtakeDkO/N738vo2?= =?utf-8?q?Qn669V84hX08D2a9sqHMzCoGfbmhv1NLnhfs3480IA7RrOTza+kKsl2Ogf0K4efAh?= =?utf-8?q?PhGCchVY+pEIyWVdYvz33oAtiixr6JAJk8hCOZaAQmYHiPuvFzvBuSXN46wj7gLQK?= =?utf-8?q?9N0x8Yx5eosNBZu+xMQXpUyBuYIFARURQsC0e69r+SmAGs9G52p7Y9C4x1xuM28pM?= =?utf-8?q?Lzegp4+P0dc4lczV0/Tuvzilg/Xh3g3UKOVM2yQU6G2/JfEtv36W0vfT57DOLJKlo?= =?utf-8?q?g4sXhXbHgDn1dX/KGAJ6YssFPAevDkxb8Tr7h7fOwJ2ge+uiViqbQ/I9fX88EJf6Q?= =?utf-8?q?pZpDSIuts5UF6Ggl8Ktd5XN6E69NiQFtpCYxYNrADx++CKH6bBYWV2GcMhAAUj/e4?= =?utf-8?q?qdizysAeGorJWwjDPncU/jsxD+8J4/pqZVi8qIRy9xfkBa0n1xDAjVngTqRf1QGh5?= =?utf-8?q?P00HU4t6de0tXCgc1p0Z0xPtSiLr7hjk5y5DyOqBhXgXJAItDVNMFQvRCK9t75oAH?= =?utf-8?q?e+kXfYlt3tELNl7z1oXpfc4VZ/e1B/2ckfFXCdihZijTOy+YGn7GLiPUB5CQqQJc0?= =?utf-8?q?rtik6+K4KNT93Vqjy6OlRG4LPokzPio/l1bVOjvcLErFBNYKKTcqa4FcR/DfG8yrk?= =?utf-8?q?UJD6GZ3Zc/RCKNH2orgeI1y3JmhPQSFETypUD5oO9RDADtMIZiFubaW04UAuh2ok2?= =?utf-8?q?NzTFnyLfNHPREQyNsg4cWiAcg+/5RZ0/AiyRLRDcQe0TcObapsiA8Io=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)(376014)(7416014)(366016)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kg4Z7ybR0RPrPOf/0gzRxvX+xC4A?= =?utf-8?q?Hez2qAj+/kdc9jWku/D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1Qj27kkUPOkeHlirv2mp5pBAnhq?= =?utf-8?q?6ExS3vqpuSoiAcEp4wDm3GZEWUfoNUuZr15kgGihoAvKTC6p75umN3kEFKwymwIMj?= =?utf-8?q?elZxriNg5JUbU/JNl6ka7ti4XTXtFJehiZTxdFPbViNlpoQK1yYBrChFP0cyOA/Eo?= =?utf-8?q?6eaIr4iL9Ni2BD2Zq4F0pVVozTL//X4lC72vgEI7RKK6ZhnX+4nTrATxXByZiEh+l?= =?utf-8?q?y7TB8TyvyXLMFauyG3n0GRZTUVCeiKVcARelWTDq7fMTfWQ/RuE8GCWusCvNtZfXP?= =?utf-8?q?xlXpp2ZhozIP+iWX/CulPgdjKZlm/8gFDt6E3xpsnfx+cJbmnaZ+8NwRVr5D6N+Y5?= =?utf-8?q?tdoR3XM8WSPVOBOFeqfgk8ZUlkD0Ywtaqm7Asyb0XTUD1bs1Pq/xLboavtV+3dDE7?= =?utf-8?q?40IiKk4agJag7ZcZH7lKrDOVHt04XcnPUr23a3HR3FFH2g3q23GT2GKBDcA7ShDUP?= =?utf-8?q?TGXkh9U1JB9qY0PHZk+5x/ARoK8w4hoteiP5I/7hDBkaUc/ZZg5ZZGAuFxbgz+ajE?= =?utf-8?q?VUs6U3pKbKoZ/NrRi3js1IqTeEBCuCgLn+FyQoGsi2wyJN5N/DMp5yKMH6+EmlVeJ?= =?utf-8?q?XCw9At7BX5kV?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58f76eaa-cb89-4484-fa66-08dcd9509671 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 08:45:32.5549 (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: ovfh/QOdorPtvcQrDEyBLbnQ59U3PSAHNQcxeyrf4vgirdHRuEgYsk74uT37srSrO+876l+bwvVAxO6sGooTbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10613 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240920_014544_396653_64CA257F X-CRM114-Status: GOOD ( 10.46 ) 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 flash needs power supply to work properly. The power supply maybe software controllable per board design. So add the support for an optional 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..0449afe6bb20 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_optional(dev, "vcc"); + if (ret) + return ret; + ret = spi_nor_hw_reset(nor); if (ret) return ret;