Message ID | 1409539218-5571-3-git-send-email-jack.yoo@skyworksinc.com |
---|---|
State | Superseded, archived |
Headers | show |
On Mon, Sep 01, 2014 at 11:40:18AM +0900, Gyungoh Yoo wrote: > Adding compatible attribute for SKY81452 regulator driver. > Required properties: > +- compatible : Must be "skyworks,sky81452-regulator" Why is this a good idea - can this driver be used for anything other than a sky81452?
On Mon, Sep 01, 2014 at 11:31:58AM +0100, Mark Brown wrote: > On Mon, Sep 01, 2014 at 11:40:18AM +0900, Gyungoh Yoo wrote: > > Adding compatible attribute for SKY81452 regulator driver. > > > Required properties: > > +- compatible : Must be "skyworks,sky81452-regulator" > > Why is this a good idea - can this driver be used for anything other > than a sky81452? Thank you for the answer. Yes. There is a possibility that this driver will be used by similar device with SKY81452. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Sep 05, 2014 at 10:55:07AM +0900, Gyungoh Yoo wrote: > On Mon, Sep 01, 2014 at 11:31:58AM +0100, Mark Brown wrote: > > Why is this a good idea - can this driver be used for anything other > > than a sky81452? > Yes. There is a possibility that this driver will be used by similar > device with SKY81452. OK, so tha was slightly the wrong question. What added information is forcing the user to create a subnode and specify a compatible string providing? This driver is specifying a block of multiple regulators with absolute register addresses hard coded into it, there's no real ability to use the driver in a different configuration here. As soon as we see the parent device we already know everything there is to know about the IP block, having a separate compatible string just forces the user to do more typing for no gain.
On Sat, Sep 06, 2014 at 03:38:28PM +0100, Mark Brown wrote: > On Fri, Sep 05, 2014 at 10:55:07AM +0900, Gyungoh Yoo wrote: > > On Mon, Sep 01, 2014 at 11:31:58AM +0100, Mark Brown wrote: > > > > Why is this a good idea - can this driver be used for anything other > > > than a sky81452? > > > Yes. There is a possibility that this driver will be used by similar > > device with SKY81452. > > OK, so tha was slightly the wrong question. What added information is > forcing the user to create a subnode and specify a compatible string > providing? This driver is specifying a block of multiple regulators > with absolute register addresses hard coded into it, there's no real > ability to use the driver in a different configuration here. As soon as > we see the parent device we already know everything there is to know > about the IP block, having a separate compatible string just forces the > user to do more typing for no gain. Thank you for your comments. By the way, I knew that compatible string is used for binding a driver. http://devicetree.org/Device_Tree_Usage#Understanding_the_compatible_Property And, from kernel 3.6, MFD core has a mechanism for binding of_node to the driver with of_compatible. Can I have a question about if it is possible to assign compatible string for binding driver independently with reusability? Thanks, Gyungoh -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Sep 11, 2014 at 02:22:30PM +0900, Gyungoh Yoo wrote: > By the way, > I knew that compatible string is used for binding a driver. > http://devicetree.org/Device_Tree_Usage#Understanding_the_compatible_Property > And, from kernel 3.6, MFD core has a mechanism for binding of_node > to the driver with of_compatible. > Can I have a question about if it is possible to assign compatible string > for binding driver independently with reusability? Look at a driver like the wm831x regulator drivers - they don't have device tree but they're reusing a driver for an IP with the base register for the IP being specified in the MFD. If convering to DT it might be reasonable to specify this in device tree, though it's marginal since the part name in the core is also good enough.
On Mon, Sep 15, 2014 at 03:35:54PM -0700, Mark Brown wrote: > On Thu, Sep 11, 2014 at 02:22:30PM +0900, Gyungoh Yoo wrote: > > > By the way, > > I knew that compatible string is used for binding a driver. > > http://devicetree.org/Device_Tree_Usage#Understanding_the_compatible_Property > > > And, from kernel 3.6, MFD core has a mechanism for binding of_node > > to the driver with of_compatible. > > > Can I have a question about if it is possible to assign compatible string > > for binding driver independently with reusability? > > Look at a driver like the wm831x regulator drivers - they don't have > device tree but they're reusing a driver for an IP with the base > register for the IP being specified in the MFD. If convering to DT it > might be reasonable to specify this in device tree, though it's marginal > since the part name in the core is also good enough. Thank you for your comment. I agree. A child driver can look DT up and reference the base information in MFD with or without compatible string. My idea was about easy-binding of DT without referencing parent node because the recent kernel support this infrastructure. I will add more information in DT to reuse the driver for the IP, and I will resubmit. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt b/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt index f98b5ed..7b9ff18 100644 --- a/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt @@ -1,6 +1,7 @@ SKY81452 voltage regulator Required properties: +- compatible : Must be "skyworks,sky81452-regulator" - any required generic properties defined in regulator.txt Optional properties: @@ -8,7 +9,8 @@ Optional properties: Example: - regualtor { + regulator { + compatible = "skyworks,sky81452-regulator"; /* generic regulator properties */ regulator-name = "touch_en"; regulator-min-microvolt = <4500000>;