From patchwork Thu Aug 29 09:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Song X-Patchwork-Id: 13782897 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 22CDBC83027 for ; Thu, 29 Aug 2024 09:39:41 +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:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gp4GgA7Mm7Oj0qc0hxDX/KF5Sbz3oN80xvpa7T0203s=; b=werxpPiVwx5PhayN64SwJSFwfV kIVmaVOmcP6E2wK1CMUcfDxSpExvVgbSEcCyL6zdVphkxy4ecb3wjgAJyJyIwGj0Q8CCSEPcl0++t XUyN5NWAVa6d3cmwhnHAjnnl2sYAP8wid/x+c2NbDNdls4HMVjlXLhgaqa/xhHcq8Ith/krC7iCZ1 jFAjrzq0DD0IiKg92Hf5JWtRfvArBZ/7w6ocH2Ngcke8W3tpEl21oj8mKxEwXULsZ9j2bEzzo84so pWv0oBsNvv3wxjsEbyktu3yQ6DoNTqkCd9Ctxu2/mdmDsTLriUnMslpZU8PR//Jd3vABA2nYfH/yA w9kvExdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbcb-00000001Oke-3zbs; Thu, 29 Aug 2024 09:39:18 +0000 Received: from mail-westeuropeazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c201::] helo=AM0PR83CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjbSL-00000001MOz-2shr for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2024 09:28:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jUC6/i6NhHWiiuDxZXQRzMsuCBjzIsJLLf3KHdTdfzgvN8Stfl9+cUekiPX85fqlQJjh6w1rU5v7cxMfLGvhC5ctoyC/4hgas9ctgmR/wwZgABrMtLwnAMbJ2/9xN8VnvdC4DV/TWa+Jwu8Tz8RnecfPSDpMeOfhkl0DOTeZIyDHWLzbSCyO3tvPn19s54d3fEjLGOb+TS3+nlJsM73dH/uEd5EaQTZQRIac6LgnTiwDJj3IZIZaYeVwCXehtvci30ovpQsYyKmtnf3vZY+CIp+62i839rP6853DGGc/KoLF9BW+ID9wY+yC2UQGVD1yIFUC2NDoVzYqd5TzkaEq4g== 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=Gp4GgA7Mm7Oj0qc0hxDX/KF5Sbz3oN80xvpa7T0203s=; b=sdWbneVsHWBX76rG4jp7m4YEz1C3DRueubPHjsqoe5gVGM5hRcYaNZComD6O1WLA+sbJqe0io1DLgem6S11uO8+Az6DOkleFgP+NyNmWZI2f0k1szQMKUDXeS5BpOnDIM/dvXpjX9d8/LZj6FtPL4K1NTv/Sb4JYwKg7SK2lDW4uIEenVL0d7GZ02gT9C1YD4VZSSNA33ttnHj7Clm7yacc+kUxlvvXq5M32YWPiXLNPfmKf3O/q/hVYe2bAVPU3mi7KYZWMhe1hLgXM5vSUMxlMcnarw2Ttk11Bmw/heQF4utobdM8r4D9RcbNWZ1uFjIRjUu+slvuTHAQhwK2qfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gp4GgA7Mm7Oj0qc0hxDX/KF5Sbz3oN80xvpa7T0203s=; b=XxO+z55cUdAvgrmGvfgAMgzWFfSSHnOqE5UacrWaf4ymWJ/K6aqEGGr1znDq0cOhgToo65PspqxlVkyqvMM2JRgwWnCyKWg6H9oJDeRCnvtJosHoqMk6/JU3+Fx9yBEFrnaR38jMUNP4QgsAqFuOi+hWrX0MlO4OFN+Ls0aS9urSTIkdGLWSW314aGPZkTvatdeHYT4i5kTkOt1wl9FChOjJMWOGtvXnfJkYrq6QzJRNZPsg6Uel85SA87jq6pvs1pKQpKA259RaNzcE5e6RUqDjK1s9QaDsJUXmDiFJlc9O+uORhQtae4cyzHyQGRzGCeXb+h0L0bVW25gCAYiGyg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5005.eurprd04.prod.outlook.com (2603:10a6:803:57::30) by AM7PR04MB6902.eurprd04.prod.outlook.com (2603:10a6:20b:107::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 09:28:39 +0000 Received: from VI1PR04MB5005.eurprd04.prod.outlook.com ([fe80::3a57:67cf:6ee0:5ddb]) by VI1PR04MB5005.eurprd04.prod.outlook.com ([fe80::3a57:67cf:6ee0:5ddb%4]) with mapi id 15.20.7897.021; Thu, 29 Aug 2024 09:28:39 +0000 From: carlos.song@nxp.com To: aisheng.dong@nxp.com, andi.shyti@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-i2c@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] i2c: imx-lpi2c: improve i2c driver probe priority Date: Thu, 29 Aug 2024 17:37:21 +0800 Message-Id: <20240829093722.2714921-4-carlos.song@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240829093722.2714921-1-carlos.song@nxp.com> References: <20240829093722.2714921-1-carlos.song@nxp.com> X-ClientProxiedBy: AS4PR10CA0023.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::15) To VI1PR04MB5005.eurprd04.prod.outlook.com (2603:10a6:803:57::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5005:EE_|AM7PR04MB6902:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c61b6fa-469b-4ed6-3f47-08dcc80cf73d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: UIXbePhVHwPYyczxYKOZmS6Y4naa5BFNn6ZJ4JKi0veuql/jXdawnLUkOLVfVwHMOhO8jN/v2c8OAhGyPQM5qSepjEbRwLrTf/KnmRtG7ECC/TQwouA6lxwy1UDoFGJVAhxxDKwINQoR+KECrC7mTJb4+zSP6Y3+uy3ReP60l3i6qp6y2V3MJaunZuDPvX4uJg/Dnek/a9sLgMkQQdW1boZ7FurfNVczX5mpjo1XYpwFXTFEPBwahCNq37uujkU5dI3L2CU1QZlqHgBM0D0tjWj2nTrDYeNpGMV8yHeFcmK6deqGMnz3soavqPDT6SLGlRzdk1k103mTR9LE+4IgEZbDz1Ma/eEynAD67+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-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5005.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JcLkTcNB/VNLNUd18jCjAz4kT4QPjGAnIXt/HdNmlR1yabbA6r3FVul47bXaDnPNpiQmxw0I6HuwjwYbcJ6Ii54Y4CiUr9xDDzDhhr9Uw/7sxR1aJ4EDEsn7xQfw1hw/Pw3WnL+/b1K2Dt5m7BQzIez2ljHAHCeBFyT01ndifHU8TpxaYT6sVwRZ7pgRpOeek3HQKYdduipfMwdeSejdajI12QF3jFVLL7bJK6v3hvFtJvzDIUmOI0Hw/lxLqxr7exKZA9joYv3ZhFiOpTV9NlTNkDKBisprvAyE3nBZASnRKGs1WpaoRmmQV3cmUbEb3WHMUk0F9S+GlRoYAud8IxZsWDjqI7/daxFCjzPWtmyKvOEhbNGw/ZSJUcW6Fx4bU2sMH5pWAGGwtGIPwXwQzqSSb6+alO55K2FfRzEjWqSyK8t8R0UJUoSvoG/nglIW329V7qnw2cMSivc1sg+DvnE/KkW9n8Ur5ihu5TQqSDyCY/ddoyRdW9iZVSTKks+Y/3BLqJy8VWeUv9wuAjzSC1ZWujRByu0T9zlriqluQ5Y8VDJo4Qjp9s1E25BvZyhT7FX97u2Za0dTSQQluzJbxtr/7mv4QzTV5oAOwPR/Z0r6Gh0F2h+vwcnotTSl4PBOVxYCjwHN8eA7NcsprL4NW4cUFakYRZo/i0ttnhUe+7d+WYvaXa2C6Qicj2322gZmC/SWs3rNEvg2tt9zJMZJQrbjDNBXD8jbB7Zw5SP3TYYAV8rKDFKhT6i0JVAzJRawAXrW9Z49nlI53YidqJwz3Mlix3GTtEKZeMPuGuM1Ind6MoC1JSXOTdBvktxu1B4Wq9+gsbz3G3mER0Yl/yHaRrM92f0171KQD3tqi4CV6aWojRZ7gEiSUHTbQ5zYWVI6GYAvOqciCcNjqK4RUfnLOP6O1Iwoe99lAI3Cr+zXObCy7B21TU085ronjNKYiFwuqupw4PHX1GbiIeh91XaYXJJeuOkdtTOUgPI32cyTJFdEpXO8/4xtl5RVaWZ4DDRkZwj62HONIZ30F+OufWIyGe18QZRtMkjrppTCYCBHmV2aha5LEkRl4whPhTWvvEMbghw5PHW0qha/uDPcYjz2shE9z+JqLxDx2rjhDKKtqn8DRDE+1gynfECcEQks2CIAhIX8hW415F1S2VxI7PQKsS7mquR1VteLQ6KLWDtEuNzyZZpS7qYyqNWuhkGQ/FcsJnsuY/37E6VsLQ7EDsJhrQiknMHmj0okjYArZrXQlQBjktQA0SPxYJfVjV0EOBsNrjKXjYWsJCh2aEIr31Yu2dSOpmdyZPF6y2CkltmER1ewhaxKAWPjQRZQwSE+W0SSOgKDHtKuflv7Vg0hzWcumyoIAOq5uoflNPdA5hzEPvGpxdWhI4X1h5T3CMG6wOdxWodC+Ar+tw0a4BlNQKWnHRvM85LO3m0V48lOIlabMOwx8W3WzOiVTG7HTzZnKsBdLU7g9WTCAdImforpRC5ZVT4T9BPtGs5JbrlKLszTJV6DgHBv8rUrn+sWG/hc8Kd1pW986BMriSDaOnnc4Fe1SUgyd27DHocZGART9Wta1wmTV91P7StVzRcD3FAi9HXn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c61b6fa-469b-4ed6-3f47-08dcc80cf73d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5005.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:28:39.6759 (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: /7uNAV4SlP84LoQqvLlinpJnTTeqlplqQJMOpF5lvGEdubVNDAI5Ci4JSEl2OEEKEuMKG0g4VgqQRGP1zBPUdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6902 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_022841_754169_0DCD792A X-CRM114-Status: GOOD ( 12.00 ) 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: Carlos Song Some i2c devices such as PMICs need i2c bus available early. Use subsys_initcall to improve i2c driver probe priority. Signed-off-by: Carlos Song Signed-off-by: Frank Li --- drivers/i2c/busses/i2c-imx-lpi2c.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c index 0159ade235ef..210d505db76d 100644 --- a/drivers/i2c/busses/i2c-imx-lpi2c.c +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c @@ -1487,7 +1487,17 @@ static struct platform_driver lpi2c_imx_driver = { }, }; -module_platform_driver(lpi2c_imx_driver); +static int __init lpi2c_imx_init(void) +{ + return platform_driver_register(&lpi2c_imx_driver); +} +subsys_initcall(lpi2c_imx_init); + +static void __exit lpi2c_imx_exit(void) +{ + platform_driver_unregister(&lpi2c_imx_driver); +} +module_exit(lpi2c_imx_exit); MODULE_AUTHOR("Gao Pan "); MODULE_DESCRIPTION("I2C adapter driver for LPI2C bus");