diff mbox

[v2.2,2/2] dt-bindings: Adding compatible attribute for SKY81452 regulator

Message ID 1409539218-5571-3-git-send-email-jack.yoo@skyworksinc.com
State Superseded, archived
Headers show

Commit Message

Gyungoh Yoo Sept. 1, 2014, 2:40 a.m. UTC
Adding compatible attribute for SKY81452 regulator driver.

---
 Documentation/devicetree/bindings/regulator/sky81452-regulator.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Mark Brown Sept. 1, 2014, 10:31 a.m. UTC | #1
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?
Gyungoh Yoo Sept. 5, 2014, 1:55 a.m. UTC | #2
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
Mark Brown Sept. 6, 2014, 2:38 p.m. UTC | #3
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.
Gyungoh Yoo Sept. 11, 2014, 5:22 a.m. UTC | #4
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
Mark Brown Sept. 15, 2014, 10:35 p.m. UTC | #5
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.
Gyungoh Yoo Sept. 19, 2014, 6:17 a.m. UTC | #6
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 mbox

Patch

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>;