Hi Carlos, Am 29.08.24 um 11:37 schrieb carlos.song@xxxxxxx:
From: Carlos Song <carlos.song@xxxxxxx> Some i2c devices such as PMICs need i2c bus available early. Use subsys_initcall to improve i2c driver probe priority.
thanks for providing this patch. Please try to be more specific, which devices/platform has been effected by this issue. It would be nice to provide to kind of link/reference/discussion. Best regards
Signed-off-by: Carlos Song <carlos.song@xxxxxxx> Signed-off-by: Frank Li <Frank.Li@xxxxxxx> --- 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 <pandy.gao@xxxxxxx>"); MODULE_DESCRIPTION("I2C adapter driver for LPI2C bus");