diff mbox

[2/3] iio: potentiometer: mcp4531: Add device tree binding documentation

Message ID 1466492137-32683-3-git-send-email-florian.vaussard@heig-vd.ch
State Changes Requested, archived
Headers show

Commit Message

Florian Vaussard June 21, 2016, 6:55 a.m. UTC
Add the device tree documentation for all the supported parts. Apart the
compatible string and standard I2C binding, no other binding is currently
needed.

Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
---
 .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt

Comments

Peter Rosin June 21, 2016, 7:38 a.m. UTC | #1
On 2016-06-21 08:55, Florian Vaussard wrote:
> Add the device tree documentation for all the supported parts. Apart the
> compatible string and standard I2C binding, no other binding is currently
> needed.
> 
> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
> ---
>  .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
>  1 file changed, 84 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> new file mode 100644
> index 0000000..b052299
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> @@ -0,0 +1,84 @@
> +* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
> +  driver
> +
> +The node for this driver must be a child node of a I2C controller, hence
> +all mandatory properties for your controller must be specified. See directory:
> +
> +        Documentation/devicetree/bindings/i2c
> +
> +for more details.
> +
> +Required properties:
> +	- compatible:  	Must be one of the following, depending on the
> +			model:
> +			"microchip,mcp4531-502"
> +			"microchip,mcp4531-103"
> +			"microchip,mcp4531-503"

*snip*

I'm not directly opposed, but I have used the following and DT booting
works like a charm here.

		mcp4651-104@28 {
			compatible = "mcp4651-104";
			reg = <0x28>;
		};

But, I suppose some DT documentation is not bad, and my understanding of
the device instantiation process and the i2c/dt interactions are not
complete, so my DT snippet might be an abomination? I'll leave the
decision if this is needed to someone with more experience on how other
drivers handle this.

Cheers,
Peter

--
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
Florian Vaussard June 21, 2016, 7:49 a.m. UTC | #2
Hello,

On 06/21/2016 09:38 AM, Peter Rosin wrote:
> On 2016-06-21 08:55, Florian Vaussard wrote:
>> Add the device tree documentation for all the supported parts. Apart the
>> compatible string and standard I2C binding, no other binding is currently
>> needed.
>>
>> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
>> ---
>>  .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
>>  1 file changed, 84 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>>
>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>> new file mode 100644
>> index 0000000..b052299
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>> @@ -0,0 +1,84 @@
>> +* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
>> +  driver
>> +
>> +The node for this driver must be a child node of a I2C controller, hence
>> +all mandatory properties for your controller must be specified. See directory:
>> +
>> +        Documentation/devicetree/bindings/i2c
>> +
>> +for more details.
>> +
>> +Required properties:
>> +	- compatible:  	Must be one of the following, depending on the
>> +			model:
>> +			"microchip,mcp4531-502"
>> +			"microchip,mcp4531-103"
>> +			"microchip,mcp4531-503"
> 
> *snip*
> 
> I'm not directly opposed, but I have used the following and DT booting
> works like a charm here.
> 
> 		mcp4651-104@28 {
> 			compatible = "mcp4651-104";
> 			reg = <0x28>;
> 		};
> 

I was not aware that the i2c subsystem had a facility to match the compatible
string against i2c_device_id. Good to know.

> But, I suppose some DT documentation is not bad, and my understanding of
> the device instantiation process and the i2c/dt interactions are not
> complete, so my DT snippet might be an abomination? I'll leave the
> decision if this is needed to someone with more experience on how other
> drivers handle this.
> 

Your compatible string is missing the vendor ID (microchip). This is the only
objection that I can see to your proposition. Let's wait to hear from a DT
maintainer.

Thanks,
Florian
--
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
Rob Herring (Arm) June 21, 2016, 9:37 p.m. UTC | #3
On Tue, Jun 21, 2016 at 09:49:20AM +0200, Florian Vaussard wrote:
> Hello,
> 
> On 06/21/2016 09:38 AM, Peter Rosin wrote:
> > On 2016-06-21 08:55, Florian Vaussard wrote:
> >> Add the device tree documentation for all the supported parts. Apart the
> >> compatible string and standard I2C binding, no other binding is currently
> >> needed.
> >>
> >> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
> >> ---
> >>  .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
> >>  1 file changed, 84 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> >>
> >> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> >> new file mode 100644
> >> index 0000000..b052299
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> >> @@ -0,0 +1,84 @@
> >> +* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
> >> +  driver
> >> +
> >> +The node for this driver must be a child node of a I2C controller, hence
> >> +all mandatory properties for your controller must be specified. See directory:
> >> +
> >> +        Documentation/devicetree/bindings/i2c
> >> +
> >> +for more details.
> >> +
> >> +Required properties:
> >> +	- compatible:  	Must be one of the following, depending on the
> >> +			model:
> >> +			"microchip,mcp4531-502"
> >> +			"microchip,mcp4531-103"
> >> +			"microchip,mcp4531-503"
> > 
> > *snip*
> > 
> > I'm not directly opposed, but I have used the following and DT booting
> > works like a charm here.
> > 
> > 		mcp4651-104@28 {
> > 			compatible = "mcp4651-104";
> > 			reg = <0x28>;
> > 		};
> > 
> 
> I was not aware that the i2c subsystem had a facility to match the compatible
> string against i2c_device_id. Good to know.
> 
> > But, I suppose some DT documentation is not bad, and my understanding of
> > the device instantiation process and the i2c/dt interactions are not
> > complete, so my DT snippet might be an abomination? I'll leave the
> > decision if this is needed to someone with more experience on how other
> > drivers handle this.
> > 
> 
> Your compatible string is missing the vendor ID (microchip). This is the only
> objection that I can see to your proposition. Let's wait to hear from a DT
> maintainer.

I2C subsystem happens to ignore the vendor prefix in matching. You 
should not rely on that and provide proper compatible strings.

Rob
--
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
Rob Herring (Arm) June 21, 2016, 9:43 p.m. UTC | #4
On Tue, Jun 21, 2016 at 08:55:36AM +0200, Florian Vaussard wrote:
> Add the device tree documentation for all the supported parts. Apart the
> compatible string and standard I2C binding, no other binding is currently
> needed.
> 
> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
> ---
>  .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
>  1 file changed, 84 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> new file mode 100644
> index 0000000..b052299
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
> @@ -0,0 +1,84 @@
> +* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
> +  driver
> +
> +The node for this driver must be a child node of a I2C controller, hence
> +all mandatory properties for your controller must be specified. See directory:
> +
> +        Documentation/devicetree/bindings/i2c
> +
> +for more details.
> +
> +Required properties:
> +	- compatible:  	Must be one of the following, depending on the
> +			model:
> +			"microchip,mcp4531-502"

These can go in trivial-devices.txt

> +			"microchip,mcp4531-103"
> +			"microchip,mcp4531-503"
> +			"microchip,mcp4531-104"
> +			"microchip,mcp4532-502"
> +			"microchip,mcp4532-103"
> +			"microchip,mcp4532-503"
> +			"microchip,mcp4532-104"
> +			"microchip,mcp4541-502"
> +			"microchip,mcp4541-103"
> +			"microchip,mcp4541-503"
> +			"microchip,mcp4541-104"
> +			"microchip,mcp4542-502"
> +			"microchip,mcp4542-103"
> +			"microchip,mcp4542-503"
> +			"microchip,mcp4542-104"
> +			"microchip,mcp4551-502"
> +			"microchip,mcp4551-103"
> +			"microchip,mcp4551-503"
> +			"microchip,mcp4551-104"
> +			"microchip,mcp4552-502"
> +			"microchip,mcp4552-103"
> +			"microchip,mcp4552-503"
> +			"microchip,mcp4552-104"
> +			"microchip,mcp4561-502"
> +			"microchip,mcp4561-103"
> +			"microchip,mcp4561-503"
> +			"microchip,mcp4561-104"
> +			"microchip,mcp4562-502"
> +			"microchip,mcp4562-103"
> +			"microchip,mcp4562-503"
> +			"microchip,mcp4562-104"
> +			"microchip,mcp4631-502"
> +			"microchip,mcp4631-103"
> +			"microchip,mcp4631-503"
> +			"microchip,mcp4631-104"
> +			"microchip,mcp4632-502"
> +			"microchip,mcp4632-103"
> +			"microchip,mcp4632-503"
> +			"microchip,mcp4632-104"
> +			"microchip,mcp4641-502"
> +			"microchip,mcp4641-103"
> +			"microchip,mcp4641-503"
> +			"microchip,mcp4641-104"
> +			"microchip,mcp4642-502"
> +			"microchip,mcp4642-103"
> +			"microchip,mcp4642-503"
> +			"microchip,mcp4642-104"
> +			"microchip,mcp4651-502"
> +			"microchip,mcp4651-103"
> +			"microchip,mcp4651-503"
> +			"microchip,mcp4651-104"
> +			"microchip,mcp4652-502"
> +			"microchip,mcp4652-103"
> +			"microchip,mcp4652-503"
> +			"microchip,mcp4652-104"
> +			"microchip,mcp4661-502"
> +			"microchip,mcp4661-103"
> +			"microchip,mcp4661-503"
> +			"microchip,mcp4661-104"
> +			"microchip,mcp4662-502"
> +			"microchip,mcp4662-103"
> +			"microchip,mcp4662-503"
> +			"microchip,mcp4662-104"
> +	-reg: Slave I2C address of the potentiometer
> +
> +Example:
> +mcp4561: mcp4561@2e {
> +	compatible = "microchip,mcp4561-103";
> +	reg = <0x2e>;
> +};
> -- 
> 2.5.0
> 
--
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
Florian Vaussard June 22, 2016, 6:19 a.m. UTC | #5
Hi Rob,

Le 21. 06. 16 à 23:43, Rob Herring a écrit :
> On Tue, Jun 21, 2016 at 08:55:36AM +0200, Florian Vaussard wrote:
>> Add the device tree documentation for all the supported parts. Apart the
>> compatible string and standard I2C binding, no other binding is currently
>> needed.
>>
>> Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
>> ---
>>  .../bindings/iio/potentiometer/mcp4531.txt         | 84 ++++++++++++++++++++++
>>  1 file changed, 84 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>>
>> diff --git a/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>> new file mode 100644
>> index 0000000..b052299
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
>> @@ -0,0 +1,84 @@
>> +* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
>> +  driver
>> +
>> +The node for this driver must be a child node of a I2C controller, hence
>> +all mandatory properties for your controller must be specified. See directory:
>> +
>> +        Documentation/devicetree/bindings/i2c
>> +
>> +for more details.
>> +
>> +Required properties:
>> +	- compatible:  	Must be one of the following, depending on the
>> +			model:
>> +			"microchip,mcp4531-502"
> 
> These can go in trivial-devices.txt
> 

Yes indeed. I will fix.

Thanks for the review.

Florian

>> +			"microchip,mcp4531-103"
>> +			"microchip,mcp4531-503"
>> +			"microchip,mcp4531-104"
>> +			"microchip,mcp4532-502"
>> +			"microchip,mcp4532-103"
>> +			"microchip,mcp4532-503"
>> +			"microchip,mcp4532-104"
>> +			"microchip,mcp4541-502"
>> +			"microchip,mcp4541-103"
>> +			"microchip,mcp4541-503"
>> +			"microchip,mcp4541-104"
>> +			"microchip,mcp4542-502"
>> +			"microchip,mcp4542-103"
>> +			"microchip,mcp4542-503"
>> +			"microchip,mcp4542-104"
>> +			"microchip,mcp4551-502"
>> +			"microchip,mcp4551-103"
>> +			"microchip,mcp4551-503"
>> +			"microchip,mcp4551-104"
>> +			"microchip,mcp4552-502"
>> +			"microchip,mcp4552-103"
>> +			"microchip,mcp4552-503"
>> +			"microchip,mcp4552-104"
>> +			"microchip,mcp4561-502"
>> +			"microchip,mcp4561-103"
>> +			"microchip,mcp4561-503"
>> +			"microchip,mcp4561-104"
>> +			"microchip,mcp4562-502"
>> +			"microchip,mcp4562-103"
>> +			"microchip,mcp4562-503"
>> +			"microchip,mcp4562-104"
>> +			"microchip,mcp4631-502"
>> +			"microchip,mcp4631-103"
>> +			"microchip,mcp4631-503"
>> +			"microchip,mcp4631-104"
>> +			"microchip,mcp4632-502"
>> +			"microchip,mcp4632-103"
>> +			"microchip,mcp4632-503"
>> +			"microchip,mcp4632-104"
>> +			"microchip,mcp4641-502"
>> +			"microchip,mcp4641-103"
>> +			"microchip,mcp4641-503"
>> +			"microchip,mcp4641-104"
>> +			"microchip,mcp4642-502"
>> +			"microchip,mcp4642-103"
>> +			"microchip,mcp4642-503"
>> +			"microchip,mcp4642-104"
>> +			"microchip,mcp4651-502"
>> +			"microchip,mcp4651-103"
>> +			"microchip,mcp4651-503"
>> +			"microchip,mcp4651-104"
>> +			"microchip,mcp4652-502"
>> +			"microchip,mcp4652-103"
>> +			"microchip,mcp4652-503"
>> +			"microchip,mcp4652-104"
>> +			"microchip,mcp4661-502"
>> +			"microchip,mcp4661-103"
>> +			"microchip,mcp4661-503"
>> +			"microchip,mcp4661-104"
>> +			"microchip,mcp4662-502"
>> +			"microchip,mcp4662-103"
>> +			"microchip,mcp4662-503"
>> +			"microchip,mcp4662-104"
>> +	-reg: Slave I2C address of the potentiometer
>> +
>> +Example:
>> +mcp4561: mcp4561@2e {
>> +	compatible = "microchip,mcp4561-103";
>> +	reg = <0x2e>;
>> +};
>> -- 
>> 2.5.0
>>
--
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/iio/potentiometer/mcp4531.txt b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
new file mode 100644
index 0000000..b052299
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/potentiometer/mcp4531.txt
@@ -0,0 +1,84 @@ 
+* Microchip MCP453X/454X/455X/456X/463X/464X/465X/466X Digital Potentiometer
+  driver
+
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties for your controller must be specified. See directory:
+
+        Documentation/devicetree/bindings/i2c
+
+for more details.
+
+Required properties:
+	- compatible:  	Must be one of the following, depending on the
+			model:
+			"microchip,mcp4531-502"
+			"microchip,mcp4531-103"
+			"microchip,mcp4531-503"
+			"microchip,mcp4531-104"
+			"microchip,mcp4532-502"
+			"microchip,mcp4532-103"
+			"microchip,mcp4532-503"
+			"microchip,mcp4532-104"
+			"microchip,mcp4541-502"
+			"microchip,mcp4541-103"
+			"microchip,mcp4541-503"
+			"microchip,mcp4541-104"
+			"microchip,mcp4542-502"
+			"microchip,mcp4542-103"
+			"microchip,mcp4542-503"
+			"microchip,mcp4542-104"
+			"microchip,mcp4551-502"
+			"microchip,mcp4551-103"
+			"microchip,mcp4551-503"
+			"microchip,mcp4551-104"
+			"microchip,mcp4552-502"
+			"microchip,mcp4552-103"
+			"microchip,mcp4552-503"
+			"microchip,mcp4552-104"
+			"microchip,mcp4561-502"
+			"microchip,mcp4561-103"
+			"microchip,mcp4561-503"
+			"microchip,mcp4561-104"
+			"microchip,mcp4562-502"
+			"microchip,mcp4562-103"
+			"microchip,mcp4562-503"
+			"microchip,mcp4562-104"
+			"microchip,mcp4631-502"
+			"microchip,mcp4631-103"
+			"microchip,mcp4631-503"
+			"microchip,mcp4631-104"
+			"microchip,mcp4632-502"
+			"microchip,mcp4632-103"
+			"microchip,mcp4632-503"
+			"microchip,mcp4632-104"
+			"microchip,mcp4641-502"
+			"microchip,mcp4641-103"
+			"microchip,mcp4641-503"
+			"microchip,mcp4641-104"
+			"microchip,mcp4642-502"
+			"microchip,mcp4642-103"
+			"microchip,mcp4642-503"
+			"microchip,mcp4642-104"
+			"microchip,mcp4651-502"
+			"microchip,mcp4651-103"
+			"microchip,mcp4651-503"
+			"microchip,mcp4651-104"
+			"microchip,mcp4652-502"
+			"microchip,mcp4652-103"
+			"microchip,mcp4652-503"
+			"microchip,mcp4652-104"
+			"microchip,mcp4661-502"
+			"microchip,mcp4661-103"
+			"microchip,mcp4661-503"
+			"microchip,mcp4661-104"
+			"microchip,mcp4662-502"
+			"microchip,mcp4662-103"
+			"microchip,mcp4662-503"
+			"microchip,mcp4662-104"
+	-reg: Slave I2C address of the potentiometer
+
+Example:
+mcp4561: mcp4561@2e {
+	compatible = "microchip,mcp4561-103";
+	reg = <0x2e>;
+};