regulator: mt6360: Add OF match table
Subsystems (2)
PATCH v2 1/3 regulator: mt6360: Add OF match table
From: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
---
Changes in v2:
- check for CONFIG_OF
- add Fixes tag
drivers/regulator/mt6360-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/regulator/mt6360-regulator.c +9 -0
@@ -445,9 +445,18 @@ static const struct platform_device_id mt6360_regulator_id_table[] = { };MODULE_DEVICE_TABLE (platform, mt6360_regulator_id_table); +#ifdef CONFIG_OF +static const struct of_device_id mt6360_of_match[] = { + { .compatible ="mediatek,mt6360-regulator" , }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6360_of_match); +#endif +static struct platform_driver mt6360_regulator_driver = { .driver = { .name ="mt6360-regulator" , + .of_match_table =of_match_ptr (mt6360_of_match), }, .probe = mt6360_regulator_probe, .id_table = mt6360_regulator_id_table,
Signature · 7 lines
2.29.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 2/3 regulator: mt6358: Add OF match table
From: Matthias Brugger <[email protected]>
The binding documentation mentions that a compatible is required for the MT6358 device node. But the driver does not provide a OF match table. This way auto-loading is broken as the MFD driver that registers the device has a .of_compatible set which makes the platform .uevent callback report a OF modalias, but that's not in the module.
---
Changes in v2:
- check for CONFIG_OF
- add Fixes tag
drivers/regulator/mt6358-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/regulator/mt6358-regulator.c +9 -0
@@ -534,9 +534,18 @@ static const struct platform_device_id mt6358_platform_ids[] = { };MODULE_DEVICE_TABLE (platform, mt6358_platform_ids); +#ifdef CONFIG_OF +static const struct of_device_id mt6358_of_match[] = { + { .compatible ="mediatek,mt6358-regulator" , }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6358_of_match); +#endif +static struct platform_driver mt6358_regulator_driver = { .driver = { .name ="mt6358-regulator" , + .of_match_table =of_match_ptr (mt6358_of_match), }, .probe = mt6358_regulator_probe, .id_table = mt6358_platform_ids,
Signature · 7 lines
2.29.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 3/3 regulator: mt6323: Add OF match table
In reply to [email protected]From: Matthias Brugger <[email protected]>
The binding documentation mentions that a compatible is required for the MT6323 device node. But the driver does not provide a OF match table. This way auto-loading is broken as the MFD driver that registers the device has a .of_compatible set which makes the platform .uevent callback report a OF modalias, but that's not in the module.
---
Changes in v2:
- check for CONFIG_OF
- add Fixes tag
drivers/regulator/mt6323-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/regulator/mt6323-regulator.c +9 -0
@@ -406,9 +406,18 @@ static const struct platform_device_id mt6323_platform_ids[] = { };MODULE_DEVICE_TABLE (platform, mt6323_platform_ids); +#ifdef CONFIG_OF +static const struct of_device_id mt6323_of_match[] = { + { .compatible ="mediatek,mt6323-regulator" , }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6323_of_match); +#endif +static struct platform_driver mt6323_regulator_driver = { .driver = { .name ="mt6323-regulator" , + .of_match_table =of_match_ptr (mt6323_of_match), }, .probe = mt6323_regulator_probe, .id_table = mt6323_platform_ids,
Signature · 7 lines
2.29.2 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Aw: [PATCH v2 3/3] regulator: mt6323: Add OF match table
Hi
Quoted 15 lines
Gesendet: Samstag, 09. Januar 2021 um 12:26 Uhr
Von: [email protected]Changes in v2:
- check forCONFIG_OF
- add Fixes tagdrivers/regulator/mt6323-regulator.c +2
-0@@ -406,9 +406,18 @@ static const struct platform_device_id mt6323_platform_ids[] = { };MODULE_DEVICE_TABLE (platform, mt6323_platform_ids); +#ifdef CONFIG_OF +static const struct of_device_id mt6323_of_match[] = {
drivers/regulator/mt6323-regulator.c static const struct platform_device_id mt6323_platform_ids[] = { · line 420
Quoted 10 lines
drivers/regulator/mt6323-regulator.c +7
-0+ { .compatible = "mediatek,mt6323-regulator", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6323_of_match); +#endif +static struct platform_driver mt6323_regulator_driver = { .driver = { .name ="mt6323-regulator" , + .of_match_table =of_match_ptr (mt6323_of_match),
imho check for CONFIG_OF is here needed too, else mt6323_of_match is referenced but undefined
drivers/regulator/mt6323-regulator.c static const struct platform_device_id mt6323_platform_ids[] = { · line 423
Quoted 3 lines
drivers/regulator/mt6323-regulator.c +0
-0}, .probe = mt6323_regulator_probe, .id_table = mt6323_platform_ids,
regards Frank
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: Aw: [PATCH v2 3/3] regulator: mt6323: Add OF match table
Quoted 15 lines · Frank Wunderlich
Hi
Quoted 13 lines
Gesendet: Samstag, 09. Januar 2021 um 12:26 Uhr
Von: [email protected]Changes in v2:
- check forCONFIG_OF
- add Fixes tagdrivers/regulator/mt6323-regulator.c +0
-0@@ -406,9 +406,18 @@ static const struct platform_device_id mt6323_platform_ids[] = { };MODULE_DEVICE_TABLE (platform, mt6323_platform_ids);
Quoted 15 lines
drivers/regulator/mt6323-regulator.c static const struct platform_device_id mt6323_platform_ids[] = { · line 420
Quoted 12 lines
drivers/regulator/mt6323-regulator.c +9
-0+#ifdef CONFIG_OF +static const struct of_device_id mt6323_of_match[] = { + { .compatible ="mediatek,mt6323-regulator" , }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6323_of_match); +#endif +static struct platform_driver mt6323_regulator_driver = { .driver = { .name ="mt6323-regulator" , + .of_match_table =of_match_ptr (mt6323_of_match),imho check for
CONFIG_OFis here needed too, elsemt6323_of_matchis referenced but undefined
No, of_match_ptr already takes care of this:
https://elixir.bootlin.com/linux/latest/source/include/linux/of.h#L998
Regards,
Matthias
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
[ Internal Use - External ]
Hi Matthias,
I discussed OF match table with Mark in previous mail in our PATCH v3, MFD should just instantiate the platform device.
Quoted 10 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 4 lines
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_tablewill 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.
Quoted 55 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Saturday, January 9, 2021 7:26 PM
To: Liam Girdwood <[email protected]>; Mark Brown <[email protected]>
Cc: Hsin-Hsiung Wang <[email protected]>; Axel Lin <[email protected]>; Chen Zhong <[email protected]>;gene_chen(陳俊宇)<[email protected]>; [email protected]; [email protected]; [email protected]; Matthias Brugger <[email protected]>; Matti Vaittinen <[email protected]>; Matthias Brugger <[email protected]>
Subject: [PATCH v2 1/3] regulator: mt6360: Add OF match tableFrom: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
Fixes d321571d5e4c ("regulator: mt6360: Add support for MT6360 regulator")Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
- check forCONFIG_OF
- add Fixes tagdrivers/regulator/mt6360-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/regulator/mt6360-regulator.c +8
-1@@ -445,9 +445,18 @@ static const struct platform_device_id mt6360_regulator_id_table[] = { }; MODULE_DEVICE_TABLE(platform, mt6360_regulator_id_table); +#ifdef CONFIG_OF +static const struct of_device_id mt6360_of_match[] = { +{ .compatible ="mediatek,mt6360-regulator" , }, +{/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6360_of_match);#endif +static struct platform_driver mt6360_regulator_driver = { .driver = { .name ="mt6360-regulator" , +.of_match_table =of_match_ptr (mt6360_of_match), }, .probe = mt6360_regulator_probe, .id_table = mt6360_regulator_id_table, --
Quoted 1 line
2.29.2
************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 2 lines · gene_chen(陳俊宇)
[ Internal Use - External ]
Please don't top-post in the future.
Quoted 4 lines
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?
Quoted 8 lines
Quoted 7 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 4 lines
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.
Quoted 7 lines
Quoted 3 lines
Trying to autoload module without
of_id_tablewill cause run-time error:
ueventd: LoadWithAliases was unable to load of:NregulatorT(null)Cmediatek,mt6360-regulatorYou 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.
Regards,
Matthias
[1] https://elixir.bootlin.com/linux/latest/source/drivers/mfd/mt6360-core.c#L294
[2]
https://elixir.bootlin.com/linux/v5.10.6/source/Documentation/devicetree/bindings/regulator/mt6360-regulator.yaml
Quoted 58 lines
Quoted 55 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Saturday, January 9, 2021 7:26 PM
To: Liam Girdwood <[email protected]>; Mark Brown <[email protected]>
Cc: Hsin-Hsiung Wang <[email protected]>; Axel Lin <[email protected]>; Chen Zhong <[email protected]>;gene_chen(陳俊宇)<[email protected]>; [email protected]; [email protected]; [email protected]; Matthias Brugger <[email protected]>; Matti Vaittinen <[email protected]>; Matthias Brugger <[email protected]>
Subject: [PATCH v2 1/3] regulator: mt6360: Add OF match tableFrom: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
Fixes d321571d5e4c ("regulator: mt6360: Add support for MT6360 regulator")Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
- check forCONFIG_OF
- add Fixes tagdrivers/regulator/mt6360-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/regulator/mt6360-regulator.c +8
-1@@ -445,9 +445,18 @@ static const struct platform_device_id mt6360_regulator_id_table[] = { }; MODULE_DEVICE_TABLE(platform, mt6360_regulator_id_table); +#ifdef CONFIG_OF +static const struct of_device_id mt6360_of_match[] = { +{ .compatible ="mediatek,mt6360-regulator" , }, +{/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6360_of_match);#endif +static struct platform_driver mt6360_regulator_driver = { .driver = { .name ="mt6360-regulator" , +.of_match_table =of_match_ptr (mt6360_of_match), }, .probe = mt6360_regulator_probe, .id_table = mt6360_regulator_id_table, --Quoted 1 line
2.29.2
************* Email Confidentiality Notice ********************
Quoted 2 lines
The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Hello Matthias & All,
Quoted 37 lines · Matthias Brugger
Quoted 2 lines · gene_chen(陳俊宇)
[ Internal Use - External ]
Please don't top-post in the future.
Quoted 5 lines
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 atmt6360-core.c(the obvious one) but I don't see any reference to
the regulator [1]. What am I missing?Quoted 8 lines
Quoted 8 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 7 lines
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.Quoted 9 lines
Quoted 4 lines
Trying to autoload module without
of_id_tablewill cause run-time error:
ueventd: LoadWithAliases was unable to load of:NregulatorT(null)Cmediatek,mt6360-regulatorYou shouldn't have this described in the device tree at all, like I say
the MFD should just instantiate the platform device.
Quoted 13 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Hi Matti,
Quoted 61 lines · Matti
Hello Matthias & All,
Quoted 37 lines · Matthias Brugger
Quoted 2 lines · gene_chen(陳俊宇)
[ Internal Use - External ]
Please don't top-post in the future.
Quoted 5 lines
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 atmt6360-core.c(the obvious one) but I don't see any reference to
the regulator [1]. What am I missing?Quoted 8 lines
Quoted 8 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 7 lines
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.Quoted 9 lines
Quoted 4 lines
Trying to autoload module without
of_id_tablewill cause run-time error:
ueventd: LoadWithAliases was unable to load of:NregulatorT(null)Cmediatek,mt6360-regulatorYou shouldn't have this described in the device tree at all, like I say
the MFD should just instantiate the platform device.Quoted 13 lines
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:
Quoted 6 lines
drivers/mfd/rohm-bd718x7.cdrivers/regulator/bd718x7-regulator.cDocumentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yamlDocumentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yamlas example.
Thanks for the links. Yes that's' a way to go, but...
Quoted 8 lines
The device matching can be done via
platform_device_idtable. I think theMODULE_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.
Quoted 8 lines
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!
Generally speaking, DT bindings are stable and can't be changed in a none-compatible way. We could argue if there is any user of the compatible out there (probably there isn't any, as the code seems to not even be working). Apart from that all other cells in the MFD driver are defined as OF_MFD_CELL [1]. Actually I suspect that mt6360_ldo should represent mt6360-regulator.
Regards,
Matthias
[1] https://elixir.bootlin.com/linux/latest/source/drivers/mfd/mt6360-core.c#L294
Quoted 11 lines
Best Regards
Matti Vaittinen--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland
SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
Quoted 7 lines
~~~ "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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 103 lines · Matthias Brugger
Hi Matti,
Quoted 70 lines · Matti
Hello Matthias & All,
Quoted 51 lines · Matthias Brugger
Quoted 2 lines · gene_chen(陳俊宇)
[ Internal Use - External ]
Please don't top-post in the future.
Quoted 6 lines
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 atmt6360-core.c(the obvious one) but I don't see any
reference to
the regulator [1]. What am I missing?Quoted 16 lines
Quoted 10 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 9 lines
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.Quoted 5 lines
Trying to autoload module without
of_id_tablewill cause run- time
error:
ueventd: LoadWithAliases was unable to load of:NregulatorT(null)Cmediatek,mt6360-regulatorQuoted 5 lines
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 DTQuoted 8 lines
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:
Quoted 7 lines
drivers/mfd/rohm-bd718x7.cdrivers/regulator/bd718x7-regulator.cDocumentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yamlDocumentation/devicetree/bindings/regulator/rohm,bd71847-regulator.yamlas example.
Thanks for the links. Yes that's' a way to go, but...
Quoted 12 lines
The device matching can be done via
platform_device_idtable. I think theMODULE_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.Quoted 7 lines
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!
Quoted 5 lines
Generally speaking, DT bindings are stable and can't be changed in a none-compatible way. We could argue if there is any user of the compatible out
there (probably there isn't any, as the code seems to not even be working).
I think this depends on the device where driver(s) are used. Quite a few devices allow updating the device-tree when SW is updated. But as I said, I don't want to try pushing this one direction or other - I leave it for those who have broader shoulders for pushing XD.
I was merely trying to answer your question :)
Best Regards
Matti
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 14 lines · gene_chen(陳俊宇)
[ Internal Use - External ]
Hi Matthias,
I discussed OF match table with Mark in previous mail in our PATCH v3, MFD should just instantiate the platform device.
Quoted 6 lines
Mark Brown <[email protected]> 於 2020年8月20日 週四 下午7:45寫道:
Quoted 4 lines
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.
Quoted 7 lines
Quoted 3 lines
Trying to autoload module without
of_id_tablewill cause run-time error:
ueventd: LoadWithAliases was unable to load of:NregulatorT(null)Cmediatek,mt6360-regulatorYou shouldn't have this described in the device tree at all, like I say the MFD should just instantiate the platform device.
Well with the patch you send to enable regulators [1] you use OF_MFD_CELL. So my understanding is, if you don't provide an of_match_table in the regulator driver, the loading via udev is broken (like you mentioned in the cite from an older email).
Regards,
Matthias
[1]
https://lore.kernel.org/linux-mediatek/[email protected]/
Quoted 58 lines
Quoted 55 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Saturday, January 9, 2021 7:26 PM
To: Liam Girdwood <[email protected]>; Mark Brown <[email protected]>
Cc: Hsin-Hsiung Wang <[email protected]>; Axel Lin <[email protected]>; Chen Zhong <[email protected]>;gene_chen(陳俊宇)<[email protected]>; [email protected]; [email protected]; [email protected]; Matthias Brugger <[email protected]>; Matti Vaittinen <[email protected]>; Matthias Brugger <[email protected]>
Subject: [PATCH v2 1/3] regulator: mt6360: Add OF match tableFrom: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
Fixes d321571d5e4c ("regulator: mt6360: Add support for MT6360 regulator")Signed-off-by Matthias Brugger <[email protected]>---
Changes in v2:
- check forCONFIG_OF
- add Fixes tagdrivers/regulator/mt6360-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/regulator/mt6360-regulator.c +8
-1@@ -445,9 +445,18 @@ static const struct platform_device_id mt6360_regulator_id_table[] = { }; MODULE_DEVICE_TABLE(platform, mt6360_regulator_id_table); +#ifdef CONFIG_OF +static const struct of_device_id mt6360_of_match[] = { +{ .compatible ="mediatek,mt6360-regulator" , }, +{/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, mt6360_of_match);#endif +static struct platform_driver mt6360_regulator_driver = { .driver = { .name ="mt6360-regulator" , +.of_match_table =of_match_ptr (mt6360_of_match), }, .probe = mt6360_regulator_probe, .id_table = mt6360_regulator_id_table, --Quoted 1 line
2.29.2
************* Email Confidentiality Notice ********************
Quoted 2 lines
The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Mark Brown
maintainerQuoted 4 lines · On Sat, Jan 09, 2021 at 12:26:09PM +0100, [email protected] wrote:
From: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
The binding should be fixed to remove the requirement for a compatible here, this is both redundant since we already know we have a mt6380 from the core MFD and encoding details of how Linux implements things into the DT bindings.
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 10 lines · Mark Brown
Quoted 4 lines · On Sat, Jan 09, 2021 at 12:26:09PM +0100, [email protected] wrote:
From: Matthias Brugger <[email protected]>
Binding documentation mentions that a compatible is required for the MT6360 device node, but the driver doesn't provide a OF match table.
The binding should be fixed to remove the requirement for a compatible here, this is both redundant since we already know we have a mt6380 from the core MFD and encoding details of how Linux implements things into the DT bindings.
Ok, I'll leave that to the driver author to fix this. Just be aware that there is series for the MFD part which adds OF_MFD_CELL for the regulator.
Regards,
Matthias
Quoted 4 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek