All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "matthias.bgg@kernel.org" <matthias.bgg@kernel.org>,
	"mbrugger@suse.com" <mbrugger@suse.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"gene_chen@richtek.com" <gene_chen@richtek.com>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"chen.zhong@mediatek.com" <chen.zhong@mediatek.com>,
	"axel.lin@ingics.com" <axel.lin@ingics.com>,
	"hsin-hsiung.wang@mediatek.com" <hsin-hsiung.wang@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2 1/3] regulator: mt6360: Add OF match table
Date: Mon, 11 Jan 2021 10:32:18 +0000	[thread overview]
Message-ID: <ef659bcf62c9bfcf68359f21a9c9cd0093b9b969.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <8a5b2d7a-cd31-ecbb-bdc2-35c881c9068d@suse.com>


Hello Matthias & All,

On Mon, 2021-01-11 at 11:08 +0100, Matthias Brugger wrote:
> 
> On 11/01/2021 03:18, gene_chen(陳俊宇) wrote:
> > [ Internal Use - External ]
> > 
> 
> Please don't top-post in the future.
> 
> > Hi Matthias,
> > 
> > I discussed OF match table with Mark in previous mail in our PATCH
> > v3,
> > MFD should just instantiate the platform device.
> 
> Did you ever test that? Which MFD driver should instantiate the
> device?
> I had a look at mt6360-core.c (the obvious one) but I don't see any
> reference to
> the regulator [1]. What am I missing?
> 
> > > 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.
> > 
> 
> Well from my understanding the regulator has a device-tree entry [2],
> so it
> needs to match against a device-tree node. My understanding is, that
> you need a
> the devicetree node to describe the regulators provided by the
> device. TBH I'm a
> bit puzzled about the comment from Mark here. How does another DT
> node be able
> to reference a regulator if this is not described in DT? I think we
> need a DT
> node here and the matching in the regulator and MFD driver to get the
> regulator
> loaded via udev.

Others are better to answer - but as I spotted this from my inbox I'll
give my 2 cents :) 

This can be done W/O regulators having own compatible. Please see
following:

drivers/mfd/rohm-bd718x7.c
drivers/regulator/bd718x7-regulator.c
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml

as example.

The device matching can be done via platform_device_id table.
I think the MODULE_ALIAS() is needed for module matching - but I don't
remember without further code browsing.

Anyways, the BD71837/47/50 DT entry without compatible for
clk/regulators do probe and load the sub-devices.

As a "tradeoff" subdevices must retrieve the DT node from the parent
device.

For my uneducated eyes the DT binding for regulators should be changed.
Compatible should not be required and the example node should be moved
to MFD binding document in the MFD node. But that's just my view on
this - not willing to push this to any direction!

Best Regards
	Matti Vaittinen

--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland
SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~

Simon says - in Latin please.
"non cogito me" dixit Rene Descarte, deinde evanescavit

(Thanks for the translation Simon)


WARNING: multiple messages have this Message-ID (diff)
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "matthias.bgg@kernel.org" <matthias.bgg@kernel.org>,
	"mbrugger@suse.com" <mbrugger@suse.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"gene_chen@richtek.com" <gene_chen@richtek.com>
Cc: "axel.lin@ingics.com" <axel.lin@ingics.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"chen.zhong@mediatek.com" <chen.zhong@mediatek.com>,
	"hsin-hsiung.wang@mediatek.com" <hsin-hsiung.wang@mediatek.com>
Subject: Re: [PATCH v2 1/3] regulator: mt6360: Add OF match table
Date: Mon, 11 Jan 2021 10:32:18 +0000	[thread overview]
Message-ID: <ef659bcf62c9bfcf68359f21a9c9cd0093b9b969.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <8a5b2d7a-cd31-ecbb-bdc2-35c881c9068d@suse.com>


Hello Matthias & All,

On Mon, 2021-01-11 at 11:08 +0100, Matthias Brugger wrote:
> 
> On 11/01/2021 03:18, gene_chen(陳俊宇) wrote:
> > [ Internal Use - External ]
> > 
> 
> Please don't top-post in the future.
> 
> > Hi Matthias,
> > 
> > I discussed OF match table with Mark in previous mail in our PATCH
> > v3,
> > MFD should just instantiate the platform device.
> 
> Did you ever test that? Which MFD driver should instantiate the
> device?
> I had a look at mt6360-core.c (the obvious one) but I don't see any
> reference to
> the regulator [1]. What am I missing?
> 
> > > 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.
> > 
> 
> Well from my understanding the regulator has a device-tree entry [2],
> so it
> needs to match against a device-tree node. My understanding is, that
> you need a
> the devicetree node to describe the regulators provided by the
> device. TBH I'm a
> bit puzzled about the comment from Mark here. How does another DT
> node be able
> to reference a regulator if this is not described in DT? I think we
> need a DT
> node here and the matching in the regulator and MFD driver to get the
> regulator
> loaded via udev.

Others are better to answer - but as I spotted this from my inbox I'll
give my 2 cents :) 

This can be done W/O regulators having own compatible. Please see
following:

drivers/mfd/rohm-bd718x7.c
drivers/regulator/bd718x7-regulator.c
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml

as example.

The device matching can be done via platform_device_id table.
I think the MODULE_ALIAS() is needed for module matching - but I don't
remember without further code browsing.

Anyways, the BD71837/47/50 DT entry without compatible for
clk/regulators do probe and load the sub-devices.

As a "tradeoff" subdevices must retrieve the DT node from the parent
device.

For my uneducated eyes the DT binding for regulators should be changed.
Compatible should not be required and the example node should be moved
to MFD binding document in the MFD node. But that's just my view on
this - not willing to push this to any direction!

Best Regards
	Matti Vaittinen

--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland
SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~

Simon says - in Latin please.
"non cogito me" dixit Rene Descarte, deinde evanescavit

(Thanks for the translation Simon)

_______________________________________________
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: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "matthias.bgg@kernel.org" <matthias.bgg@kernel.org>,
	"mbrugger@suse.com" <mbrugger@suse.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"gene_chen@richtek.com" <gene_chen@richtek.com>
Cc: "axel.lin@ingics.com" <axel.lin@ingics.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"chen.zhong@mediatek.com" <chen.zhong@mediatek.com>,
	"hsin-hsiung.wang@mediatek.com" <hsin-hsiung.wang@mediatek.com>
Subject: Re: [PATCH v2 1/3] regulator: mt6360: Add OF match table
Date: Mon, 11 Jan 2021 10:32:18 +0000	[thread overview]
Message-ID: <ef659bcf62c9bfcf68359f21a9c9cd0093b9b969.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <8a5b2d7a-cd31-ecbb-bdc2-35c881c9068d@suse.com>


Hello Matthias & All,

On Mon, 2021-01-11 at 11:08 +0100, Matthias Brugger wrote:
> 
> On 11/01/2021 03:18, gene_chen(陳俊宇) wrote:
> > [ Internal Use - External ]
> > 
> 
> Please don't top-post in the future.
> 
> > Hi Matthias,
> > 
> > I discussed OF match table with Mark in previous mail in our PATCH
> > v3,
> > MFD should just instantiate the platform device.
> 
> Did you ever test that? Which MFD driver should instantiate the
> device?
> I had a look at mt6360-core.c (the obvious one) but I don't see any
> reference to
> the regulator [1]. What am I missing?
> 
> > > 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.
> > 
> 
> Well from my understanding the regulator has a device-tree entry [2],
> so it
> needs to match against a device-tree node. My understanding is, that
> you need a
> the devicetree node to describe the regulators provided by the
> device. TBH I'm a
> bit puzzled about the comment from Mark here. How does another DT
> node be able
> to reference a regulator if this is not described in DT? I think we
> need a DT
> node here and the matching in the regulator and MFD driver to get the
> regulator
> loaded via udev.

Others are better to answer - but as I spotted this from my inbox I'll
give my 2 cents :) 

This can be done W/O regulators having own compatible. Please see
following:

drivers/mfd/rohm-bd718x7.c
drivers/regulator/bd718x7-regulator.c
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
Documentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yaml

as example.

The device matching can be done via platform_device_id table.
I think the MODULE_ALIAS() is needed for module matching - but I don't
remember without further code browsing.

Anyways, the BD71837/47/50 DT entry without compatible for
clk/regulators do probe and load the sub-devices.

As a "tradeoff" subdevices must retrieve the DT node from the parent
device.

For my uneducated eyes the DT binding for regulators should be changed.
Compatible should not be required and the example node should be moved
to MFD binding document in the MFD node. But that's just my view on
this - not willing to push this to any direction!

Best Regards
	Matti Vaittinen

--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland
SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~

Simon says - in Latin please.
"non cogito me" dixit Rene Descarte, deinde evanescavit

(Thanks for the translation Simon)

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

  reply	other threads:[~2021-01-11 10:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09 11:26 [PATCH v2 1/3] regulator: mt6360: Add OF match table matthias.bgg
2021-01-09 11:26 ` matthias.bgg
2021-01-09 11:26 ` matthias.bgg
2021-01-09 11:26 ` [PATCH v2 2/3] regulator: mt6358: " matthias.bgg
2021-01-09 11:26   ` matthias.bgg
2021-01-09 11:26   ` matthias.bgg
2021-01-09 11:26 ` [PATCH v2 3/3] regulator: mt6323: " matthias.bgg
2021-01-09 11:26   ` matthias.bgg
2021-01-09 11:26   ` matthias.bgg
2021-01-09 16:44   ` Aw: " Frank Wunderlich
2021-01-09 16:44     ` Frank Wunderlich
2021-01-09 16:44     ` Frank Wunderlich
2021-01-10 18:48     ` Matthias Brugger
2021-01-10 18:48       ` Matthias Brugger
2021-01-10 18:48       ` Matthias Brugger
2021-01-11  2:18 ` [PATCH v2 1/3] regulator: mt6360: " gene_chen(陳俊宇)
2021-01-11  2:18   ` gene_chen(陳俊宇)
2021-01-11  2:18   ` gene_chen(陳俊宇)
2021-01-11 10:08   ` Matthias Brugger
2021-01-11 10:08     ` Matthias Brugger
2021-01-11 10:08     ` Matthias Brugger
2021-01-11 10:32     ` Vaittinen, Matti [this message]
2021-01-11 10:32       ` Vaittinen, Matti
2021-01-11 10:32       ` Vaittinen, Matti
2021-01-11 12:38       ` Matthias Brugger
2021-01-11 12:38         ` Matthias Brugger
2021-01-11 12:38         ` Matthias Brugger
2021-01-11 12:53         ` Vaittinen, Matti
2021-01-11 12:53           ` Vaittinen, Matti
2021-01-11 12:53           ` Vaittinen, Matti
2021-01-11 14:42   ` Matthias Brugger
2021-01-11 14:42     ` Matthias Brugger
2021-01-11 14:42     ` Matthias Brugger
2021-01-11 16:41 ` Mark Brown
2021-01-11 16:41   ` Mark Brown
2021-01-11 16:41   ` Mark Brown
2021-01-12  9:54   ` Matthias Brugger
2021-01-12  9:54     ` Matthias Brugger
2021-01-12  9:54     ` Matthias Brugger

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=ef659bcf62c9bfcf68359f21a9c9cd0093b9b969.camel@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=chen.zhong@mediatek.com \
    --cc=gene_chen@richtek.com \
    --cc=hsin-hsiung.wang@mediatek.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=matthias.bgg@kernel.org \
    --cc=mbrugger@suse.com \
    /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.