[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB39167727A8B7CEDAC531D94EF59A0@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date: Wed, 17 Jun 2020 09:41:08 +0000
From: Anson Huang <anson.huang@....com>
To: Aisheng Dong <aisheng.dong@....com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
Peng Fan <peng.fan@....com>, "arnd@...db.de" <arnd@...db.de>,
Leonard Crestez <leonard.crestez@....com>,
"krzk@...nel.org" <krzk@...nel.org>,
Daniel Baluta <daniel.baluta@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH] soc: imx-scu: Support module build
> Subject: RE: [PATCH] soc: imx-scu: Support module build
>
>
> > Subject: RE: [PATCH] soc: imx-scu: Support module build
> >
> > > From: Anson Huang <Anson.Huang@....com>
> > > Sent: Wednesday, June 17, 2020 12:54 PM
> > >
> > > Change the configuration type to tristate, add module description,
> > > author and license to support module build.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@....com>
> > > ---
> > > drivers/soc/imx/Kconfig | 2 +-
> > > drivers/soc/imx/soc-imx-scu.c | 5 +++++
> > > 2 files changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig index
> > > d515d2c..c255acb 100644
> > > --- a/drivers/soc/imx/Kconfig
> > > +++ b/drivers/soc/imx/Kconfig
> > > @@ -9,7 +9,7 @@ config IMX_GPCV2_PM_DOMAINS
> > > default y if SOC_IMX7D
> > >
> > > config IMX_SCU_SOC
> > > - bool "i.MX System Controller Unit SoC info support"
> > > + tristate "i.MX System Controller Unit SoC info support"
> > > depends on IMX_SCU
> > > select SOC_BUS
> > > help
> > > diff --git a/drivers/soc/imx/soc-imx-scu.c
> > > b/drivers/soc/imx/soc-imx-scu.c index 20d37ea..bdd43ed 100644
> > > --- a/drivers/soc/imx/soc-imx-scu.c
> > > +++ b/drivers/soc/imx/soc-imx-scu.c
> > > @@ -5,6 +5,7 @@
> > >
> > > #include <dt-bindings/firmware/imx/rsrc.h> #include
> > > <linux/firmware/imx/sci.h>
> > > +#include <linux/module.h>
> > > #include <linux/slab.h>
> > > #include <linux/sys_soc.h>
> > > #include <linux/platform_device.h>
> > > @@ -185,3 +186,7 @@ static int __init imx_scu_soc_init(void)
> > > return PTR_ERR_OR_ZERO(pdev);
> > > }
> > > device_initcall(imx_scu_soc_init);
> > > +
> > > +MODULE_AUTHOR("Anson Huang <anson.huang@....com>");
> > > +MODULE_DESCRIPTION("NXP i.MX SCU SoC driver");
> > MODULE_LICENSE("GPL
> > > +v2");
> >
> > I'm ok with the change. But I'm curious how can this module be
> > autoloaded without MODULE_DEVICE_TABLE.
> > Have you tested if it can work?
> >
>
> I ONLY tested the manual insmod, if want to support auto load, may need
> some more change, will try it later and send out a V2 if needed.
The further check shows that, if want to support auto load, the platform device
register needs to be done in somewhere else which is built-in (in my test, I move it
to clk-imx8qxp.c's probe), and also need to add below module alias in this driver,
because it has no device node in DT and no device table in driver.
+MODULE_ALIAS("platform:imx-scu-soc");
Since this driver has no device node in DT, and the target is to build all SoC specific
drivers as module, so the best way is to add a virtual device node in DT in order to support
auto load?
Anson
Powered by blists - more mailing lists