All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gene Chen <gene.chen.richtek@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	robh+dt@kernel.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Gene Chen <gene_chen@richtek.com>
Subject: Re: [PATCH v3 1/2] regulator: mt6360: Add support for MT6360 regulator
Date: Tue, 25 Aug 2020 17:13:43 +0800	[thread overview]
Message-ID: <CAE+NS36ZK2pq8CAcmiqiUf6Ph5RET5aO4nUPFUd-EDHVEuharA@mail.gmail.com> (raw)
In-Reply-To: <20200824110458.GB4676@sirena.org.uk>

Mark Brown <broonie@kernel.org> 於 2020年8月24日 週一 下午7:05寫道:



>
> On Mon, Aug 24, 2020 at 06:23:19PM +0800, Gene Chen wrote:
> > Mark Brown <broonie@kernel.org> 於 2020年8月20日 週四 下午7:45寫道:
>
> > > This device only exists in the context of a single parent device, there
> > > should be no need for a compatible string here - this is just a detail
> > > of how Linux does things.  The MFD should just instntiate the platform
> > > device.
>
> > Trying to autoload module without of_id_table will cause run-time error:
> > ueventd: LoadWithAliases was unable to load
> > of:NregulatorT(null)Cmediatek,mt6360-regulator
>
> You shouldn't have this described in the device tree at all, like I say
> the MFD should just instantiate the platform device.

After I replace of_device_id by platform_device_id as below, I can
autoload module.
But I can't get of_node to parse init_data.
Should I use dev->parent->of_node and set
regulator_desc.regulator_node to parse each regulator definition in
device tree?

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index e995220..444dc8e 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -328,7 +328,7 @@ static const struct mfd_cell mt6360_devs[] = {
        OF_MFD_CELL("mt6360-led", mt6360_led_resources,
                    NULL, 0, 0, "mediatek,mt6360-led"),
        OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources,
-                   NULL, 0, 0, "mediatek,mt6360-regulator"),
+                   NULL, 0, 0, NULL),
        OF_MFD_CELL("mt6360-tcpc", NULL,
                    NULL, 0, 0, "mediatek,mt6360-tcpc"),
 };
diff --git a/drivers/regulator/mt6360-regulator.c
b/drivers/regulator/mt6360-regulator.c
index 97c16a2..d525bf1 100644
--- a/drivers/regulator/mt6360-regulator.c
+++ b/drivers/regulator/mt6360-regulator.c
@@ -438,11 +438,18 @@ static int mt6360_regulator_probe(struct
platform_device *pdev)
        return 0;
 }

+static const struct platform_device_id mt6360_regulator_id[] = {
+       { "mt6360-regulator", },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, mt6360_regulator_id);
+
 static struct platform_driver mt6360_regulator_driver = {
        .driver = {
                .name = "mt6360-regulator",
        },
        .probe = mt6360_regulator_probe,
+       .id_table = mt6360_regulator_id,
 };

WARNING: multiple messages have this Message-ID (diff)
From: Gene Chen <gene.chen.richtek@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Gene Chen <gene_chen@richtek.com>,
	devicetree@vger.kernel.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/2] regulator: mt6360: Add support for MT6360 regulator
Date: Tue, 25 Aug 2020 17:13:43 +0800	[thread overview]
Message-ID: <CAE+NS36ZK2pq8CAcmiqiUf6Ph5RET5aO4nUPFUd-EDHVEuharA@mail.gmail.com> (raw)
In-Reply-To: <20200824110458.GB4676@sirena.org.uk>

Mark Brown <broonie@kernel.org> 於 2020年8月24日 週一 下午7:05寫道:



>
> On Mon, Aug 24, 2020 at 06:23:19PM +0800, Gene Chen wrote:
> > Mark Brown <broonie@kernel.org> 於 2020年8月20日 週四 下午7:45寫道:
>
> > > This device only exists in the context of a single parent device, there
> > > should be no need for a compatible string here - this is just a detail
> > > of how Linux does things.  The MFD should just instntiate the platform
> > > device.
>
> > Trying to autoload module without of_id_table will cause run-time error:
> > ueventd: LoadWithAliases was unable to load
> > of:NregulatorT(null)Cmediatek,mt6360-regulator
>
> You shouldn't have this described in the device tree at all, like I say
> the MFD should just instantiate the platform device.

After I replace of_device_id by platform_device_id as below, I can
autoload module.
But I can't get of_node to parse init_data.
Should I use dev->parent->of_node and set
regulator_desc.regulator_node to parse each regulator definition in
device tree?

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index e995220..444dc8e 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -328,7 +328,7 @@ static const struct mfd_cell mt6360_devs[] = {
        OF_MFD_CELL("mt6360-led", mt6360_led_resources,
                    NULL, 0, 0, "mediatek,mt6360-led"),
        OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources,
-                   NULL, 0, 0, "mediatek,mt6360-regulator"),
+                   NULL, 0, 0, NULL),
        OF_MFD_CELL("mt6360-tcpc", NULL,
                    NULL, 0, 0, "mediatek,mt6360-tcpc"),
 };
diff --git a/drivers/regulator/mt6360-regulator.c
b/drivers/regulator/mt6360-regulator.c
index 97c16a2..d525bf1 100644
--- a/drivers/regulator/mt6360-regulator.c
+++ b/drivers/regulator/mt6360-regulator.c
@@ -438,11 +438,18 @@ static int mt6360_regulator_probe(struct
platform_device *pdev)
        return 0;
 }

+static const struct platform_device_id mt6360_regulator_id[] = {
+       { "mt6360-regulator", },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, mt6360_regulator_id);
+
 static struct platform_driver mt6360_regulator_driver = {
        .driver = {
                .name = "mt6360-regulator",
        },
        .probe = mt6360_regulator_probe,
+       .id_table = mt6360_regulator_id,
 };

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Gene Chen <gene.chen.richtek@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Gene Chen <gene_chen@richtek.com>,
	devicetree@vger.kernel.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/2] regulator: mt6360: Add support for MT6360 regulator
Date: Tue, 25 Aug 2020 17:13:43 +0800	[thread overview]
Message-ID: <CAE+NS36ZK2pq8CAcmiqiUf6Ph5RET5aO4nUPFUd-EDHVEuharA@mail.gmail.com> (raw)
In-Reply-To: <20200824110458.GB4676@sirena.org.uk>

Mark Brown <broonie@kernel.org> 於 2020年8月24日 週一 下午7:05寫道:



>
> On Mon, Aug 24, 2020 at 06:23:19PM +0800, Gene Chen wrote:
> > Mark Brown <broonie@kernel.org> 於 2020年8月20日 週四 下午7:45寫道:
>
> > > This device only exists in the context of a single parent device, there
> > > should be no need for a compatible string here - this is just a detail
> > > of how Linux does things.  The MFD should just instntiate the platform
> > > device.
>
> > Trying to autoload module without of_id_table will cause run-time error:
> > ueventd: LoadWithAliases was unable to load
> > of:NregulatorT(null)Cmediatek,mt6360-regulator
>
> You shouldn't have this described in the device tree at all, like I say
> the MFD should just instantiate the platform device.

After I replace of_device_id by platform_device_id as below, I can
autoload module.
But I can't get of_node to parse init_data.
Should I use dev->parent->of_node and set
regulator_desc.regulator_node to parse each regulator definition in
device tree?

diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
index e995220..444dc8e 100644
--- a/drivers/mfd/mt6360-core.c
+++ b/drivers/mfd/mt6360-core.c
@@ -328,7 +328,7 @@ static const struct mfd_cell mt6360_devs[] = {
        OF_MFD_CELL("mt6360-led", mt6360_led_resources,
                    NULL, 0, 0, "mediatek,mt6360-led"),
        OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources,
-                   NULL, 0, 0, "mediatek,mt6360-regulator"),
+                   NULL, 0, 0, NULL),
        OF_MFD_CELL("mt6360-tcpc", NULL,
                    NULL, 0, 0, "mediatek,mt6360-tcpc"),
 };
diff --git a/drivers/regulator/mt6360-regulator.c
b/drivers/regulator/mt6360-regulator.c
index 97c16a2..d525bf1 100644
--- a/drivers/regulator/mt6360-regulator.c
+++ b/drivers/regulator/mt6360-regulator.c
@@ -438,11 +438,18 @@ static int mt6360_regulator_probe(struct
platform_device *pdev)
        return 0;
 }

+static const struct platform_device_id mt6360_regulator_id[] = {
+       { "mt6360-regulator", },
+       { },
+};
+MODULE_DEVICE_TABLE(platform, mt6360_regulator_id);
+
 static struct platform_driver mt6360_regulator_driver = {
        .driver = {
                .name = "mt6360-regulator",
        },
        .probe = mt6360_regulator_probe,
+       .id_table = mt6360_regulator_id,
 };

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

  reply	other threads:[~2020-08-25  9:13 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  7:53 [PATCH v3 0/2] regulator: mt6360: Add support for MT6360 regulator Gene Chen
2020-08-20  7:53 ` Gene Chen
2020-08-20  7:53 ` Gene Chen
2020-08-20  7:53 ` [PATCH v3 1/2] " Gene Chen
2020-08-20  7:53   ` Gene Chen
2020-08-20  7:53   ` Gene Chen
2020-08-20 11:45   ` Mark Brown
2020-08-20 11:45     ` Mark Brown
2020-08-20 11:45     ` Mark Brown
2020-08-24 10:23     ` Gene Chen
2020-08-24 10:23       ` Gene Chen
2020-08-24 10:23       ` Gene Chen
2020-08-24 11:04       ` Mark Brown
2020-08-24 11:04         ` Mark Brown
2020-08-24 11:04         ` Mark Brown
2020-08-25  9:13         ` Gene Chen [this message]
2020-08-25  9:13           ` Gene Chen
2020-08-25  9:13           ` Gene Chen
2020-08-25  9:26           ` Mark Brown
2020-08-25  9:26             ` Mark Brown
2020-08-25  9:26             ` Mark Brown
2020-08-20  7:53 ` [PATCH v3 2/2] regulator: mt6360: Add DT binding documentation Gene Chen
2020-08-20  7:53   ` Gene Chen
2020-08-20  7:53   ` Gene Chen
2020-08-20 11:30   ` Mark Brown
2020-08-20 11:30     ` Mark Brown
2020-08-20 11:30     ` Mark Brown
2020-08-24  7:21     ` Gene Chen
2020-08-24  7:21       ` Gene Chen
2020-08-24  7:21       ` Gene Chen
2020-08-24 19:48       ` Mark Brown
2020-08-24 19:48         ` Mark Brown
2020-08-24 19:48         ` Mark Brown
2020-08-25  9:21         ` Gene Chen
2020-08-25  9:21           ` Gene Chen
2020-08-25  9:21           ` Gene Chen
2020-08-25  9:34           ` Mark Brown
2020-08-25  9:34             ` Mark Brown
2020-08-25  9:34             ` Mark Brown
2020-08-25 10:01             ` Gene Chen
2020-08-25 10:01               ` Gene Chen
2020-08-25 10:01               ` Gene Chen
2020-08-25 10:08               ` Mark Brown
2020-08-25 10:08                 ` Mark Brown
2020-08-25 10:08                 ` Mark Brown
2020-08-25 11:07                 ` Gene Chen
2020-08-25 11:07                   ` Gene Chen
2020-08-25 11:07                   ` Gene Chen
2020-08-26 12:55 ` [PATCH v3 0/2] regulator: mt6360: Add support for MT6360 regulator Mark Brown
2020-08-26 12:55   ` Mark Brown
2020-08-26 12:55   ` Mark Brown

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=CAE+NS36ZK2pq8CAcmiqiUf6Ph5RET5aO4nUPFUd-EDHVEuharA@mail.gmail.com \
    --to=gene.chen.richtek@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gene_chen@richtek.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.