linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alice Guo <alice.guo@nxp.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Peng Fan <peng.fan@nxp.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [EXT] Re: [PATCH v3 4/4] soc: imx8m: change to use platform driver
Date: Thu, 19 Nov 2020 07:32:17 +0000	[thread overview]
Message-ID: <AM6PR04MB6053E8B7B16148887482F7A4E2E00@AM6PR04MB6053.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20201118141042.GA34654@kozik-lap>



> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 2020年11月18日 22:11
> To: Alice Guo <alice.guo@nxp.com>
> Cc: robh+dt@kernel.org; shawnguo@kernel.org; s.hauer@pengutronix.de;
> dl-linux-imx <linux-imx@nxp.com>; Peng Fan <peng.fan@nxp.com>;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org
> Subject: Re: [EXT] Re: [PATCH v3 4/4] soc: imx8m: change to use platform driver
> 
> Caution: EXT Email
> 
> On Wed, Nov 18, 2020 at 02:07:41PM +0000, Alice Guo wrote:
> >
> >
> > > -----Original Message-----
> > > From: Krzysztof Kozlowski <krzk@kernel.org>
> > > Sent: 2020年11月18日 18:42
> > > To: Alice Guo <alice.guo@nxp.com>
> > > Cc: robh+dt@kernel.org; shawnguo@kernel.org; s.hauer@pengutronix.de;
> > > dl-linux-imx <linux-imx@nxp.com>; Peng Fan <peng.fan@nxp.com>;
> > > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> > > linux-arm-kernel@lists.infradead.org
> > > Subject: Re: [EXT] Re: [PATCH v3 4/4] soc: imx8m: change to use
> > > platform driver
> > >
> > > Caution: EXT Email
> > >
> > > On Wed, Nov 18, 2020 at 10:28:47AM +0000, Alice Guo wrote:
> > >  >
> > > > > If it is properly explained and there is no other way then yes,
> > > > > you could. Here, for old DTBs, I would prefer to use
> > > > > of_platform_device_create() and bind to "soc" node (child of root).
> > > > > This way you would always have device and exactly one entry
> > > > > point for the probe.
> > > > >
> > > >
> > > > static struct platform_driver imx8_soc_init_driver = {
> > > >       .probe = imx8_soc_init_probe,
> > > >       .driver = {
> > > >               .name = "soc@0",
> > > >       },
> > > > };
> > > > Can I use "soc@0" to match this driver? It will not use
> > > > of_platform_device_create(). It will use of_find_property() to
> > > > determine whether and nvmem-cells can be used. If there is no
> > > > nvmem-cells,
> > > it will use the old way, which supports old DTBS. There is no need
> > > to add new compatible.
> > >
> > > No, the soc@0 is not a proper name for the driver.
> >
> > I have no good idea, please give suggestion. Should I still add new compatible?
> > Should I still keep device_initcall? If use
> > of_platform_device_create(), which node should I use?
> 
> I mentioned my idea in the email before - of_platform_device_create() to bind
> to the soc node. This will have to be in the initcall, you don't have a choice to
> avoid it, since there was no compatible before.
>

	node = of_find_node_by_path("/soc@0");
	if (!node)
		return -ENODEV;

	pdev = of_platform_device_create(node, "XXX", NULL);
	if (!pdev)
		return -ENODEV;

Cannot use of_platform_device_create because "of_node_test_and_set_flag(np, OF_POPULATED)" returns true.
of_platform_device_create is used to create platform device, but soc@0 is created by common code. I don't know how
to bind to the soc node. The way I did in v3 seems not bad, it can work correctly and support old DTBs. Can I keep this way?

Best regards,
Alice Guo

> Best regards,
> Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-19  7:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 11:04 [PATCH v3 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
2020-11-13 11:04 ` [PATCH v3 2/4] arm64: dts: imx8m: add compatible string to .dtsi file Alice Guo
2020-11-14 15:57   ` Krzysztof Kozlowski
2020-11-16  7:12     ` [EXT] " Alice Guo
2020-11-13 11:04 ` [PATCH v3 3/4] arm64: dts: imx8m: add nvmem-cell related stuff Alice Guo
2020-11-14 16:00   ` Krzysztof Kozlowski
2020-11-16  7:16     ` [EXT] " Alice Guo
2020-11-13 11:04 ` [PATCH v3 4/4] soc: imx8m: change to use platform driver Alice Guo
2020-11-14 16:41   ` Krzysztof Kozlowski
2020-11-16  8:18     ` [EXT] " Alice Guo
2020-11-16 16:13       ` Krzysztof Kozlowski
2020-11-18 10:28         ` Alice Guo
2020-11-18 10:42           ` Krzysztof Kozlowski
2020-11-18 14:07             ` Alice Guo
2020-11-18 14:10               ` Krzysztof Kozlowski
2020-11-19  7:32                 ` Alice Guo [this message]
2020-11-19  9:42                   ` Krzysztof Kozlowski
2020-11-14 15:55 ` [PATCH v3 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Krzysztof Kozlowski
2020-11-14 16:49 ` Krzysztof Kozlowski
2020-11-16  7:04   ` [EXT] " Alice Guo
2020-11-16 16:03     ` Krzysztof Kozlowski
2020-11-17  7:12       ` Alice Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR04MB6053E8B7B16148887482F7A4E2E00@AM6PR04MB6053.eurprd04.prod.outlook.com \
    --to=alice.guo@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).